/* 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(384px, 80vw); aspect-ratio: 384 / 464; touch-action: pan-y; }
.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: var(--maroon-deep); }
.poster::after { content: ""; position: absolute; inset: 0; background: rgba(88, 17, 16, .31); }
.poster > img:first-child { width: 100%; height: 100%; object-fit: cover; }
.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: 1px solid rgba(255, 236, 138, .55); background: rgba(31, 38, 32, .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: rgba(57, 80, 63, .5); 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(--gold); }
.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(--maroon); 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 */
@media (hover: hover) and (pointer: fine) { .strip:not([data-user]):hover .strip-track { animation-play-state: paused; } }
.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 .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(--gold); font-weight: 500; text-transform: capitalize; transition: background .2s, transform .15s;
}
.view-more:hover { background: #2a4030; }
.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(282.7px, 72.5vw); }
  .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; }
}
@media (max-width: 899px) { .hero-copy .display br { display: none; } }

/* 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; }
.events .title { font-size: 1.35rem; -webkit-text-stroke: .35px currentColor; }   /* thin display face: a touch heavier + larger when small */

/* details strip: pause control, pauses off-screen, calmer tilt/speed on phones */
.strip { position: relative; }
.strip-toggle { position: absolute; right: 46px; top: 50%; translate: 0 -50%; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.strip-toggle::before { content: ""; position: absolute; width: 30px; height: 30px; border-radius: 50%; background: rgba(31, 38, 32, .55); border: 1px solid rgba(255, 236, 138, .7); }
.strip-toggle .bars { position: relative; width: 10px; height: 12px; border-left: 3px solid #fff; border-right: 3px solid #fff; }
.strip-toggle[aria-pressed="true"] .bars { width: 0; height: 0; border-left: 10px solid #fff; border-right: 0; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.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; }
}
@media (prefers-reduced-motion: reduce) { .strip-toggle { display: none; } }
