/*
  Save the Date: Natalie & Nicolas, 17.07.2027, Feldafing.

  The hero follows the printed save-the-date: sunset sky, thin frame,
  spaced serif capitals and a script "the". The rest of the page is light
  and calm: warm off-white, dark ink, one green accent and thin lines.

  Fonts are loaded from fonts/fonts.css (self-hosted, no third-party requests).
  All colors live in :root below, so the scheme can be changed in one place.
*/

/* ---------- Colors and type ---------- */

:root {
  --paper: #f6f3ee;          /* main background */
  --white: #fdfbf8;          /* alternate section background */
  --ink: #23221f;            /* headings */
  --ink-soft: #45423d;       /* body text */
  --muted: #6b665f;          /* secondary text (about 4.8:1 on paper) */
  --line: rgba(35, 34, 31, 0.14);
  --accent: #4e6352;         /* sage green, small capitals and icons (about 5.9:1) */
  --deep: #2f3e34;           /* dark green RSVP section */
  --on-deep: #f6f3ee;        /* text on the dark green */
  --accent-on-deep: #c3d0c1; /* small capitals on the dark green */

  /* Hero only: sunset sky, sampled from the save-the-date photo */
  --cream: #fbf6ee;
  --line-cream: rgba(251, 246, 238, 0.6);
  --shade: 29, 23, 18;
  --sky-1: #7f7464;
  --sky-2: #957d61;
  --sky-3: #b88049;
  --sky-4: #dc812b;
  --sky-5: #ea8421;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);   /* side padding of sections */
  --frame: clamp(8px, 1.2vw, 16px);        /* inset of the thin frame lines */

  --display: "Playfair Display", Didot, "Bodoni 72", Georgia, serif;
  /* Same as --display, but with a classic "&" (see fonts.css) */
  --names: "Ampersand", var(--display);
  --script: "Mrs Saint Delafield", "Snell Roundhand", cursive;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Language switching ---------- */
/* Only text in the current page language is shown */

html[lang="de"] [lang="en"],
html[lang="de"] [lang="vi"],
html[lang="en"] [lang="de"],
html[lang="en"] [lang="vi"],
html[lang="vi"] [lang="de"],
html[lang="vi"] [lang="en"] {
  display: none !important;
}

/* ---------- Base ---------- */

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 760px) {
  body {
    font-size: 1.0625rem;
  }
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

/* Avoid single words on the last line (ignored by older browsers) */
p {
  text-wrap: pretty;
}

h1,
h2,
h3,
.kicker,
.band-quote,
.footer-line,
.note {
  text-wrap: balance;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.container {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
}

.narrow {
  max-width: 38rem;
}

section {
  padding: clamp(4.5rem, 11vw, 7.5rem) var(--gutter);
}

/* ---------- Shared elements ---------- */

/* Small spaced capitals, like "WIR HEIRATEN" on the card */
.kicker {
  margin-bottom: 1.1rem;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  line-height: 1.8;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  margin-bottom: 1.5rem;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.1rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
}

/* Short centered line */
.rule {
  width: 4.5rem;
  height: 0;
  margin: 3rem auto;
  border: 0;
  border-top: 1px solid var(--line);
}

/* Line-art heart */
.heart {
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linejoin: round;
}

/* ---------- Buttons and links ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.button:hover {
  background-color: var(--ink);
  color: var(--paper);
}

.text-link {
  display: block;
  width: fit-content;
  margin: 0.9rem auto 0;
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  line-height: 1.6;
  text-transform: uppercase;
  text-decoration: none;
}

.text-link::after {
  content: " ↓";
}

/* ================================================================
   Hero: the save-the-date card, set into the page with a margin
   ================================================================ */

.hero {
  --edge: clamp(8px, 1.4vw, 20px);          /* page margin around the card */
  --hero-h: clamp(540px, 80vh, 800px);      /* about 4/5 of the screen, so the page below peeks in */
  --sky-h: clamp(210px, 30vh, 320px);       /* height of the sky above the photo */
  --fade: 5rem;                             /* soft blend from sky into photo */

  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  width: calc(100% - 2 * var(--edge));
  /* On wide screens the card stops growing sideways, so the couple is not cut off */
  max-width: min(1180px, calc(var(--hero-h) * 1.5));
  height: var(--hero-h);
  margin: var(--edge) auto 0;
  overflow: hidden;
  /* Sky continues the sunset of the photo upwards */
  background:
    radial-gradient(ellipse 55% 40% at 38% var(--sky-h), rgba(255, 176, 70, 0.45) 0%, rgba(255, 176, 70, 0) 100%),
    linear-gradient(180deg,
      var(--sky-1) 0%,
      var(--sky-2) calc(var(--sky-h) * 0.3),
      var(--sky-3) calc(var(--sky-h) * 0.62),
      var(--sky-4) calc(var(--sky-h) * 0.88),
      var(--sky-5) var(--sky-h),
      var(--sky-5) 100%);
  color: var(--cream);
  text-shadow: 0 1px 12px rgba(70, 40, 15, 0.35);
}

/* On phones, svh ignores the browser bars that come and go while scrolling */
@supports (height: 1svh) {
  .hero {
    --hero-h: clamp(540px, 80svh, 800px);
    --sky-h: clamp(210px, 30svh, 320px);
  }
}

/* Thin frame line around the whole card */
.hero::after {
  content: "";
  position: absolute;
  inset: var(--frame);
  z-index: 2;
  border: 1px solid var(--line-cream);
  pointer-events: none;
}

.hero-photo {
  position: absolute;
  top: calc(var(--sky-h) - var(--fade) * 0.6);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 var(--fade));
  mask-image: linear-gradient(180deg, transparent 0, #000 var(--fade));
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 22%;
}

/* Wider screens crop the photo more, so it starts a little higher, behind the subtitle */
@media (min-width: 900px) {
  .hero-photo {
    top: calc(var(--sky-h) * 0.63);
  }

  .hero-photo img {
    object-position: 55% 0%;
  }
}

/* Darkens the bottom of the photo so names and details stay readable */
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(var(--shade), 0) 40%,
    rgba(var(--shade), 0.45) 70%,
    rgba(var(--shade), 0.85) 100%);
}

/* Top bar: monogram and language switch */
.topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: calc(var(--frame) + 0.25rem) calc(var(--frame) + 0.5rem) 0 calc(var(--frame) + 1rem);
  text-shadow: none;
}

.monogram {
  font-family: var(--names);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.lang-switch {
  display: flex;
  font-size: 0.72rem;
  font-weight: 500;
}

.lang-switch button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: 0.2em;
  cursor: pointer;
  opacity: 0.75;
}

.lang-switch button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 0.5em;
  opacity: 1;
}

/* SAVE the DATE, subtitle and heart, sitting in the sky */
.hero-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  /* the top bar is about 3.5rem tall */
  height: calc(var(--sky-h) - 3.5rem);
  padding: 0 1.25rem 0.25rem;
}

.std {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-family: var(--display);
  /* Follows the screen width, and also the height on short laptop screens */
  font-size: clamp(2.4rem, min(9.5vw, 10.5vh), 6.25rem);
  font-weight: 400;
  line-height: 1;
}

.std-caps {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The script "the", slightly lower and overlapping, like on the card */
.std-the {
  position: relative;
  top: 0.04em;
  margin: 0 0.2em 0 0.12em;
  font-family: var(--script);
  font-size: 1.2em;
  line-height: 0;
}

.hero-sub {
  margin-top: clamp(0.9rem, 2.2vw, 1.5rem);
  font-size: clamp(0.74rem, 1.5vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  /* letter-spacing adds space after the last letter; this re-centers the line */
  margin-right: -0.4em;
}

.hero-top .heart {
  flex-shrink: 0;
  width: clamp(1.6rem, 2.8vw, 2.1rem);
  height: clamp(1.6rem, 2.8vw, 2.1rem);
  margin-top: 0.7rem;
}

/* NATALIE & NICOLAS, date and venue, at the bottom of the photo */
.hero-bottom {
  margin-top: auto;
  padding: 0 calc(var(--frame) + 1rem) calc(var(--frame) + clamp(1.25rem, 3.5vw, 2.5rem));
}

.names {
  font-family: var(--names);
  font-size: clamp(1.15rem, 3.6vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  line-height: 1.2;
  text-transform: uppercase;
  margin-right: -0.3em;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 34rem;
  margin: clamp(1.1rem, 2.6vw, 1.75rem) auto 0;
}

.facts li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem clamp(0.5rem, 2vw, 1.5rem);
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.55;
}

.facts li + li {
  border-left: 1px solid var(--line-cream);
}

.facts svg {
  flex-shrink: 0;
  width: clamp(1.4rem, 3vw, 1.9rem);
  height: clamp(1.4rem, 3vw, 1.9rem);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.facts-caps {
  letter-spacing: 0.16em;
}

@media (max-width: 420px) {
  .names {
    letter-spacing: 0.2em;
    margin-right: -0.2em;
  }
}

/* Gentle fade-in, skipped if the guest prefers less motion */
@media (prefers-reduced-motion: no-preference) {
  .hero-top > *,
  .hero-bottom > * {
    animation: rise 1.1s ease-out both;
  }

  .hero-top > :nth-child(2) { animation-delay: 0.2s; }
  .hero-top > :nth-child(3) { animation-delay: 0.35s; }
  .hero-bottom > :nth-child(1) { animation-delay: 0.5s; }
  .hero-bottom > :nth-child(2) { animation-delay: 0.65s; }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ================================================================
   Welcome: message, countdown, RSVP date, calendar
   ================================================================ */

/* Live countdown: four equal columns with thin dividers */
.countdown {
  margin-top: 3rem;
}

.countdown[hidden] {
  display: none;
}

/* "Tage" normally, "Tag" when one day is left (set by script.js) */
.countdown [data-singular],
.countdown[data-one-day] [data-plural] {
  display: none;
}

.countdown[data-one-day] [data-singular] {
  display: inline;
}

.countdown .kicker {
  margin-bottom: 1.25rem;
}

.countdown-units {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 30rem;
  margin: 0 auto;
}

.countdown-units li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem;
}

.countdown-units li + li {
  border-left: 1px solid var(--line);
}

.countdown-number {
  color: var(--accent);
  font-family: var(--display);
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  line-height: 1;
  /* Same-width digits, so the numbers don't jump while counting */
  font-variant-numeric: lining-nums tabular-nums;
}

.countdown-unit {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  /* letter-spacing adds space after the last letter; this re-centers the word */
  margin-right: -0.18em;
}

/* Small phones: tighter labels, so "SEKUNDEN" keeps clear of the dividers */
@media (max-width: 400px) {
  .countdown-unit {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    margin-right: -0.1em;
  }
}

.deadline {
  margin-top: 2.5rem;
  color: var(--ink);
  text-wrap: balance;
}

/* ================================================================
   Program of the day
   ================================================================ */

.program {
  background: var(--white);
}

.program-list {
  display: grid;
  margin-top: 1rem;
}

.program-list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.25rem 0.5rem;
}

.program-list li + li {
  border-top: 1px solid var(--line);
}

.program-list svg {
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: 1.1rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.program-list .kicker {
  margin-bottom: 0.4rem;
}

.program-list h3 {
  margin-bottom: 0.6rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 1.75rem);
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
}

.program-list p:not(.kicker) {
  max-width: 19rem;
}

/* Wider screens: three columns with thin dividers, like the card */
@media (min-width: 760px) {
  .program-list {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 2.5rem;
  }

  .program-list li {
    padding: 0.5rem 2rem;
  }

  .program-list li + li {
    border-top: 0;
    border-left: 1px solid var(--line);
  }
}

.note {
  margin-top: 2.5rem;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.1rem;
  font-style: italic;
}

/* ================================================================
   Photo band with quote
   ================================================================ */

.band {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  justify-items: center;
  height: clamp(340px, 46vw, 620px);
  padding: 0 var(--gutter) clamp(2.25rem, 5vw, 3.75rem);
  overflow: hidden;
  color: var(--cream);
}

.band img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 50%;
}

/* Darkens the lower part so the quote stays readable */
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(20, 22, 20, 0) 35%, rgba(20, 22, 20, 0.6) 100%);
}

/* Frame line, like the card */
.band::after {
  content: "";
  position: absolute;
  inset: var(--frame);
  border: 1px solid var(--line-cream);
  pointer-events: none;
}

.band-quote {
  max-width: 40rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.6vw, 2.5rem);
  font-style: italic;
  line-height: 1.35;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

/* ================================================================
   Venue: photo and text side by side on wide screens, stacked on phones
   ================================================================ */

.venue-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

/* Same 3:2 shape on every device, so the photo never looks squeezed */
.venue-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: 50% 60%;
}

.venue address {
  margin: 1.5rem 0 2rem;
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
}

@media (min-width: 900px) {
  .venue-grid {
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(3rem, 6vw, 5.5rem);
  }

  /* Slightly taller next to the text, so photo and text are about the same height */
  .venue-photo img {
    aspect-ratio: 4 / 3;
  }

  .venue-text {
    text-align: left;
  }
}

/* ================================================================
   Good to know: label and answer per row, like a small FAQ
   ================================================================ */

.info {
  background: var(--white);
}

.info-container {
  max-width: 52rem;
}

.info-list {
  margin-top: 2.5rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.info-list > div {
  display: grid;
  gap: 0.35rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.info-list dt {
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  line-height: 1.8;
  text-transform: uppercase;
}

@media (min-width: 680px) {
  .info-list > div {
    grid-template-columns: 12rem 1fr;
    gap: 2rem;
    padding: 1.6rem 0;
  }

  .info-list dt {
    padding-top: 0.2rem;
  }
}

/* ================================================================
   RSVP by email
   ================================================================ */

.reply {
  background: var(--deep);
  color: var(--on-deep);
}

.reply .kicker {
  color: var(--accent-on-deep);
}

.reply .section-title {
  color: var(--on-deep);
}

.reply p:not(.kicker) {
  opacity: 0.88;
}

/* Deadline note: small print below the main text */
.reply .reply-note {
  max-width: 28rem;
  margin: 1.25rem auto 0;
  font-size: 0.8rem;
  line-height: 1.65;
  opacity: 0.7;
  text-wrap: balance;
}

.button-solid {
  margin-top: 2.25rem;
  padding-inline: 2.5rem;
  border-color: var(--on-deep);
  background: var(--on-deep);
  color: var(--deep);
}

.button-solid:hover {
  background: var(--on-deep);
  color: var(--deep);
  opacity: 0.85;
}

.button-solid::after {
  content: "→";
  margin-left: 0.75rem;
  letter-spacing: 0;
}

.reply p.mail-hint {
  margin-top: 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  opacity: 0.65;
  user-select: all;
  overflow-wrap: anywhere;
}

/* ================================================================
   Footer
   ================================================================ */

.footer {
  padding: clamp(4rem, 10vw, 6rem) var(--gutter) clamp(3.5rem, 8vw, 5rem);
}

.footer .heart {
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.footer-line {
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-style: italic;
  line-height: 1.3;
}

.footer-names {
  margin-top: 2.25rem;
  color: var(--ink);
  font-family: var(--names);
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-right: -0.3em;
}

.footer-date {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.24em;
}
