/* ═══════════════════════════════════════════════════════════════
   circles.css — circle windows, side panels, scroll animations
   ═══════════════════════════════════════════════════════════════ */

/* ── Scroll section ────────────────────────────────────────────── */
.circle-section {
  position: relative;
  height: 100vh;
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Circle + side panels layout ──────────────────────────────── */
.circle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  width: 100%;
  max-width: 1400px;
  padding: 0 32px;
}

/* ── Side panels ───────────────────────────────────────────────── */
.panel {
  flex: 1;
  max-width: 320px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.panel.revealed {
  opacity: 1;
  transform: translateY(0) !important;
}

.panel-left {
  text-align: left;
  transform: translateY(18px);
}

.panel-right {
  text-align: right;
  transform: translateY(18px);
}

.panel-line {
  display: block;
}

.panel-line + .panel-line {
  margin-top: 2px;
}

/* No special first-line treatment — all lines identical */
.panel-left .panel-line:first-child {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  margin-bottom: 0;
}

/* Left panel button links */
.panel-left .panel-link {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-align: inherit;
  text-transform: uppercase;
  letter-spacing: inherit;
}

/* Right panel links */
.panel-right .panel-link {
  display: inline-block;
  cursor: pointer;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.8;
  transition: text-decoration 0.15s;
  text-transform: uppercase;
  letter-spacing: inherit;
  padding: 0;
}

.panel-right .panel-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.panel-right .panel-link.active {
  text-decoration: underline;
  font-weight: 500;
}

/* Wedding script link — rose gold */
.panel-link-script {
  font-family: var(--font-script);
  font-size: 26px;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  color: #9c7870 !important;
}

.panel-link-script:hover {
  color: #9c7870 !important;
  text-decoration: none !important;
  opacity: 0.8;
}

/* THE VOICE red accent */
.voice-red {
  color: #e87070;
}

/* ── Circle window ─────────────────────────────────────────────── */
.circle-wrap {
  flex-shrink: 0;
  position: relative;
  width: 45vw;
  height: 45vw;
  max-width: 600px;
  max-height: 600px;
  cursor: pointer;
}

/* Layer 0: chrome/metallic bezel — behind circle-clip, visible as a ring */
.circle-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    from 20deg,
    #222 0deg,
    #999 35deg,
    #fff 58deg,
    #bbb 75deg,
    #444 110deg,
    #111 140deg,
    #888 165deg,
    #eee 182deg,
    #aaa 198deg,
    #333 230deg,
    #111 255deg,
    #777 285deg,
    #ddd 312deg,
    #fff 328deg,
    #888 345deg,
    #222 360deg
  );
  z-index: -1;
  filter: blur(0.5px);
  pointer-events: none;
  box-shadow:
    0 0 0 4px rgba(255,255,255,0.13),
    0 0 0 5px rgba(0,0,0,0.5),
    0 8px 32px rgba(0,0,0,0.8),
    0 2px 8px rgba(0,0,0,0.5),
    inset 0 1px 2px rgba(255,255,255,0.15);
}

/*
  Layer 3: chromatic ring — on .circle-wrap so it renders outside overflow:hidden.
*/
.circle-wrap::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    from 140deg,
    rgba(120, 160, 255, 0.05),
    rgba(255, 200, 140, 0.02),
    rgba(140, 220, 255, 0.04),
    rgba(255, 140, 200, 0.02),
    rgba(120, 160, 255, 0.05)
  );
  -webkit-mask: radial-gradient(circle, transparent 47%, black 48%, black 52%, transparent 53%);
  mask: radial-gradient(circle, transparent 47%, black 48%, black 52%, transparent 53%);
  pointer-events: none;
  z-index: 12;
  filter: blur(2px);
}

.circle-clip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #000;
  /*
    Layer 1: outer glow + inner rim depth via box-shadow.
    box-shadow works here because .circle-wrap has no overflow:hidden.
  */
  box-shadow:
    /* Outer floating shadow */
    0 20px 70px rgba(0, 0, 0, 0.95),
    0 6px 24px rgba(0, 0, 0, 0.8),
    /* Outer blue ambient glow */
    0 0 100px rgba(30, 58, 138, 0.35),
    /* Deep recess — makes the circle sit inside the bezel */
    inset 0 0 40px rgba(0, 0, 0, 0.7),
    /* Inner rim: top-left bright, bottom-right dark */
    inset 8px 8px 24px rgba(255, 255, 255, 0.07),
    inset -8px -8px 24px rgba(0, 0, 0, 0.8),
    /* Thin inner border ring */
    inset 0 0 0 2px rgba(0, 0, 0, 0.9);
}

/* Layer 2: specular highlight + vignette inside the circle */
.circle-clip::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    /* Top-left specular — main glass glint */
    radial-gradient(ellipse at 28% 22%, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.06) 35%, transparent 55%),
    /* Deep edge vignette */
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(0,0,0,0.25) 62%, rgba(0,0,0,0.6) 84%, rgba(0,0,0,0.8) 100%);
  pointer-events: none;
  z-index: 10;
}

/* ── Circle inner content area ─────────────────────────────────── */
.circle-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(251, 243, 250, 0.15) transparent;
  z-index: 5;
}

.circle-inner::-webkit-scrollbar {
  width: 3px;
}

.circle-inner::-webkit-scrollbar-thumb {
  background: rgba(251, 243, 250, 0.15);
  border-radius: 2px;
}

/* Circle image fill */
.circle-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* ── Placeholder fill ──────────────────────────────────────────── */
.circle-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* ── Goodbye circle — no cursor ────────────────────────────────── */
.circle-section--goodbye .circle-wrap {
  cursor: default;
}

/* ── Scroll-driven scale/squish (set by GSAP) ──────────────────── */
.circle-section:not([data-gsap-ready="true"]) .circle-wrap {
  transform: scale(0.88);
}

/* ── Video text + arrows — flat color, no gradient artifacts ──────── */
#vid-meta-title,
#vid-meta-yt,
.video-arrow,
.testimonial-arrow,
.vid-side-arrow {
  background: none !important;
  background-clip: unset !important;
  -webkit-background-clip: unset !important;
  -webkit-text-fill-color: unset !important;
  text-shadow: none !important;
}

/* ── Video meta bar — floats below circle, does not affect layout ─ */
#child-circle-column {
  position: relative;
  overflow: visible;
}

#video-meta-bar {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  z-index: 30;
}

/* ── Testimonial navigation arrows — outside the circle ────────── */
.testimonial-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, font-weight 0.2s;
  z-index: 20;
  width: 36px;
  height: 36px;
  pointer-events: auto;
}

.testimonial-arrow:hover {
  color: #ffffff;
  font-weight: 700;
}

.testimonial-arrow-prev { left: -52px; }
.testimonial-arrow-next { right: -52px; }

/* ── Video navigation arrows ───────────────────────────────────── */
.video-arrow {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

.video-arrow.visible {
  opacity: 1;
  pointer-events: auto;
}

.video-arrow:hover {
  color: var(--color-text);
}

/* ══════════════════════════════════════════════════════════════
   MOBILE — 768px and below
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Circle dimensions ─────────────────────────────────────── */
  .circle-wrap {
    width: 68vw;
    height: 68vw;
    max-width: 320px;
    max-height: 320px;
  }

  /* ── Panel base styles ─────────────────────────────────────── */
  .panel {
    max-width: 88%;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 0.06em;
    text-align: center !important;
  }

  .panel-left,
  .panel-right {
    transform: none !important;
  }

  /* ── GRID centering: circle always at visible viewport center ── *
   * Use 100dvh (dynamic viewport height) so the grid excludes the
   * mobile browser chrome — otherwise 1fr rows are off-center.     */
  .circle-section {
    padding-top: 0;
    align-items: stretch;
    justify-content: stretch;
    height: 100dvh;
    min-height: 100dvh;
  }

  .circle-row {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto 1fr;
    height: 100dvh;
    padding: 0 20px;
    box-sizing: border-box;
    gap: 0;
    width: 100%;
    max-width: 100%;
  }

  /* Panel-left bottom-aligns in its 1fr row — hugs top of circle */
  .circle-section .panel-left {
    align-self: end;
    padding-bottom: 20px;
  }

  /* Panel-right top-aligns in its 1fr row — hugs bottom of circle */
  .circle-section .panel-right {
    align-self: start;
    padding-top: 20px;
  }

  /* ── Child overlay: same 1fr/auto/1fr grid as base sections ──────
   * Matches the parent modal centering exactly — no fixed tricks.    */
  #child-circle-overlay {
    display: block !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  #child-circle-overlay .circle-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr auto 1fr !important;
    height: 100dvh !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
    gap: 0 !important;
    width: 100% !important;
  }

  /* Panel-left: invisible but stays in grid row 1 so circle lands in row 2 */
  #child-circle-overlay .panel-left {
    grid-row: 1 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    align-self: end !important;
  }

  /* Circle column: explicitly in row 2 (auto) — centers at 50dvh */
  #child-circle-column {
    grid-row: 2 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 68vw !important;
    max-width: 320px !important;
    align-self: center !important;
    justify-self: center !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  /* Video title/wedding text: higher above the circle, arrows sit below it */
  #video-meta-bar {
    position: absolute !important;
    bottom: calc(100% + 56px) !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: auto !important;
    text-align: center;
    padding: 0;
  }

  /* Nav links: explicitly in row 3, top-aligned (same as base panel-right) */
  #child-circle-overlay .panel-right {
    grid-row: 3 !important;
    position: static !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    align-self: start !important;
    padding-top: 40px !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    align-content: flex-start !important;
    gap: 4px 16px !important;
    max-width: 100% !important;
    line-height: normal !important;
    text-align: center !important;
  }

  #child-circle-overlay .panel-right .panel-line {
    display: inline-flex;
    flex: 0 0 auto;
  }

  /* ── Testimonial arrows: stay inside circle edge on mobile ── */
  .testimonial-arrow-prev,
  .testimonial-arrow-next {
    background: rgba(10,14,26,0.35);
    border-radius: 50%;
    color: var(--color-text);
    opacity: 1;
  }
  .testimonial-arrow-prev { left: 10px; }
  .testimonial-arrow-next { right: 10px; }

  /* ── Video arrows: stay inside circle edge (default mobile) ── */
  .video-arrow-prev,
  .video-arrow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 36px;
    height: 36px;
    background: rgba(10,14,26,0.35);
    border-radius: 50%;
    opacity: 1;
    pointer-events: auto;
    color: var(--color-text);
  }
  .video-arrow-prev { left: 10px; }
  .video-arrow-next { right: 10px; }

  /* ── Arrows in child overlay: just above circle, below the meta bar ── */
  #child-circle-overlay .testimonial-arrow:not(.vid-side-arrow),
  #child-circle-overlay .vid-side-arrow {
    position: absolute !important;
    bottom: calc(100% + 12px) !important;
    top: auto !important;
    background: none !important;
    border-radius: 0 !important;
    transform: none !important;
    font-size: 24px !important;
  }
  #child-circle-overlay .testimonial-arrow-prev:not(.vid-side-arrow),
  #child-circle-overlay .testimonial-arrow-prev.vid-side-arrow {
    left: auto !important;
    right: calc(50% + 16px) !important;
  }
  #child-circle-overlay .testimonial-arrow-next:not(.vid-side-arrow),
  #child-circle-overlay .testimonial-arrow-next.vid-side-arrow {
    left: calc(50% + 16px) !important;
    right: auto !important;
  }

  /* ── Info overlay: prevent H1 overflow ─────────────────────── */
  #overlay-info h1 {
    font-size: clamp(1.8rem, 9vw, 3rem) !important;
    white-space: normal !important;
    word-break: break-word;
  }

  #overlay-info .overlay-inner {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .info-rss-item {
    text-align: left;
  }
}
