/* Home page: hero flip-book, event accordion, sliding details strip, shared memories. */

/* ---------- hero ---------- */
.hero { display: grid; gap: 36px; align-items: center; padding-top: 12px; }
.hero-copy .display { margin-bottom: 20px; }
.actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) 384px minmax(0, 1fr); gap: clamp(28px, 4.5vw, 56px); padding-top: 28px; }
  .events { justify-self: end; }
}

/* ---------- single-page flip book ---------- */
.book-wrap { justify-self: center; padding: 14px 0; translate: -28px 0; }   /* optical centring: the stacked pages stick out ~34px on the right */
.book { position: relative; width: min(360px, 80vw); aspect-ratio: 27 / 40; touch-action: pan-y; }   /* a little wider than the video; photos and video are shown whole */
.book { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.book.dragging { cursor: grabbing; }
.curl { position: absolute; z-index: 5; pointer-events: none; max-width: none; }
.poster { position: absolute; inset: 0; z-index: 4; border-radius: 5px; overflow: hidden; background: linear-gradient(160deg, #3a1520, #1a0d11); }
.poster > img:first-child { width: 100%; height: 100%; object-fit: contain; }
.monogram { position: absolute; z-index: 1; left: 50%; top: 40%; width: 23%; height: auto; transform: translateX(-50%); }
.flip {
  position: absolute; z-index: 30; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 45px; height: 45px; padding: 0;
  border-radius: 50%; border: 0; background: rgba(36, 21, 25, .25); cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform .2s, background .2s;
}
.flip img { width: 25px; height: 25px; }
.flip:hover { background: rgba(255, 236, 138, .2); }
.flip:active { transform: scale(.92); }
.flip.prev { left: 10px; }
.flip.next { right: 10px; }

/* ---------- events accordion ---------- */
.events { width: 100%; max-width: 300px; }
.events details { border-bottom: .4px solid var(--line); padding: 15px 0; }
.events summary { display: flex; align-items: center; gap: 20px; cursor: pointer; list-style: none; }
.events summary::-webkit-details-marker { display: none; }
.events .chev { display: grid; place-items: center; padding: 6px; border-radius: 99px; background: #34111b; flex: none; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.events .chev img { width: 11.5px; height: 11.5px; }
.events details[open] .chev { transform: rotate(180deg); }
.events .title { font-family: var(--display); font-size: 1.25rem; color: var(--rose); }
.events .body { padding: 22px 15px 4px; display: grid; gap: 11px; }
.events .when { margin: 0; font-weight: 500; font-size: 0.75rem; letter-spacing: .1em; text-transform: uppercase; color: #fffae0; }
.events .where { margin: 0; font-size: 0.8125rem; line-height: 1.45; }
.events details[open] .body { animation: reveal .4s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- sliding details strip ---------- */
.strip { margin: 56px -30px 40px; background: var(--bg-2); transform: rotate(-3.08deg); overflow: hidden; }
.strip-track { display: flex; width: max-content; animation: slide 38s linear infinite; }
/* hovering pauses it for reading, but only until the visitor has used the play/pause button themselves */
/* Pauses while the mouse is over it, while it holds keyboard focus, and while a finger is held on it (home.js). */
.strip:hover .strip-track, .strip:focus-within .strip-track { animation-play-state: paused; }
.strip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.strip-group { display: flex; align-items: center; gap: 26px; padding: 12px 13px; flex: none; min-width: 100vw; justify-content: space-around; }
.strip-group > * { flex: none; }
.strip-group span, .strip-group a { font-weight: 700; font-size: clamp(0.9375rem, 2.3vw, 1.363rem); text-transform: capitalize; white-space: nowrap; text-decoration: none; }
.strip-group a:hover { text-decoration: underline; text-underline-offset: 4px; }
.strip-group .rsvp { color: var(--gold); }
.strip-group .tag { color: var(--rose); text-transform: none; }
.strip-group .sep { width: 18px; height: 18px; }
.strip-group .colours { height: 21px; width: auto; }
.strip-group .nums { display: flex; gap: 18px; }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .strip-track { animation: none; } .strip { overflow-x: auto; } }

/* ---------- shared memories ---------- */
.memories { max-width: calc(var(--max) + 32px); margin: 0 auto; padding: 0 16px; }
.memories .display { text-align: center; margin-bottom: 38px; }
.view-more {
  display: flex; align-items: center; justify-content: center; margin-top: 39px; padding: 14px 10px; border-radius: 10px; text-decoration: none;
  background: var(--bg-2); border: .75px solid var(--carton); font-weight: 500; text-transform: capitalize; transition: background .2s, transform .15s;
}
.view-more:hover { background: #4a1a2b; }
.view-more:active { transform: scale(.99); }

/* ---------- phone layout: book first, then title + buttons, then events ---------- */
@media (max-width: 899px) {
  .hero { display: flex; flex-direction: column; align-items: center; gap: 38px; padding-top: 51px; }
  .book-wrap { order: 1; padding: 14px 0 0; translate: -16px 0; }
  .book { width: min(270px, 72vw); }
  .hero-copy { order: 2; display: flex; flex-direction: column; align-items: center; gap: 23px; text-align: center; }
  .hero-copy .display { font-size: 2rem; margin: 0; white-space: nowrap; }
  .actions { align-items: center; }
  .events { order: 3; max-width: 281px; }
  .strip { margin-top: 44px; }
  .strip-group span, .strip-group a { font-size: 1.225rem; }
  .memories { padding: 0 30px; }
  .memories .display { margin-bottom: 30px; white-space: nowrap; font-size: clamp(1.75rem, 10.2vw, 2.5rem); }
  /* one tall photo per row, like the design */
  .jgrid.fill { gap: 16px; }
  .jgrid.fill > li { flex: 1 1 100%; aspect-ratio: 329 / 440; }
}


/* bigger phones / small tablets: let the event accordion grow, keeping 50-75px of side space */
@media (min-width: 400px) and (max-width: 899px) {
  .events { max-width: none; width: calc(100% - 2 * clamp(34px, 8vw, 59px)); }
}

/* hero buttons never break onto two lines: the text and padding shrink with the column instead */
.btn { white-space: nowrap; }
@media (min-width: 900px) {
  .hero-copy { container-type: inline-size; }
  .hero-copy .btn { font-size: clamp(0.75rem, 6.6cqi, 0.875rem); padding-inline: clamp(12px, 8cqi, 20px); }
}


/* =====================================================================
   v2 - accessibility, motion and craft packs
   ===================================================================== */
.events summary { min-height: 44px; }


/* details strip: pauses on hover, on a held finger and off-screen; calmer tilt/speed on phones */
.strip { position: relative; }
.strip[data-paused] .strip-track, .strip[data-offscreen] .strip-track { animation-play-state: paused; }
@media (max-width: 899px) {
  .strip { transform: rotate(-1.8deg); }
  .strip-track { animation-duration: 56s; }
}

/* =====================================================================
   Welcome screen, Figma "Home-no-gallery" / "Mobile" (Nov 2026)
   A darkened photo of the couple sits behind the header and hero; the details strip runs straight along the bottom
   of the window. Shared Memories only appears once guests have shared photos (see home.js).
   ===================================================================== */
body.home::before {
  content: ""; position: absolute; z-index: -1; top: 0; left: 0; right: 0; height: 100svh; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .83), rgba(0, 0, 0, .83)), url(/img/home-bg.jpg) center 13% / cover no-repeat;
}
body.home { position: relative; }
.home-screen { display: flex; flex-direction: column; }

/* Countdown: reads like a line from the invitation. Prata numerals straight on the photo, hairline dividers with equal
   space either side, a small gold line above, no box. Only a number that changes moves (home.js), rising into place;
   nothing moves with reduced motion. Each number has a fixed width so nothing shifts as the seconds tick. */
.countdown { display: inline-grid; grid-template-columns: repeat(4, auto); row-gap: 10px; }
.cd-eyebrow { grid-column: 1 / -1; margin: 0; font-size: 0.75rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.countdown > div { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 18px; }
.countdown > div:nth-child(2) { padding-left: 0; }
.countdown > div:last-child { padding-right: 0; }
.countdown > div + div { border-left: 1px solid rgba(255, 255, 255, .2); }
@media (min-resolution: 2dppx) { .countdown > div + div { border-left-width: .5px; } }
.countdown b {
  position: relative; overflow: hidden; display: block; width: 1.3em; text-align: center;
  font-family: var(--display); font-weight: 400; font-size: 2.5rem; line-height: 1.1; letter-spacing: -.02em;
}
.countdown b > i { display: block; font-style: normal; }
.countdown b > i.out { position: absolute; inset: 0; }
.countdown span { font-size: 0.75rem; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
@media (max-width: 899px) {
  .countdown { justify-items: center; }
  .cd-eyebrow { text-align: center; }
  .countdown > div { padding: 0 14px; }
  .countdown b { font-size: 2rem; }
}
.hero-copy .display { text-transform: uppercase; line-height: .86; margin: 0; }
.tagline { margin: 0; font-family: var(--display); font-size: 1.25rem; }
.mem-sub { margin: -24px 0 30px; text-align: center; font-size: 0.75rem; text-transform: capitalize; }
.strip { margin: 0; transform: none; }
.strip-group { padding: 8px 13px; }

@media (min-width: 900px) {
  .home-screen { min-height: calc(100svh - 84px); }
  .hero { flex: 1; width: 100%; max-width: calc(1155px + 32px); grid-template-columns: auto 360px auto; justify-content: space-between; gap: 40px; padding-top: 30px; padding-bottom: 40px; }
  .hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 23px; container-type: normal; }   /* sized by its content, not by the grid */
  .hero-copy .btn { font-size: 0.875rem; padding-inline: 20px; }
  .actions { margin-top: 0; }
  .book-wrap { translate: -14px 0; }
  .mem-sub { display: none; }
  .hero-copy .display { line-height: 1.12; }               /* ~10px more between the two lines */
  body.home .site-footer { display: none; }
  .memories { margin-top: 70px; }
  }

@media (max-width: 899px) {
  body.home::before {
    height: 625px;
    background: linear-gradient(180deg, rgba(36, 21, 25, 0), #241519), linear-gradient(rgba(0, 0, 0, .83), rgba(0, 0, 0, .83)), url(/img/home-bg.jpg) 50% 0 / 159% auto no-repeat;
  }
  .home-screen { align-items: center; padding-top: 23px; }
  .hero { display: contents; }
  .hero-copy { display: contents; }                       /* its parts slot around the flip-book, as in the mobile design */
  .hero-copy .display { order: 0; font-size: 2rem; line-height: 1.17; white-space: normal; text-align: center; margin-bottom: 16px; }   /* ~10px more between the two lines */
  .book-wrap { order: 1; }
  .countdown { order: 2; margin-top: 38px; }
  .home-screen > .strip { order: 3; align-self: stretch; margin: 44px -30px 0; transform: rotate(-1.8deg); }
  .tagline { order: 4; margin-top: 40px; text-align: center; font-size: 1rem; }
  .actions { order: 5; margin-top: 17px; gap: 7px; align-items: center; }
  .actions .btn.alt { background: transparent; border: 1px solid #dca1a1; }
  .events { order: 6; margin-top: 40px; width: calc(100% - 32px); }
  .events details + details { margin-top: 16px; }
  .memories { margin-top: 56px; }
  .memories .display { margin-bottom: 30px; }
}
.page-video { position: absolute; inset: 0; z-index: 6; width: 100%; height: 100%; object-fit: contain; border-radius: 5px; pointer-events: none; background: linear-gradient(160deg, #3a1520, #1a0d11); }
