/* Dear Diary — story (single couple) page. Builds on styles.css tokens. */

.site-header nav a[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--gold); }

/* ---------- opening ---------- */
.story-open {
  position: relative;
  padding: 8rem var(--gutter) clamp(5rem, 9vw, 8rem);
  color: var(--lace);
  background:
    radial-gradient(70% 80% at 100% 0%, rgba(202,162,77,.16), transparent 60%),
    radial-gradient(70% 70% at 0% 100%, rgba(158,26,48,.32), transparent 60%),
    var(--plum);
}
.story-open::before { content: ""; position: absolute; inset: 0; background: var(--grain); opacity: .25; mix-blend-mode: overlay; pointer-events: none; }
.back { position: relative; color: var(--mist); font-size: var(--t-sm); }
.story-date { display: block; margin-top: 3rem; font-size: var(--t-lg); color: var(--gold); transform: rotate(-2deg); transform-origin: left; }
.story-names {
  margin-top: .5rem;
  font-size: clamp(3.4rem, 1.4rem + 8.5vw, 9rem);
  letter-spacing: -.02em; line-height: .95;
}
.story-names .amp { font-style: italic; color: var(--gold); }
.story-tagline {
  max-width: 34ch; margin-top: 1.75rem;
  font: italic 400 var(--t-md)/1.45 var(--f-display); color: var(--mist);
}
.story-facts {
  display: flex; flex-wrap: wrap; gap: 1.25rem 3rem;
  margin: 3rem 0 0; padding-top: 1.5rem;
  border-top: 1px solid rgba(248,245,247,.18);
}
.story-facts dt { font-size: .75rem; color: #bfaebb; }
.story-facts dd { margin: .2rem 0 0; font-size: var(--t-base); }

/* ---------- film: overlaps the opening band ---------- */
.story-film {
  position: relative; z-index: 1;
  max-width: 1100px; margin: clamp(-4rem, -6vw, -2.5rem) auto 0;
  padding: 0 var(--gutter);
}
.story-film .film-frame { background: var(--plum-deep); }
.film-caption { margin-top: 1rem; font-size: var(--t-sm); color: var(--ink-soft); }

/* ---------- diary note ---------- */
.story-note {
  max-width: 44rem; margin: 0 auto;
  padding: var(--section) var(--gutter) calc(var(--section) * .6);
}
.note-salute { font-size: var(--t-xl); color: var(--songket); }
.note-body p {
  margin-top: 1.25rem;
  font: 400 var(--t-md)/1.7 var(--f-display);
  max-width: 62ch;
}
.note-body p:first-child::first-letter {
  float: left; font-size: 4.2em; line-height: .8; padding: .08em .1em 0 0; color: var(--songket);
}
.note-sign { margin-top: 1.5rem; text-align: right; font-size: var(--t-lg); color: var(--ink-soft); }

/* ---------- gallery chapters ---------- */
.story-gallery { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.chapter { padding: clamp(2.5rem, 5vw, 4.5rem) 0; border-top: 1px solid var(--mist); }
.chapter-head { display: flex; align-items: baseline; gap: 1.25rem; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.chapter-time { font-size: var(--t-lg); color: var(--songket); min-width: 4.5rem; }
.chapter-head h2 { font-size: var(--t-xl); }

.scrap { display: grid; gap: clamp(1.25rem, 3vw, 2.75rem); align-items: start; }
.scrap-3 { grid-template-columns: 1.15fr 1fr 1fr; }
.scrap-3 .shot:nth-child(2) { margin-top: 4rem; }
.scrap-3 .shot:nth-child(3) { margin-top: 1.5rem; }
.scrap-flip { grid-template-columns: 1fr 1.15fr 1fr; }
.scrap-flip .shot:nth-child(1) { margin-top: 3rem; }
.scrap-flip .shot:nth-child(2) { margin-top: 0; }
.scrap-flip .shot:nth-child(3) { margin-top: 5rem; }
.scrap-2 { grid-template-columns: 1.7fr 1fr; align-items: center; }

.shot {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: none; cursor: zoom-in;
  text-align: left; color: inherit; font: inherit;
}
.shot .stamp, .shot .lace, .shot .ph { display: block; }
.shot > .ph { box-shadow: 0 16px 30px -18px rgba(40,19,43,.55); }
.shot .ph, .shot .stamp, .shot .lace { transition: transform .35s var(--ease); }
.shot:hover > .ph, .shot:hover > .stamp, .shot:hover > .lace { transform: translateY(-4px) rotate(-.6deg); }
.shot:focus-visible { outline-offset: 6px; }
.shot-note {
  display: block; margin-top: .85rem;
  font-size: var(--t-lg); color: var(--songket); transform: rotate(-2deg);
}

/* ---------- credits ---------- */
.story-credits {
  max-width: 1000px; margin: 0 auto;
  padding: var(--section) var(--gutter);
}
.story-credits h2 { font-size: var(--t-xl); }
.story-credits > p { margin-top: .75rem; color: var(--ink-soft); }
.credit-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 3rem; margin: 2.5rem 0 0;
}
.credit-list > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px dotted #cdbfc9;
}
.credit-list dt { font-size: var(--t-sm); color: var(--ink-soft); }
.credit-list dd { margin: 0; font-family: var(--f-display); font-size: var(--t-md); text-align: right; }
.credit-list a { text-decoration: none; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size .3s var(--ease); }
.credit-list a:hover { background-size: 100% 1px; }

/* ---------- pager ---------- */
.story-pager {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--mist); border-bottom: 1px solid var(--mist);
}
.pager-link {
  display: grid; gap: .35rem; padding: 2.5rem var(--gutter);
  text-decoration: none; transition: background-color .25s;
}
.pager-link:hover { background: #efe8ee; }
.pager-next { text-align: right; border-left: 1px solid var(--mist); }
.pager-dir { font-size: var(--t-sm); color: var(--ink-soft); }
.pager-name { font-family: var(--f-display); font-size: var(--t-lg); }

/* ---------- closing ---------- */
.story-cta {
  display: grid; justify-items: center; gap: 2rem; text-align: center;
  padding: var(--section) var(--gutter);
  background: var(--plum); color: var(--lace);
}
.story-cta h2 { font-family: var(--f-hand); font-size: clamp(1.8rem, 1rem + 3vw, 3rem); color: var(--gold); line-height: 1.3; }

/* ---------- photo viewer ---------- */
.viewer {
  width: min(92vw, 980px); max-height: 92vh;
  padding: clamp(1rem, 3vw, 2rem);
  border: 0; background: var(--lace); color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(0,0,0,.7);
}
.viewer::backdrop { background: rgba(40, 19, 43, .82); backdrop-filter: blur(4px); }
.viewer figure { margin: 0; }
.viewer-frame .ph { display: block; width: 100%; max-height: 70vh; aspect-ratio: 3 / 2; }
.viewer-caption { display: block; margin-top: 1rem; font-size: var(--t-lg); color: var(--ink-soft); }
.viewer-controls { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; }
.viewer-count { font-size: var(--t-sm); color: var(--ink-soft); margin-right: auto; order: -1; }
.viewer-close { margin-left: .75rem; }
@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: viewer-in .35s var(--ease); }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .scrap-3, .scrap-flip { grid-template-columns: 1fr 1fr; }
  .scrap-3 .shot, .scrap-flip .shot { margin-top: 0 !important; }
  .scrap-3 .shot-tall, .scrap-flip .shot-tall { grid-column: 1 / -1; width: min(85%, 420px); justify-self: center; }
  .scrap-2 { grid-template-columns: 1fr; }
  .scrap-2 .shot:nth-child(2) { width: min(75%, 360px); justify-self: end; }
  .credit-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .story-pager { grid-template-columns: 1fr; }
  .pager-next { border-left: 0; border-top: 1px solid var(--mist); }
  .chapter-head { flex-direction: column; gap: .25rem; }
}
