/* ============================================================
   CELL 3 · A DAY HERE — THE SIGNATURE (Hosted-Day Timeline)
   Scoped entirely under #cell-3. Tokens only (raw hex used only for
   documented brass/paper tints derived from the brand family).
   Authority: G4 cell-3 slice + WOW_CONTRACTS cell-3 row.
   Radius 16px · base #F5EFE5 (data-bg="marble") · alive at t0.

   MOTION CONTRACT (the WOW):
   - --rail-draw  (0 → 1) : brass connector width, scroll-linked (scrub) by
                            js/cells/cell-3.js. DEFAULTS TO 1 so no-JS /
                            reduced-motion / ?solo render a fully-drawn rail.
   - --m-in       (0 → 1) : per-moment lift (opacity + a few px). Set per
                            moment by the stagger; DEFAULTS TO 1 (content
                            present at t0; the lift only enhances).
   The connector-draw ENHANCES; it never gates content (alive at t0 law).
   ============================================================ */

#cell-3 {
  /* the signature lives in a calm paper breath (C1 light-led). A faint
     pressed-paper warmth over the Hearth-Paper base; a whisper of clay at the
     far corner ties it to the ribbon accent without a dark wash. */
  overflow: clip;
  background:
    radial-gradient(120% 80% at 8% 4%, rgba(255, 255, 255, 0.5), transparent 58%),
    radial-gradient(150% 130% at 100% 108%, rgba(168, 97, 71, 0.05), transparent 60%),
    var(--marble-50);
  /* default the two motion vars to their RESTING/COMPLETE state so every
     no-motion path (no-JS, reduced-motion, ?solo) reads content-complete. */
  --rail-draw: 1;
}

/* ═══════════════════ SECTION HEAD (centered invitation register) ═══════════════════ */
#cell-3 .day__head {
  max-width: 60rem;
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 1.6rem + 3vw, 4.25rem);
}
#cell-3 .day__eyebrow {
  color: var(--clay);
  font-weight: 600;
  margin-bottom: var(--space-s);
}
/* antique-brass hairline rule under the eyebrow (CSS-drawn, no illustrated
   leaf SVG — proof-rail/icon ruling: brass hairline glyphs only). A center
   pip flanked by two fading strokes = the invitation ornament, restrained. */
#cell-3 .day__head-rule {
  display: block;
  width: clamp(4rem, 2.5rem + 5vw, 6.5rem);
  height: 9px;
  margin: 0 auto clamp(1.1rem, 0.7rem + 1.2vw, 1.6rem);
  position: relative;
}
#cell-3 .day__head-rule::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  transform: translateY(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(168, 97, 71, 0.4) 22%,
    rgba(168, 97, 71, 0.7) 50%,
    rgba(168, 97, 71, 0.4) 78%,
    transparent 100%
  );
}
#cell-3 .day__head-rule::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--clay-soft);
  border: 1px solid var(--clay);
  border-radius: 2px;
}
#cell-3 .day__title {
  color: var(--meadow);
  font-size: var(--step-section);
  line-height: 1.06;
  letter-spacing: -0.006em;
  text-wrap: balance;
  margin-bottom: var(--space-m);
}
#cell-3 .day__title .em { color: var(--clay); font-style: italic; }
#cell-3 .day__lede {
  color: var(--text-on-paper);
  font-size: var(--step-1);
  line-height: 1.55;
  max-width: 46ch;
  margin-inline: auto;
  opacity: 0.9;
}

/* ═══════════════════ THE TIMELINE ═══════════════════ */
#cell-3 .day__timeline {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.75rem, 0.3rem + 1.6vw, 1.75rem);
  margin: 0;
  padding: 0;
  position: relative;
}

/* ── The connector rail ──
   The rail is a full-width hairline threaded through the dot row. It lives on
   the timeline's own ::before (static base = ALIVE AT T0) + ::after (the brass
   DRAW overlay whose width tracks --rail-draw). Positioned at the vertical
   center of the marker row. The markers sit ABOVE it (z-index). */
#cell-3 .day__timeline::before,
#cell-3 .day__timeline::after {
  content: "";
  position: absolute;
  top: var(--rail-y, 0);
  left: calc(100% / 12);          /* start at the center of column 1 */
  right: calc(100% / 12);         /* end at the center of column 6 */
  height: 1.5px;
  margin-top: -0.75px;            /* seat the hairline on --rail-y (its center) */
  pointer-events: none;
  border-radius: 2px;
}
/* static base rail — a faint always-present brass hairline (t0 alive).
   Spans dot-1-center → dot-6-center exactly (the left/right insets). */
#cell-3 .day__timeline::before {
  background: rgba(168, 97, 71, 0.18);
}
/* the DRAW overlay — a richer brass gradient revealed left→right. Occupies the
   SAME span (left/right insets), and reveals via scaleX(--rail-draw) from the
   left edge, so it can never overshoot the last dot (a width:% of the container
   would). transform-origin:left = draws from 9:00 AM toward 10:30 PM. */
#cell-3 .day__timeline::after {
  transform: scaleX(var(--rail-draw, 1));
  transform-origin: left center;
  background: linear-gradient(
    90deg,
    var(--clay) 0%,
    var(--clay-soft) 55%,
    rgba(168, 97, 71, 0.55) 100%
  );
  box-shadow: 0 0 0 0.5px rgba(168, 97, 71, 0.12);
}

/* ── A moment column ── time-label + title ABOVE the marker, card BELOW ── */
#cell-3 .day__moment {
  display: grid;
  /* rows: time · title · marker(rail row) · card */
  grid-template-rows: auto auto var(--marker-row, 2.5rem) 1fr;
  align-content: start;
  min-width: 0;
  text-align: center;
  /* CONTENT IS ALIVE AT T0 — opacity is NEVER driven by scroll. Every moment is
     fully legible at all scrub positions and on the whole-page composite (the
     no-scroll-reveal law). The scroll-linked WOW is carried ENTIRELY by the brass
     rail-draw (--rail-draw) + dot-ink (--dot-in) as pure enhancement; --m-in now
     only drives a whisper of upward settle (position, not visibility), so no
     moment ever fades in from hidden. */
  --m-in: 1;
  opacity: 1;
  transform: translateY(calc((1 - var(--m-in)) * 8px));
  will-change: auto;
}

#cell-3 .day__time {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* Deeper/honed clay, NOT the bright base clay: the time-label is small bold
     wayfinding DATA that must clear AA. --clay #A86147 on Hearth Paper measured
     4.11:1 (fails 4.5 for small text); --clay-deep #8C4F39 is a genuine deeper
     clay at 5.58:1 — reads warm, still unmistakably the accent (the honed-vs-
     bright accent nuance, 02-- §2.1). A11y verified. */
  color: var(--clay-deep);
  margin-bottom: 0.35rem;
}
#cell-3 .day__moment-title {
  font-family: var(--font-display);     /* Mini-Serif A (card/label title) */
  font-size: clamp(1.02rem, 0.9rem + 0.5vw, 1.28rem);
  line-height: 1.12;
  color: var(--meadow);
  margin-bottom: clamp(0.6rem, 0.4rem + 0.6vw, 0.95rem);
  text-wrap: balance;
}

/* ── Marker (dot on the rail) ── sits in its own row, centered on the rail ── */
#cell-3 .day__marker {
  position: relative;
  height: var(--marker-row, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: center;
}
#cell-3 .day__dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--marble-50);
  border: 1.5px solid var(--clay);
  box-shadow: 0 0 0 4px var(--marble-50);   /* paper halo so the rail reads under it */
  position: relative;
  z-index: 2;
  /* the dot "inks in": its clay fill scales up from the center as the rail
     reaches it. --dot-in (0→1) is set per moment by JS; defaults to 1. */
  --dot-in: 1;
}
#cell-3 .day__dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--clay);
  transform: scale(var(--dot-in, 1));
  transition: transform 260ms var(--ease-out);
}

/* ── The photo card ── uniform portrait frame so all six read as siblings ── */
#cell-3 .day__card {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
#cell-3 .day__photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;                   /* uniform portrait card (sibling parity) */
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--marble-100);
  box-shadow:
    0 20px 44px -30px rgba(51, 65, 58, 0.4),
    0 3px 9px -6px rgba(51, 65, 58, 0.25);
  isolation: isolate;
}
#cell-3 .day__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  /* bright-to-golden treatment (DESIGN.md photography law), held warm + gentle */
  filter: saturate(1.03) contrast(1.02) brightness(1.015);
  transform: scale(1.06);                /* headroom for the ambient drift */
  will-change: transform;
}
/* per-image object-position nudges so faces / the subject hold in the crop */
#cell-3 .day__moment[data-moment="1"] .day__photo { object-position: 58% 42%; }
#cell-3 .day__moment[data-moment="2"] .day__photo { object-position: 50% 40%; }
#cell-3 .day__moment[data-moment="3"] .day__photo { object-position: 50% 58%; }
#cell-3 .day__moment[data-moment="4"] .day__photo { object-position: 50% 60%; }
#cell-3 .day__moment[data-moment="5"] .day__photo { object-position: 46% 48%; }
#cell-3 .day__moment[data-moment="6"] .day__photo { object-position: 50% 62%; }

#cell-3 .day__caption {
  margin-top: clamp(0.7rem, 0.5rem + 0.5vw, 1rem);
  font-size: var(--step--1);
  line-height: 1.48;
  /* Muted Meadow-Ink, NOT --stone-500 (--text-on-paper-muted): #8B7E6D on
     Hearth Paper measured 3.46:1 and FAILS AA for body copy (same trap the
     hero reassurance hit). --ink-700 #526458 is a genuine muted Meadow-Ink at
     5.53:1 — keeps the caption a whisper under its title while staying readable.
     A11y verified. */
  color: var(--ink-700);
  text-wrap: pretty;
  /* sibling parity (C8): reserve a uniform caption box so a short caption holds
     the same height as a wrapping one — kills the line-count staircase.
     3 lines at this size covers the longest caption at desktop widths. */
  min-height: 4.3em;
}

/* ═══════════════════ CLOSING BAND — "more than a venue" ═══════════════════ */
#cell-3 .day__more {
  margin-top: clamp(3rem, 2rem + 4vw, 5.5rem);
  display: grid;
  grid-template-columns: 1.05fr 1.35fr 0.85fr;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-100);
  box-shadow: 0 26px 60px -42px rgba(51, 65, 58, 0.4);
}

/* left — the promise + single clay CTA */
#cell-3 .day__more-copy {
  position: relative;
  padding: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
}
/* a restrained CSS brass sprig mark (no illustrated SVG) — one ornament max */
#cell-3 .day__more-mark {
  width: 1.4rem;
  height: 1.4rem;
  margin-bottom: clamp(0.9rem, 0.6rem + 0.8vw, 1.4rem);
  border-left: 1.5px solid var(--clay);
  border-bottom: 1.5px solid var(--clay);
  border-bottom-left-radius: 14px;
  opacity: 0.72;
  position: relative;
}
#cell-3 .day__more-mark::before,
#cell-3 .day__more-mark::after {
  content: "";
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  border-top: 1.5px solid var(--clay-soft);
  border-right: 1.5px solid var(--clay-soft);
  border-top-right-radius: 8px;
}
#cell-3 .day__more-mark::before { left: 0.1rem; top: -0.15rem; transform: rotate(-32deg); }
#cell-3 .day__more-mark::after  { left: 0.55rem; top: 0.15rem; transform: rotate(-8deg); opacity: 0.75; }

#cell-3 .day__more-title {
  color: var(--meadow);
  font-size: clamp(1.6rem, 1.1rem + 1.5vw, 2.35rem);
  line-height: 1.1;
  margin-bottom: var(--space-s);
  text-wrap: balance;
}
#cell-3 .day__more-lede {
  color: var(--text-on-paper);
  font-size: var(--step-0);
  line-height: 1.55;
  max-width: 34ch;
  margin-bottom: clamp(1.25rem, 0.9rem + 1.2vw, 1.85rem);
  opacity: 0.92;
}
#cell-3 .day__more-cta {
  align-self: flex-start;
  gap: 0.6em;
}
#cell-3 .day__more-arrow {
  display: inline-block;
  transform: translateX(0);
  transition: transform 320ms var(--ease-out);
}

/* center — the wide dusk estate shot */
#cell-3 .day__more-media {
  position: relative;
  margin: 0;
  min-height: clamp(15rem, 12rem + 12vw, 24rem);
  isolation: isolate;
  overflow: hidden;
}
#cell-3 .day__more-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 46%;
  filter: saturate(1.04) contrast(1.02) brightness(1.02);
  transform: scale(1.05);
  will-change: transform;
}
#cell-3 .day__more-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* soft warm edge scrims so the copy panel + note card seam calmly */
  background:
    linear-gradient(90deg, rgba(251, 247, 241, 0.22), transparent 18%, transparent 82%, rgba(51, 65, 58, 0.16)),
    linear-gradient(0deg, rgba(51, 65, 58, 0.18), transparent 40%);
}

/* right — vellum "Family-run. Heart-led." note */
#cell-3 .day__more-note {
  padding: clamp(1.5rem, 1.1rem + 1.6vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: var(--paper-0);
  border-left: 1px solid var(--stone-200);
}
#cell-3 .day__more-note-mark {
  width: 6px;
  height: 6px;
  margin: 0 auto clamp(0.75rem, 0.5rem + 0.7vw, 1.1rem);
  transform: rotate(45deg);
  background: var(--clay-soft);
  border: 1px solid var(--clay);
  border-radius: 2px;
}
#cell-3 .day__more-note-eyebrow {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: clamp(0.6rem, 0.4rem + 0.5vw, 0.9rem);
  line-height: 1.3;
}
#cell-3 .day__more-note-body {
  font-family: var(--font-display);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.18rem);
  line-height: 1.4;
  color: var(--meadow);
  text-wrap: balance;
}

/* ═══════════════════ MOTION (scoped) ═══════════════════
   Hover = scale-not-shift, gated to hover:hover; states resolve on touch. */
@media (hover: hover) {
  #cell-3 .day__card {
    transition: transform 380ms var(--ease-out);
  }
  #cell-3 .day__photo-frame {
    transition: box-shadow 380ms var(--ease-out);
  }
  #cell-3 .day__moment:hover .day__card {
    transform: translateY(-0.28rem) scale(1.02);
  }
  #cell-3 .day__moment:hover .day__photo-frame {
    box-shadow:
      0 30px 56px -30px rgba(51, 65, 58, 0.46),
      0 5px 12px -6px rgba(51, 65, 58, 0.3);
  }
  #cell-3 .day__more-cta:hover .day__more-arrow { transform: translateX(0.22em); }
}

/* CTA focus glow (aliveness contract: focus glow) — matches cell-1 register */
#cell-3 .day__more-cta:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--paper-100),
    0 0 0 6px var(--clay),
    0 16px 32px -16px rgba(140, 79, 57, 0.55);
}

/* ═══════════════════ RESPONSIVE ═══════════════════ */

/* Tablet: 3-up timeline (two rows of three), rail becomes per-row segments.
   Rather than fight a wrapping horizontal rail, drop the horizontal rail here
   and let each moment carry a compact top marker — still one connected read. */
@media (max-width: 1080px) and (min-width: 761px) {
  #cell-3 .day__timeline {
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1.25rem, 0.8rem + 2vw, 2.25rem) clamp(1rem, 0.5rem + 1.5vw, 1.75rem);
  }
  /* the full-width horizontal rail can't thread a 2-row grid cleanly — hide the
     shared rail and give each marker its own short brass tick (content stays
     complete; the "connected day" read is carried by the shared dot styling). */
  #cell-3 .day__timeline::before,
  #cell-3 .day__timeline::after { display: none; }
  #cell-3 .day__marker::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: clamp(2.5rem, 8vw, 4.5rem);
    height: 1.5px;
    transform: translate(-50%, -50%);
    background: rgba(168, 97, 71, 0.22);
    border-radius: 2px;
  }
  #cell-3 .day__caption { min-height: 0; }
}

/* Mobile (< 761px): moments STACK, connector goes VERTICAL, drift off.
   The rail becomes a vertical brass hairline down the left; each moment is a
   row [ marker | content ]. Content-complete, no forced motion. */
@media (max-width: 760px) {
  #cell-3 .day__timeline {
    display: flex;
    flex-direction: column;
    gap: clamp(1.75rem, 1.2rem + 3vw, 2.75rem);
    position: relative;
    padding-left: 2.1rem;
  }
  /* vertical rail base + draw overlay down the left gutter. top/bottom insets
     define the full span; the draw reveals top→bottom via scaleY(--rail-draw). */
  #cell-3 .day__timeline::before,
  #cell-3 .day__timeline::after {
    top: 0.4rem;
    bottom: 0.4rem;
    left: 0.5rem;
    right: auto;
    width: 1.5px;
    height: auto;
    margin-top: 0;                       /* reset the desktop hairline seat */
  }
  #cell-3 .day__timeline::before { transform: none; }
  #cell-3 .day__timeline::after {
    transform: scaleY(var(--rail-draw, 1));
    transform-origin: top center;
    background: linear-gradient(
      180deg,
      var(--clay) 0%,
      var(--clay-soft) 55%,
      rgba(168, 97, 71, 0.55) 100%
    );
  }
  #cell-3 .day__moment {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    text-align: left;
    position: relative;
    transform: none;                    /* drift/lift off on mobile */
    opacity: 1;                         /* re-pinned: content alive at t0 on mobile too */
  }
  /* marker pinned into the left rail gutter */
  #cell-3 .day__marker {
    position: absolute;
    left: -2.1rem;
    top: 0.15rem;
    height: auto;
    width: 1rem;
  }
  #cell-3 .day__dot { box-shadow: 0 0 0 4px var(--marble-50); }
  #cell-3 .day__time { margin-bottom: 0.15rem; }
  #cell-3 .day__moment-title { margin-bottom: 0.7rem; }
  /* landscape photo reads better in a stacked mobile row */
  #cell-3 .day__photo-frame { aspect-ratio: 3 / 2; }
  #cell-3 .day__caption { min-height: 0; margin-top: 0.7rem; }

  /* closing band stacks: copy · media · note */
  #cell-3 .day__more { grid-template-columns: 1fr; }
  #cell-3 .day__more-media { min-height: 12rem; order: -1; }  /* photo leads on mobile */
  #cell-3 .day__more-note { border-left: none; border-top: 1px solid var(--stone-200); }
  #cell-3 .day__more-cta { align-self: stretch; justify-content: center; }
}

/* ═══════════════════ REDUCED-MOTION / SOLO — content-complete, still ═══════════════════
   Rail fully drawn, moments fully in, no drift transforms. (The vars already
   default to their complete state; this also freezes the photo headroom.) */
@media (prefers-reduced-motion: reduce) {
  #cell-3 { --rail-draw: 1; }
  #cell-3 .day__moment { --m-in: 1; opacity: 1; transform: none; }
  #cell-3 .day__dot { --dot-in: 1; }
  #cell-3 .day__photo,
  #cell-3 .day__more-photo { transform: scale(1.02); will-change: auto; }
}
.is-solo #cell-3,
.is-reduced-motion #cell-3 { --rail-draw: 1; }
.is-solo #cell-3 .day__moment,
.is-reduced-motion #cell-3 .day__moment { --m-in: 1; opacity: 1; transform: none; }
.is-solo #cell-3 .day__dot,
.is-reduced-motion #cell-3 .day__dot { --dot-in: 1; }
.is-solo #cell-3 .day__photo,
.is-solo #cell-3 .day__more-photo,
.is-reduced-motion #cell-3 .day__photo,
.is-reduced-motion #cell-3 .day__more-photo { transform: scale(1.02); will-change: auto; }
