/* ══════════════════════════════════════════════════════════════
   The Scarfe–Yap Gazette — reception site
   A printed broadsheet: newsprint, black ink, column rules.
   Masthead and headline type match the newspaper invitation
   (invite_tests/04-zoom1-wide.html). The email keeps its own styles.
   ══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  --paper:     #E8E2D2;
  --paper-low: #DCD5C2;
  --ink:       #1A1917;
  --ink-soft:  #45413A;
  --red:       #8A2318;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .09 0 0 0 0 .07 0 0 0 .55 -.12'/%3E%3C/filter%3E%3Crect width='320' height='320' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");

  --blackletter: 'UnifrakturCook', 'Old English Text MT', Georgia, serif;
  --headline:    'Playfair Display', Georgia, 'Times New Roman', serif;
  --woodtype:    'League Gothic', 'Arial Narrow', Impact, sans-serif;
  --body:        'Old Standard TT', Georgia, 'Times New Roman', serif;

  --sheet-w: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--paper); }

body { margin: 0; }

body, .leaf-page {
  background-color: var(--paper);
  background-image:
    var(--grain),
    linear-gradient(90deg, rgba(92, 74, 44, .2), transparent 7%, transparent 93%, rgba(92, 74, 44, .2));
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.42;
}

img { max-width: 100%; display: block; }
p { margin: 0; }
a { color: inherit; text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.skip-link {
  position: absolute; left: -9999px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 12px 20px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ─────────────── the sheet ─────────────── */

.sheet {
  max-width: var(--sheet-w); min-height: 100vh;
  margin: 0 auto; padding: 16px var(--gutter) 24px;
  display: flex; flex-direction: column;
}

main { flex: 1; }
main:focus { outline: none; }

/* ─────────────── nameplate ─────────────── */

.nameplate {
  display: grid; grid-template-columns: 150px 1fr 150px; gap: 14px; align-items: center;
}

.ear {
  padding: 6px 8px; border: 1px solid var(--ink);
  font-size: 13px; line-height: 1.2; text-align: center;
}
.ear b {
  display: block;
  font-family: var(--woodtype); font-weight: 400; font-size: 19px;
  letter-spacing: .04em; text-transform: uppercase;
}

.mast {
  display: block;
  font-family: var(--blackletter); font-weight: 700;
  font-size: clamp(29px, 9.4vw, 88px); line-height: 1.05;
  text-align: center; text-decoration: none; white-space: nowrap;
}

.motto { margin-top: 12px; font-size: 14px; font-style: italic; text-align: center; }

.dateline {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px;
  margin-top: 6px; padding: 4px 0;
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 14px; font-variant: small-caps; letter-spacing: .04em;
}
.dateline span:last-child { text-align: right; }

.nav { border-bottom: 4px solid var(--ink); }
.nav ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.nav li + li { border-left: 1px solid var(--ink); }
.nav a {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 4px;
  font-family: var(--woodtype); font-size: 22px; line-height: 1;
  letter-spacing: .05em; text-transform: uppercase;
  text-align: center; text-decoration: none;
}
.nav a:hover { background: var(--paper-low); }
.nav a[aria-current='page'] { background: var(--ink); color: var(--paper); }

/* With ears, the title gets only the space between them. */
@media (min-width: 861px) {
  .mast { font-size: calc((min(100vw, var(--sheet-w)) - 2 * var(--gutter) - 328px) / 9.4); }
}
@media (max-width: 860px) {
  .nameplate { grid-template-columns: 1fr; }
  .ear { display: none; }
  .motto { margin-top: 4px; }
}
@media (max-width: 620px) {
  .dateline { font-size: 13px; letter-spacing: 0; gap: 6px; }
  .nav ul { grid-template-columns: repeat(3, 1fr); }
  .nav li:nth-child(4) { border-left: 0; }
  .nav li:nth-child(n + 4) { border-top: 1px solid var(--ink); }
}

/* ─────────────── headlines ─────────────── */

h1, h2, h3 { font-weight: 400; text-wrap: balance; }

.kicker {
  margin-top: 16px;
  font-family: var(--woodtype); font-size: 22px; line-height: 1.1;
  letter-spacing: .08em; text-transform: uppercase; text-align: center;
}

h1 {
  margin: 4px 0 6px;
  font-family: var(--headline); font-weight: 900;
  font-size: clamp(36px, 7.2vw, 80px); line-height: 1.02;
  letter-spacing: -.012em; text-align: center;
}

.deck {
  max-width: 50ch; margin: 0 auto;
  font-size: clamp(19px, 2.4vw, 24px); font-style: italic; line-height: 1.25;
  text-align: center;
}

.byline {
  margin: 10px 0 14px; padding: 3px 0;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  font-size: 14px; font-variant: small-caps; letter-spacing: .08em; text-align: center;
}

h2 {
  margin: 0 0 6px;
  font-family: var(--woodtype); font-size: 28px; line-height: 1.05;
  letter-spacing: .03em; text-transform: uppercase;
}

/* ─────────────── newspaper setting ─────────────── */

.news p { text-align: justify; hyphens: auto; }
.news p + p { text-indent: 1em; }

.drop::first-letter {
  float: left; margin: 5px 7px 0 0;
  font-family: var(--headline); font-weight: 900; font-size: 58px; line-height: .8;
}

.pending { font-style: italic; color: var(--ink-soft); }

/* ─────────────── front page ─────────────── */

.lead-photo { margin: 0; }
.lead-photo img {
  width: 100%; height: auto; aspect-ratio: 2664 / 1272;
  border: 1px solid var(--ink);
  object-fit: cover; object-position: 56% 40%;
}
.lead-photo figcaption { margin-top: 3px; font-size: 14px; font-style: italic; }

@media (max-width: 620px) {
  .lead-photo img { aspect-ratio: 4 / 3; }
}

.front {
  display: grid; grid-template-columns: 2fr 1fr; gap: 28px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--ink);
}

.story { columns: 2; column-gap: 28px; column-rule: 1px solid var(--ink); }

.contents { border-left: 1px solid var(--ink); padding-left: 28px; }
.contents h2 { padding-bottom: 4px; border-bottom: 3px double var(--ink); text-align: center; }
.contents ul { list-style: none; margin: 0; padding: 0; }
.contents li + li { border-top: 1px solid var(--ink); }
.contents a {
  display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline;
  padding: 7px 0; text-decoration: none;
}
.contents strong { font-family: var(--headline); font-weight: 800; font-size: 19px; line-height: 1.2; }
.contents em { font-size: 14px; font-style: normal; font-variant: small-caps; }
.contents span { grid-column: 1 / -1; font-size: 15px; font-style: italic; line-height: 1.25; }
.contents a:hover strong { text-decoration: underline; }

.classifieds { margin-top: 16px; border-top: 4px solid var(--ink); }
.classifieds > h2 {
  margin: 0; padding: 5px 0 4px; border-bottom: 1px solid var(--ink);
  text-align: center; letter-spacing: .14em;
}
.classifieds__grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.ad { padding: 10px 14px; font-size: 16px; line-height: 1.25; }
.ad + .ad { border-left: 1px solid var(--ink); }
.ad h3 {
  margin: 0 0 2px;
  font-family: var(--woodtype); font-size: 21px; letter-spacing: .05em; text-transform: uppercase;
}

.reply-box {
  display: block; margin-top: 16px; padding: 8px 12px;
  border: 3px double var(--ink);
  font-size: 20px; text-align: center; text-decoration: none;
}
.reply-box b {
  font-family: var(--woodtype); font-weight: 400; font-size: 26px;
  letter-spacing: .06em; text-transform: uppercase;
}
.reply-box:hover { background: var(--ink); color: var(--paper); }

@media (max-width: 860px) {
  .front { grid-template-columns: 1fr; gap: 18px; }
  .contents { border-left: 0; border-top: 4px solid var(--ink); padding: 12px 0 0; }
  .front__main { display: contents; }
  .classifieds { order: 1; margin-top: 0; }
}
@media (max-width: 680px) {
  .classifieds__grid { grid-template-columns: 1fr; }
  .ad { padding: 10px 0; }
  .ad + .ad { border-left: 0; border-top: 1px solid var(--ink); }
}
@media (max-width: 560px) {
  .story { columns: 1; }
}

/* ─────────────── inside pages ─────────────── */

.column { max-width: 760px; margin: 0 auto; }

.notice {
  margin: 14px 0; padding: 8px 14px;
  border: 3px double var(--ink);
  text-align: center;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 8px 26px 7px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 0;
  font-family: var(--woodtype); font-size: 24px; line-height: 1;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; }

.actions { margin-top: 18px; text-align: center; }

/* timetable */
.timetable { margin: 0; border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink); }
.timetable > div {
  display: flex; align-items: baseline; gap: 8px;
  padding: 11px 0;
}
.timetable > div + div { border-top: 1px solid var(--ink); }
.timetable dt { order: 3; font-size: 18px; white-space: nowrap; }
.timetable dd {
  margin: 0;
  font-family: var(--headline); font-weight: 800; font-size: 22px; line-height: 1.15;
}
.timetable > div::after {
  content: ''; order: 2; flex: 1; min-width: 20px;
  border-bottom: 2px dotted var(--ink); transform: translateY(-4px);
}

/* venue */
.briefs {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 18px; border-top: 4px solid var(--ink);
}
.briefs section { padding: 12px 18px 0; }
.briefs section:first-child { padding-left: 0; }
.briefs section:last-child { padding-right: 0; }
.briefs section + section { border-left: 1px solid var(--ink); }
.briefs h2 { font-size: 25px; }
@media (max-width: 680px) {
  .briefs { grid-template-columns: 1fr; }
  .briefs section { padding: 12px 0; }
  .briefs section + section { border-left: 0; border-top: 1px solid var(--ink); }
}

/* letters */
.letters { columns: 2; column-gap: 32px; column-rule: 1px solid var(--ink); border-top: 4px solid var(--ink); padding-top: 12px; }
.letter { break-inside: avoid; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--ink); }
.letter h2 { font-family: var(--headline); font-weight: 800; font-size: 21px; letter-spacing: 0; text-transform: none; }
.letter__from { font-size: 15px; font-style: italic; text-align: right; }
.letter__reply { margin-top: 6px; }
.letter__reply b { font-variant: small-caps; letter-spacing: .04em; }
@media (max-width: 620px) {
  .letters { columns: 1; }
}

/* ─────────────── rsvp: the reply coupon ─────────────── */

.rsvp-step[hidden] { display: none; }
.rsvp-step:focus { outline: none; }

.coupon {
  margin-top: 16px; padding: 18px clamp(14px, 4vw, 30px);
  border: 2px dashed var(--ink);
}
.coupon__title {
  margin-bottom: 14px;
  font-family: var(--woodtype); font-size: 24px;
  letter-spacing: .1em; text-transform: uppercase; text-align: center;
}

.field { margin-bottom: 16px; }
.field > label,
.rsvp-dietary-label {
  display: block; margin-bottom: 2px;
  font-size: 16px; font-variant: small-caps; letter-spacing: .05em;
}

.rsvp-form input[type='text'],
.rsvp-form textarea {
  width: 100%; padding: 6px 2px;
  background: transparent; color: var(--ink);
  border: 0; border-bottom: 2px solid var(--ink); border-radius: 0;
  font: inherit; font-size: 19px;
}
.rsvp-form textarea { border: 1px solid var(--ink); padding: 8px; resize: vertical; }

.rsvp-guest { margin: 0 0 18px; padding: 0; border: 0; }
.rsvp-guest legend {
  float: left; width: 100%;   /* keeps the rule above the name, not through it */
  padding: 10px 0 0; border-top: 1px solid var(--ink);
  font-family: var(--headline); font-weight: 800; font-size: 22px;
}
.rsvp-choices { clear: both; display: flex; flex-wrap: wrap; gap: 0 26px; margin: 2px 0 8px; }
.rsvp-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.rsvp-choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }

.rsvp-status { margin-top: 12px; text-align: center; }
.rsvp-status:empty { margin-top: 0; }
.rsvp-status--error { color: var(--red); }

.cf-turnstile { display: flex; justify-content: center; margin-top: 18px; }

/* ─────────────── continued on ─────────────── */

.jump {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px;
  margin-top: 24px; font-size: 17px; font-style: italic;
}
.jump a { display: inline-flex; align-items: center; min-height: 44px; }
.jump__next { margin-left: auto; text-align: right; }

/* ─────────────── colophon ─────────────── */

.footer {
  margin-top: 6px; padding-top: 5px;
  border-top: 4px solid var(--ink);
  font-size: 14px; font-variant: small-caps; letter-spacing: .05em; text-align: center;
}

/* ─────────────── the turning page ─────────────── */

.turn-stage {
  position: fixed; inset: 0; z-index: 50;
  overflow: hidden; pointer-events: none;
  background: var(--paper);
  transform-style: preserve-3d;
}

.turn-under { position: absolute; top: 0; left: 0; height: 100%; overflow: hidden; }

/* The shadow the lifted page throws on the page beneath it. */
.turn-cast {
  position: absolute; inset: 0; opacity: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .46), rgba(0, 0, 0, .14) 45%, transparent 85%);
}

.turn-strip {
  position: absolute; top: 0; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  will-change: transform;
}

.turn-face {
  position: absolute; top: 0; left: 0; height: 100%;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.turn-face--back {
  transform: rotateY(180deg);
  background-color: var(--paper-low);
  background-image: var(--grain);
}

.leaf-page { position: absolute; top: 0; overflow: hidden; }

.turn-shade { position: absolute; inset: 0; }
