/* EDIT: colours and fonts live here */
:root {
  color-scheme: light;
  --bg: #faf7f2;
  --bg-alt: #f2ede4;
  --surface: #ffffff;
  --ink: #2f2b27;
  --muted: #6f675e;
  --line: #e2dacd;
  --accent: #6f7f62;        /* sage */
  --accent-ink: #ffffff;
  --accent-soft: #e6ebe0;
  --danger: #a3452f;
  --serif: "Cormorant Garamond", Georgia, "Songti SC", "SimSun", serif;
  --sans: "Jost", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 10px;
  --max: 960px;
  --page-max: 1600px; /* the whole page stops growing past this on very wide screens */
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* or rules like .gate { display: flex } would override it */
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
html { background: #e9e3d8; } /* shows either side of the page on very wide screens */
body {
  margin: 0 auto;
  max-width: var(--page-max);
  min-height: 100svh; /* the page column reaches the bottom of tall screens */
  box-shadow: 0 0 40px rgba(0, 0, 0, .06);
  background: var(--bg);
  color: var(--ink);
  font: 300 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: clamp(2rem, 5vw, 2.75rem); text-align: center; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
strong { font-weight: 500; }
.muted { color: var(--muted); font-size: .95rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* language toggle and code gate */
.lang-toggle {
  position: fixed; top: .7rem; z-index: 20;
  left: max(1rem, calc((100vw - var(--page-max)) / 2 + 1rem)); /* the page's left edge, not the screen's */
  padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 400 .85rem var(--sans); cursor: pointer;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }
.gate {
  min-height: calc(100svh - 6rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4rem 1rem;
  background: radial-gradient(ellipse at top, var(--accent-soft), transparent 60%), var(--bg);
}
.gate h1 { font-size: clamp(3.25rem, 12vw, 6.5rem); font-weight: 400; margin: 0 0 2rem; }
.gate .code-form { max-width: 30rem; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-left: 6.5rem; /* room for the language toggle */
}
.nav-mark { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav-mark span { font-style: italic; color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: .9rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); }
.nav-links .nav-cta { color: var(--accent); font-weight: 500; }
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; }
}

/* hero */
.hero {
  min-height: calc(100svh - 3.5rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4rem 1rem;
  background:
    radial-gradient(ellipse at top, var(--accent-soft), transparent 60%),
    var(--bg);
}
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; color: var(--muted); }
.hero h1 { font-size: clamp(3.5rem, 13vw, 7.5rem); font-weight: 400; margin: 0; }
.amp { font-style: italic; color: var(--accent); }
.hero-sub { font-family: var(--serif); font-style: italic; font-size: 1.6rem; margin: .25rem 0 2rem; }
.hero-meta { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 2rem; margin-bottom: 1.5rem; }
.hero-meta p { margin: 0; }
.hero-date { font-size: 1.25rem; font-weight: 400; letter-spacing: .04em; }
.hero-place { color: var(--muted); }
.countdown { color: var(--muted); font-size: .95rem; min-height: 1.6em; }

/* buttons */
.button {
  display: inline-block; cursor: pointer;
  padding: .8rem 1.75rem; border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font: 400 .9rem var(--sans); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  transition: filter .15s;
}
.button:hover { filter: brightness(1.08); }
.button:disabled { opacity: .6; cursor: wait; }
.button.secondary { background: transparent; color: var(--accent); }
.link-button { background: none; border: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }

/* sections */
.section { padding: 5rem 1rem; }
.section > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.section.alt { background: var(--bg-alt); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.card p:last-child { margin-bottom: 0; }
.card-wide { grid-column: 1 / -1; }
/* A card that opens and closes (the nearby accommodation list). */
details.card > summary { display: flex; align-items: baseline; gap: 1rem; cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h3 { margin: 0; }
details.card > summary::after { content: "+"; margin-left: auto; font-size: 1.6rem; line-height: 1; color: var(--accent); }
details.card[open] > summary::after { content: "–"; }
details.card[open] > summary { margin-bottom: 1rem; }
.summary-hint { color: var(--muted); font-size: .9rem; }
/* Nearby accommodation (rendered by stays.go, sorted by app.js) */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.stays { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .92rem; }
.stays th, .stays td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.stays th { font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.stays .num { text-align: right; white-space: nowrap; }
.stays td:first-child { min-width: 14rem; }
.stays td:nth-child(2), .stays td:last-child { white-space: nowrap; }
.stays th button { all: unset; cursor: pointer; }
.stays th button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stays th button::after { content: " \2195"; opacity: .35; }
.stays th[aria-sort="ascending"] button::after { content: " \2191"; opacity: 1; }
.stays th[aria-sort="descending"] button::after { content: " \2193"; opacity: 1; }
.stays td small { display: block; color: var(--muted); font-size: .82rem; }
.stays-footnote { font-size: .85rem; margin: .75rem 0 0; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1em; }
ul.plain li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
ul.plain li:last-child { border-bottom: none; }

.timeline { list-style: none; padding: 0; max-width: 560px; }
.timeline li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.25rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.timeline time { font-family: var(--serif); font-size: 1.35rem; color: var(--accent); text-align: right; }
.timeline h3 { font-size: 1.3rem; margin: 0; }
.timeline p { margin: 0; color: var(--muted); }
.timeline-day { max-width: 560px; margin-top: 2.5rem; margin-bottom: 0; font-size: 1.6rem; text-align: center; }
h2 + .timeline-day { margin-top: 0; }

.feature { max-width: 640px; text-align: center; }
.feature-when { font-family: var(--serif); font-size: 1.6rem; margin-bottom: .25rem; }
.feature-where { color: var(--muted); }

.faq { max-width: 720px; }
.faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.faq summary { cursor: pointer; font-family: var(--serif); font-size: 1.35rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .75rem 0 0; color: var(--muted); }

.footer { text-align: center; padding: 3rem 1rem; color: var(--muted); font-family: var(--serif); font-size: 1.2rem; border-top: 1px solid var(--line); }

/* The couple photo behind the top of the details. It needs a valid code, so
   app.js sets --photo to its URL after unlocking, and the code page has none. */
.hero {
  justify-content: flex-end;
  padding-bottom: 4.5rem;
  color: #fff;
  background:
    linear-gradient(to bottom, rgba(28, 24, 20, 0) 30%, rgba(28, 24, 20, .35) 58%, rgba(28, 24, 20, .75) 100%),
    var(--photo, none) 57% 25% / cover no-repeat,
    #6f675e;
}
/* On tall screens a full-height photo would be cropped at the sides; stopping at
   1000px keeps the same framing as on an ordinary monitor. */
.hero { min-height: min(calc(100svh - 3.5rem), 1000px); }
.hero h1 { font-size: clamp(3rem, 9vw, 5.75rem); color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.hero .amp { color: #e3ebd8; }
.hero .hero-sub { color: #fff; margin-bottom: 1.5rem; }
.hero .eyebrow, .hero .hero-place, .hero .countdown { color: rgba(255, 255, 255, .9); }
.hero .hero-meta { border-color: rgba(255, 255, 255, .45); }
/* On wide screens the couple fills the middle of the photo, so the text moves
   to the left over the sofa and pillar, with the shading coming from the left. */
@media (min-width: 900px) {
  .hero {
    align-items: flex-start; justify-content: center; text-align: left;
    padding: 4rem 52% 4rem 7%; /* of the page, which stops growing at --page-max */
    background:
      linear-gradient(to right, rgba(28, 24, 20, .78) 0%, rgba(28, 24, 20, .5) 30%, rgba(28, 24, 20, 0) 50%),
      var(--photo, none) 57% 25% / cover no-repeat,
      #6f675e;
  }
  .hero h1 { font-size: clamp(3rem, 5.5vw, 4.75rem); }
  .hero .hero-meta { padding-left: 0; padding-right: 0; }
}

/* RSVP */
.rsvp { max-width: 640px; }
.code-form { text-align: center; }
.code-row { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.code-row input { width: 12rem; text-align: center; text-transform: uppercase; letter-spacing: .25em; font-size: 1.1rem; }

input[type=text], input[type=email], input[type=tel], input[type=search], input:not([type]), select, textarea {
  width: 100%; padding: .7rem .85rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 300 1rem var(--sans); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 5.5rem; resize: vertical; }
label, legend { display: block; font-weight: 400; margin-bottom: .35rem; }
fieldset { border: none; padding: 0; margin: 0; }
.field { margin-bottom: 1.25rem; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .3rem; }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice { position: relative; margin: 0; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-block; padding: .55rem 1.1rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .95rem; transition: background .15s, border-color .15s;
}
.choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.rsvp-greeting { text-align: center; margin-bottom: 2rem; }
.rsvp-greeting h3 { font-size: 1.9rem; }
.guest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem; }
.guest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.guest-head h4 { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; margin: 0; }
.tag { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.add-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: .5rem 0 2rem; }
.form-section { margin-top: 2.5rem; }
.form-section > h4 { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; margin: 0 0 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.form-actions { margin-top: 2rem; text-align: center; }
.form-error { color: var(--danger); margin-top: 1rem; }
.check-field label { display: flex; gap: .6rem; align-items: flex-start; font-weight: 300; cursor: pointer; }
.check-field input { margin-top: .35rem; accent-color: var(--accent); }

.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem; }
.summary h3 { text-align: center; }
.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.summary-guests { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.summary-guests li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.summary-guests .status { float: right; font-size: .9rem; }
.summary-guests .yes { color: var(--accent); }
.summary-guests .no { color: var(--muted); }
.summary-guests small { display: block; color: var(--muted); }
.reminder {
  background: #fbf3e2; border-left: 3px solid #c9a14a; border-radius: 6px;
  padding: .75rem 1rem; margin: 0 0 1.25rem; font-size: .95rem;
}
.notice { background: var(--accent-soft); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; text-align: center; }
