/* ==========================================================================
   Lucie & Pavel — wedding site stylesheet
   Mobile-first. Media queries live next to the rule they modify, not in one
   block at the end, so related styles stay together.
   ========================================================================== */

/* ---- Self-hosted Lato (Regular 400 + Bold 700) ----
   Downloaded directly from latofonts.com (OFL licensed) rather than Google
   Fonts, because the Google Fonts subset of Lato is missing some Czech
   diacritics. See assets/fonts/LATO-OFL.txt for the license. */
@font-face {
  font-family: 'Lato';
  src: url('../assets/fonts/Lato-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lato';
  src: url('../assets/fonts/Lato-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Design tokens ---- */
:root {
  /* Colors */
  --color-dark: #4d9674;
  --color-light: #caf7e0;
  --color-accent: #c17b5c;
  --color-bg: #faf7f2;
  --color-text: #3d3a34;
  --color-white: #ffffff;

  /* Semi-transparent tint used for the RSVP / schedule boxes */
  --color-light-tint: rgba(202, 247, 224, 0.3);
  --color-hairline: rgba(61, 58, 52, 0.15);

  /* Fonts */
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Lato', system-ui, -apple-system, sans-serif;

  /* Layout */
  --container-max-width: 1100px;
  --nav-height: 4.5rem;
  --section-padding-mobile: 4rem;
  --section-padding-desktop: 6rem;
  --radius: 12px;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.125rem; /* body text: +10% over the 1rem default, then +15%, then -10%, rounded */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--color-dark);
  line-height: 1.15;
  margin: 0 0 1rem;
  font-weight: 500;
}
/* Heading sizes: +30% over the browser defaults (2em/1.5em/1.17em), then +15%, rounded */
h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.75rem; }

p { margin: 0 0 1rem; }

a { color: inherit; }

img, iframe { max-width: 100%; }

/* ---- Utilities ---- */
.container {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: 1rem;
}
@media (min-width: 768px) {
  .container { padding-inline: 2rem; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--color-dark);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  border-radius: 0 0 6px 6px;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-accent {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-accent:hover,
.btn-accent:focus-visible {
  background: var(--color-accent);
  color: var(--color-white);
}

/* Consistent focus ring across all interactive elements */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Navigation
   Fixed (not sticky) and transparent at the top so it visually sits inside
   the hero. An IntersectionObserver on #hero (see js/main.js) adds
   .nav-solid once the hero scrolls out of view, swapping in a solid
   dark-color background. Nav text/icons stay white in both states.
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: transparent;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
.site-nav.nav-solid {
  background: var(--color-dark);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.nav {
  max-width: var(--container-max-width);
  margin-inline: auto;
  height: 100%;
  padding-inline: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 768px) {
  .nav { padding-inline: 2rem; }
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.75rem; /* +15% over 1.5rem, rounded */
  color: var(--color-white);
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-menu a {
  color: var(--color-white);
  text-decoration: none;
  font-size: 1.1rem; /* +15% over 0.95rem, rounded */
  letter-spacing: 0.02em;
}
.nav-menu a:hover { text-decoration: underline; }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--color-white);
  color: var(--color-white);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem; /* +15% over 0.85rem, rounded */
  cursor: pointer;
}
.lang-toggle:hover { background: rgba(255, 255, 255, 0.15); }

/* Standalone mobile toggle, sitting next to the hamburger so language can
   be switched without opening the menu first (unlike .nav-lang-item's
   copy of the toggle below, which is desktop-only). Hidden once the
   hamburger itself is (see the 1024px breakpoint further down). */
.lang-toggle-mobile {
  margin-left: auto;
  margin-right: 0.75rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
}
@media (min-width: 1024px) {
  .lang-toggle-mobile { display: none; }
}

/* Hamburger: hidden on desktop, three-line icon on mobile. min-width/height
   (not just padding) bring the tap target to 44px, matching the ~44-48px
   minimum recommended for touch targets — padding alone isn't enough here,
   since .hamburger-box's own layout height is just its 2px middle bar; the
   other two lines are absolutely-positioned pseudo-elements that overflow
   it visually without adding to that layout height. */
.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  padding: 0.625rem;
  cursor: pointer;
}
.hamburger-box {
  position: relative;
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
}
.hamburger-box::before,
.hamburger-box::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  transition: transform 0.2s ease;
}
.hamburger-box::before { top: -7px; }
.hamburger-box::after { top: 7px; }
.hamburger[aria-expanded="true"] .hamburger-box { background: transparent; }
.hamburger[aria-expanded="true"] .hamburger-box::before { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-box::after { transform: translateY(-7px) rotate(-45deg); }

/* Hamburger breakpoint is 1024px, not 768px like the content grid below:
   at the larger nav font sizes, the six labels + logo + lang toggle no
   longer fit on one line at 768px, so the nav collapses a bit further
   than the two-column layout does. */
@media (max-width: 1023.98px) {
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--color-dark);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-menu.is-open { max-height: 24rem; }
  .nav-menu li { width: 100%; }
  .nav-menu a {
    display: block;
    padding: 1rem;
    width: 100%;
    text-align: left;
  }
  /* Desktop-only copy of the toggle (see .lang-toggle-mobile above, which
     takes over on mobile, next to the hamburger instead of buried in this
     dropdown). */
  .nav-lang-item { display: none; }
}
@media (min-width: 1024px) {
  .hamburger { display: none; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative; /* containing block for the ::before background layer and the .hero-motif watermark */
  min-height: 100vh; /* fallback for browsers without dvh support */
  min-height: 100dvh; /* actual visible viewport, so mobile browser chrome
                          showing/hiding doesn't cut off or jump the hero */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  scroll-margin-top: 0;
}
@media (min-width: 768px) {
  .hero { min-height: 60vh; }
}

/* Background lives on its own layer behind the text (z-index: -1), so a
   background-image can be added here later (as an additional background
   layer beneath the gradient) without touching the markup or any of the
   text rules below. Subtle dark-color gradient for now. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--color-dark); /* solid fallback if background-image fails to load/parse */
  /* Soft vignette: transparent centre, darkening toward the corners, 17.5%
     black max. */
  background-image: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.175) 100%);
  background-size: cover;
  background-position: center;
  z-index: -1;
}

/* Motif watermark: the hand-drawn sprig from assets/motif.svg, inlined
   directly in the markup (see index.html) rather than referenced as a
   background-image/mask, so its fill="currentColor" can be recolored and
   dimmed with plain CSS — no mask-mode/luminance cross-browser gotchas.
   Faint and oversized, bleeding off the bottom-right corner as a quiet
   personal touch behind the hero text. Same z-index: -1 trick as ::before;
   it paints above that layer but stays below the hero text since it comes
   later in DOM order at the same stacking level. */
.hero-motif {
  position: absolute;
  right: -4%;
  bottom: -6%;
  height: clamp(242px, 37.4vh, 418px); /* +10% over clamp(220px, 34vh, 380px) */
  color: var(--color-white);
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}
@media (min-width: 768px) {
  .hero-motif {
    height: clamp(290px, 44.9vh, 502px); /* +20% over the mobile clamp(242px, 37.4vh, 418px) */
    right: 6%; /* shifted left 10 percentage points from the mobile -4% */
  }
}
.hero-motif svg {
  display: block;
  height: 100%;
  width: auto;
}

/* Hero content fades + rises in on page load, staggered per element. A
   plain CSS animation (not the IntersectionObserver used for the sections
   further down) since the hero is visible immediately, before any script
   runs — this way it always plays, with no dependency on JS executing. */
@keyframes hero-reveal {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero-divider, .hero-subtitle { animation: none; }
}

.hero h1 {
  color: var(--color-white);
  font-weight: 300;
  font-size: clamp(2.9rem, 9.2vw, 5.75rem); /* +15% over clamp(2.5rem, 8vw, 5rem), rounded */
  margin-block: 1rem;
  animation: hero-reveal 0.8s ease both;
}

/* Single centered hairline */
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  animation: hero-reveal 0.8s ease both;
  animation-delay: 0.2s;
}
.hero-divider-line {
  width: 6rem;
  height: 1px;
  background: var(--color-white);
  opacity: 0.8;
}

.hero-subtitle {
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: clamp(1.15rem, 2.9vw, 1.45rem); /* +15% over clamp(1rem, 2.5vw, 1.25rem), rounded */
  animation: hero-reveal 0.8s ease both;
  animation-delay: 0.35s;
  letter-spacing: 0.05em;
  margin: 0;
}

/* ==========================================================================
   Content grid — the mobile/desktop reordering mechanism.
   Every section keeps a fixed grid-area binding (.grid-rsvp -> area "rsvp",
   etc). Only grid-template-areas changes between breakpoints, so the SAME
   elements land in different visual positions with no JS reordering.
   DOM order equals mobile order, which keeps tab/reading order sane.
   ========================================================================== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "story"
    "rsvp"
    "schedule"
    "faq"
    "location"
    "form";
}

.grid-rsvp { grid-area: rsvp; }
.grid-story { grid-area: story; }
.grid-schedule { grid-area: schedule; }
.grid-faq { grid-area: faq; }
.grid-location { grid-area: location; }
.grid-form { grid-area: form; }

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 7fr 3fr;
    column-gap: 3rem;
    grid-template-areas:
      "story    rsvp"
      "story    schedule"
      "faq      schedule"
      "location schedule"
      "form     form";
  }
}

/* Generic section rhythm */
#rsvp, #story, #schedule, #faq, #location, #form {
  padding-block: var(--section-padding-mobile);
  scroll-margin-top: var(--nav-height);
}
@media (min-width: 768px) {
  #rsvp, #story, #schedule, #faq, #location, #form {
    padding-block: var(--section-padding-desktop);
  }
}

#story, #faq, #location { max-width: 65ch; }

/* Hairline separators between the non-boxed sections (no extra boxes here) */
#faq, #location, #form {
  border-top: 1px solid var(--color-hairline);
}

/* ==========================================================================
   RSVP — semi-transparent light-color box, white text
   ========================================================================== */
.rsvp {
  background: var(--color-light-tint);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  color: var(--color-white);
}
.rsvp p { color: var(--color-dark); }

/* #rsvp is also targeted by the shared section-rhythm rule above (same ID
   specificity), which would otherwise give it 4rem/6rem top/bottom padding
   instead of the box's own 2.5rem — this combined id+class selector wins
   so the box's padding matches the Program box exactly. */
#rsvp.rsvp {
  padding-block: 2.5rem;
}
/* On desktop RSVP still sits directly under the hero (see the "story rsvp"
   grid-template-areas row below), so it keeps the extra breathing room
   there. On mobile it now follows the welcome section instead (see
   .content-grid above), where the normal section padding is enough. */
@media (min-width: 768px) {
  #rsvp.rsvp {
    margin-top: 3rem;
  }
}

/* ==========================================================================
   Our story — plain text, no box
   ========================================================================== */
/* flow-root: without it, the floated .story-photo below wouldn't be
   contained in .story's height (floats don't count toward a normal
   block's height), and would spill into the next section. */
.story { display: flow-root; }
.story p { color: var(--color-text); }
/* .story p.story-signature (not just .story-signature): needs to beat
   ".story p" above on specificity, since that's a class+type selector. */
.story p.story-signature {
  text-align: right;
  color: var(--color-dark);
}

/* Photo floated at top-left, same treatment as .faq-dresscode-image —
   the paragraphs below wrap around it and flow full-width once they
   clear it. */
.story-photo {
  float: left;
  width: 50%;
  margin: 0 1.25rem 1rem 0;
  border-radius: var(--radius);
}

/* ==========================================================================
   Schedule — same box style as RSVP, no border. Sticky on desktop only.
   ========================================================================== */
.schedule-box {
  background: var(--color-light-tint);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  color: var(--color-dark);
}

@media (min-width: 768px) {
  .schedule-box {
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
    /* align-self:start is required: without it the grid item stretches to
       fill its row, leaving sticky no room to actually stick */
    align-self: start;
  }
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
}
.timeline-item:last-child { padding-bottom: 0; }

/* thin vertical line connecting the dots */
.timeline-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: -6px;
  width: 1px;
  background: var(--color-dark);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: absolute;
  left: -12px;
  top: -10px;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: 1.5rem;
  line-height: 1;
}

.timeline-time {
  font-family: var(--font-body);
  font-size: 1rem; /* +15% over 0.85rem, rounded */
  letter-spacing: 0.04em;
  color: var(--color-accent);
  opacity: 0.9;
}
.timeline-label {
  font-family: var(--font-heading);
  font-size: 1.5rem; /* +15% over 1.3rem, rounded */
}

/* ==========================================================================
   FAQ — borderless accordion, hairline rules, animated chevron & height
   ========================================================================== */
.accordion { margin-top: 1rem; }

.accordion-item {
  border-bottom: 1px solid var(--color-hairline);
}
.accordion-heading { margin: 0; }

.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.25rem 2rem 1.25rem 0;
  position: relative;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.2rem; /* +15% over 1.05rem, rounded */
  color: var(--color-text);
  cursor: pointer;
}
/* Chevron drawn with a rotated border, rotates open via aria-expanded */
.accordion-trigger::after {
  content: '';
  position: absolute;
  right: 0.25rem;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-accent);
  border-bottom: 2px solid var(--color-accent);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.25s ease;
}
.accordion-trigger[aria-expanded="true"]::after {
  transform: translateY(-30%) rotate(225deg);
}

/* grid-rows 0fr -> 1fr trick: animates to the exact content height, no
   hardcoded max-height guess needed (answers differ in length CS vs EN) */
.accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  .accordion-panel { transition: none; }
}
.accordion-panel.is-open { grid-template-rows: 1fr; }

.accordion-panel-inner {
  overflow: hidden;
  min-height: 0;
}
.accordion-panel-inner p {
  margin: 0 0 1.25rem;
  color: var(--color-text);
}
/* Lets a translation intentionally be empty in one language (see
   faqADresscodeEnNote in i18n.js) without leaving a blank gap. */
.accordion-panel-inner p:empty {
  display: none;
}

/* Dresscode FAQ photo. Full-width (not floated) on mobile — at that
   narrow a column, floating a photo alongside text left too little room
   for either. On desktop it floats at the top-left of the answer, level
   with the very first line of text (not centered in the section), with
   paragraphs wrapping around it and flowing full-width again once they
   clear it. .accordion-panel-inner's own overflow:hidden (above) gives it
   a block formatting context, which is what makes it grow to contain the
   float instead of collapsing around only the in-flow text. */
.faq-dresscode-image {
  width: 100%;
  margin: 0 0 1rem;
  border-radius: var(--radius);
}
@media (min-width: 768px) {
  .faq-dresscode-image {
    float: left;
    width: 50%;
    margin: 0 1.25rem 1rem 0;
  }
}

/* ==========================================================================
   Location
   ========================================================================== */
.map-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ==========================================================================
   Form — plain (no box), submits to Google Forms via a hidden iframe
   (js/main.js), full width on desktop (breaks out of the two-column grid,
   see .grid-form above) since a multi-field form needs more room than the
   65ch text column.
   ========================================================================== */
.rsvp-form {
  max-width: 40rem;
  margin-top: 1.5rem;
}

.rsvp-form .btn { font-size: 1.4rem; }

.form-field {
  margin-bottom: 1.5rem;
  border: none;
  padding: 0;
}
.form-field label,
.form-field legend {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  padding: 0;
}

.form-field select,
.form-field textarea,
.form-other-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-hairline);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
}
.form-field textarea { resize: vertical; }

.form-field select:focus,
.form-field textarea:focus,
.form-other-input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-color: var(--color-accent);
}

/* .form-field .form-choice (not just .form-choice): needs to beat
   ".form-field label"'s font-weight:700 above, which — being a descendant
   selector — also (unintentionally) matches these nested choice labels. */
.form-field .form-choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.form-other-input {
  width: auto;
  flex: 1;
  padding: 0.35rem 0.6rem;
}

.form-note {
  font-size: 0.95rem;
  color: var(--color-text);
  opacity: 0.85;
  margin-bottom: 1.5rem;
}
.form-note strong { display: block; font-weight: 700; }

.form-thanks {
  color: var(--color-dark);
  font-weight: 700;
  margin-top: 1rem;
}

.hidden-iframe {
  display: none;
}

/* ==========================================================================
   Scroll reveal — subtle fade + rise as each section enters the viewport.
   The hidden starting state (opacity/transform) lives on .reveal, which is
   added by JS only (see initScrollReveal in main.js) — so sections stay
   fully visible if JS fails to load or errors, instead of staying invisible
   forever. Skipped entirely under prefers-reduced-motion (see main.js).

   Applied to .schedule-box rather than its parent #schedule: a transform on
   an ANCESTOR of a position:sticky element can break its stickiness in some
   browsers, but a transform on the sticky element itself is safe.
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  border-top: 1px solid var(--color-hairline);
  color: var(--color-text);
  font-size: 0.9rem;
}
