/* ========================================================================
   v4 Highlights carousel — glamorous, hero-shaped month-by-month slideshow.
   Sits before "What I owned". Uses its own class namespace (.chapter-*,
   .highlights-*) so it never collides with the content-edit selectors.
   ======================================================================== */

.highlights {
  position: relative;
  background:
    radial-gradient(115% 85% at 86% 8%, rgba(16, 130, 242, 0.20), transparent 58%),
    radial-gradient(85% 75% at 8% 95%, rgba(13, 52, 139, 0.38), transparent 62%),
    var(--oxford);
  color: #fff;
  overflow: hidden;
  padding: clamp(64px, 9vw, 120px) 0 clamp(48px, 7vw, 92px);
}

/* ── Section head ─────────────────────────────────────────────────────── */
.highlights-head {
  max-width: var(--maxw);
  margin: 0 auto clamp(28px, 4vw, 48px);
  padding: 0 var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.highlights-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
}
.highlights-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--azure);
}
.highlights-counter {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}
.highlights-counter b { color: #fff; font-weight: 700; }

/* ── Viewport + sliding track ─────────────────────────────────────────── */
.highlights-viewport {
  max-width: var(--maxw);
  margin: 0 auto;
  overflow: hidden;
  outline: none;
}
.highlights-track {
  display: flex;
  transition: transform 0.55s var(--ease);
  will-change: transform;
}
.chapter-slide {
  flex: 0 0 100%;
  min-width: 0;
  /* Bottom room so a tall (portrait) image's drop-shadow isn't hard-cropped
     by the viewport's overflow:hidden. */
  padding: 6px var(--gutter) 92px;
}

.chapter-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

/* Big watermark index */
.chapter-bigindex {
  position: absolute;
  top: -0.34em;
  left: -0.05em;
  font-size: clamp(170px, 25vw, 330px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.045);
  pointer-events: none;
  z-index: 0;
}

/* ── Text column ──────────────────────────────────────────────────────── */
.chapter-text {
  position: relative;
  z-index: 1;
}
.chapter-eyebrow {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 18px;
}
.chapter-eyebrow .sep { color: rgba(255, 255, 255, 0.28); }
.chapter-eyebrow .commits { color: var(--steel); }
.chapter-title {
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  color: #fff;
  text-wrap: balance;
}
.chapter-sub {
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.45;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 22px;
  max-width: 46ch;
  text-wrap: pretty;
}
.chapter-paras {
  display: grid;
  gap: 13px;
  max-width: 50ch;
}
.chapter-paras p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.64);
  text-wrap: pretty;
}
.chapter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.chapter-tag {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--baby);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 5px 11px;
  border-radius: 0.5rem;
}

/* ── Media column ─────────────────────────────────────────────────────── */
.chapter-media {
  position: relative;
  z-index: 1;
}
.chapter-frame {
  position: relative;
  max-width: 460px;
  margin-inline: auto;
  border-radius: 16px;
  padding: 9px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02));
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}
.chapter-frame image-slot {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  overflow: hidden;
}

/* ── Controls ─────────────────────────────────────────────────────────── */
.highlights-controls {
  max-width: var(--maxw);
  /* Negative top pulls the controls back up into the slide's new shadow
     padding, so the gap below the image stays what it was before. */
  margin: clamp(-56px, -3vw, -30px) auto 0;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 20px;
}
.highlights-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}
.highlights-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transform: scale(clamp(0.4, calc(1 - var(--dist, 0) * 0.16), 1));
  transform-origin: center;
  transition: background 0.2s var(--ease), width 0.28s var(--ease), transform 0.28s var(--ease);
}
.highlights-dot:hover { background: rgba(255, 255, 255, 0.45); }
.highlights-dot.is-active {
  width: 22px;
  background: var(--azure);
  transform: scale(1);
}
.highlights-arrows {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.hl-arrow {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.12s var(--ease);
}
.hl-arrow:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
}
.hl-arrow:active { transform: scale(0.94); }
.hl-arrow svg { width: 18px; height: 18px; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .chapter-inner {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .chapter-media { order: -1; }
  .chapter-bigindex {
    font-size: clamp(120px, 30vw, 180px);
    top: -0.3em;
    color: rgba(255, 255, 255, 0.05);
  }
}
