/* Design A – "Kamen in oljka": white, olive green, Istrian stone arch, olive branch. */
:root {
  color-scheme: light;
  --white: #ffffff;
  --olive: #4b5a2e;       /* main green: headings, links, buttons (contrast on white 7.5:1) */
  --ink: #26301a;         /* body text */
  --muted: #5f6852;       /* secondary text (5.9:1) */
  --sage: #a9b597;        /* decorative only: ampersand, rules */
  --stone: #e3dfd4;       /* hairlines */
  --mist: #f4f6f0;        /* notice background */
  --tint: #ecf0e2;        /* alternate page background, clearly different from white */
  --header-h: 96px;       /* updated from JS to the real header height */
  --gutter: 16px;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth;
  /* each page snaps under the sticky header; "proximity" so long pages (the form) still scroll freely */
  scroll-snap-type: y proximity; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  overflow-wrap: anywhere;
}

[hidden] { display: none !important; }

a { color: var(--olive); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

/* Header: monogram + language, then the section menu – sticky so it is always visible */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--stone); }
@supports ((-webkit-backdrop-filter: blur(4px)) or (backdrop-filter: blur(4px))) {
  .top { background: rgba(255,255,255,.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
.top-row { display: flex; justify-content: space-between; align-items: center; padding: 4px var(--gutter) 0; max-width: 44rem; margin: 0 auto; }
.monogram { font: italic 600 1.3rem var(--serif); color: var(--olive); text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.rsvp-pill { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--olive); color: var(--white); font-size: 0.88rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.lang-switch { display: flex; gap: 0; }
.lang-switch button {
  min-width: 40px; min-height: 44px; padding: 0 4px;
  border: 0; background: none; cursor: pointer;
  font: 400 0.9rem var(--sans); color: var(--muted);
}
.lang-switch button[aria-pressed="true"] { color: var(--olive); font-weight: 500; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }

/* Pages: every section fills the screen below the header, alternating white / tint */
.panel {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px 0; scroll-snap-align: start; text-align: center;
}
.panel-tint { background: var(--tint); }
.panel-inner { width: 100%; max-width: 40rem; margin: 0 auto; padding: 0 var(--gutter); }
.panel-home { padding: 0 0 32px; justify-content: flex-start; }

/* Hero */
.hero { text-align: center; padding: 24px var(--gutter) 0; max-width: 44rem; margin: 0 auto; }
.hero-names { margin: 0; font: italic 400 4.4rem/0.92 var(--serif); color: var(--olive); }
.hero-names span { display: block; }
.hero-names .amp { font-size: 0.55em; color: var(--sage); margin: 0.1em 0; }
.branch { display: block; width: 180px; height: 50px; margin: 20px auto 8px; color: var(--olive); }
.branch.small { width: 110px; height: 30px; margin-bottom: 4px; }
.hero-date { margin: 22px 0 2px; font: 500 1.08rem var(--sans); letter-spacing: 0.03em; }
.hero-place { margin: 0; color: var(--muted); }

/* Scene illustration (vineyards, cypress path, long table) – full width, fades into the page */
.scene { margin: 4px 0 0; height: 290px; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 90%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 90%, transparent 100%); }
.scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }

.welcome { text-align: center; padding: 0 var(--gutter); }
.status { margin: 18px 0 0; }
.names { margin: 0; font: italic 400 1.75rem/1.3 var(--serif); color: var(--ink); }
.notice { background: var(--mist); padding: 14px 16px; margin: 0; text-align: center; border-radius: 4px; }
.notice p { margin: 0 0 12px; }
.muted { color: var(--muted); }

.section-nav {
  display: flex; gap: 20px; max-width: 44rem; margin: 0 auto; padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { flex: none; padding: 10px 0 12px; text-decoration: none; font-size: 0.95rem; white-space: nowrap; border-bottom: 2px solid transparent; }
.section-nav a[aria-current="true"] { border-bottom-color: var(--olive); font-weight: 500; }
@supports (justify-content: safe center) { .section-nav { justify-content: safe center; } }

/* Villa photo in an Istrian stone-arch frame */
.arch { margin: 18px 0 0; aspect-ratio: 4 / 5; max-height: 560px; border-radius: 50% 50% 6px 6px / 40% 40% 6px 6px; /* 4:5 frame → semicircular top */ overflow: hidden; background: var(--mist); }
.arch img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Page headings */
h2 { margin: 0; font: 600 2.3rem/1.1 var(--serif); color: var(--olive); text-align: center; }
.panel h2 + .branch.small { margin: 10px auto 22px; }
h3 { margin: 0 0 6px; font: italic 600 1.45rem var(--serif); color: var(--olive); }
.panel p { margin: 0 0 10px; }
.small { font-size: 0.9rem; }

/* Good-to-know page: one block per topic */
.info-block { padding: 20px 0; }
.info-block + .info-block { border-top: 1px solid rgba(75, 90, 46, 0.2); }
.info-block p:last-child { margin-bottom: 0; }

/* Timetable: a real sequence, so an ordered list with times */
.timeline { list-style: none; margin: 20px 0 14px; padding: 0; border-top: 1px solid rgba(75, 90, 46, 0.2); }
.timeline li { padding: 11px 0; border-bottom: 1px solid rgba(75, 90, 46, 0.2); text-align: center; }
.timeline .tt-time { margin-right: 8px; }
.tt-time { font: italic 600 1.3rem/1 var(--serif); color: var(--olive); font-variant-numeric: lining-nums; }
.tt-what { line-height: 1.4; }

.venue-name { font: italic 600 1.45rem var(--serif); color: var(--olive); margin-bottom: 2px; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.links a { display: inline-block; padding: 8px 0; }

/* Recommended route: a real sequence, so numbered steps (centred, number before the text) */
.route { margin: 22px 0 6px; padding: 18px 0 4px; border-top: 1px solid rgba(75, 90, 46, 0.2); }
.route-steps { list-style: none; margin: 8px 0 12px; padding: 0; counter-reset: step; }
.route-steps li { counter-increment: step; padding: 6px 0; line-height: 1.45; }
.route-steps li::before { content: counter(step) "."; margin-right: 8px; font: italic 600 1.25rem/1 var(--serif); color: var(--olive); }

/* Route map (Natural Earth outlines; routes are schematic) */
.map-figure { margin: 18px 0 0; }
.map { display: block; width: 100%; height: auto; }
.map-label { font-family: var(--sans); fill: var(--ink); }
.map-label.city { font-size: 22px; font-weight: 500; fill: #3d4630; paint-order: stroke; stroke: #f1f4ec; stroke-width: 5px; stroke-linejoin: round; }
.map-label.country { font: italic 600 30px var(--serif); fill: #7d866f; letter-spacing: 0.04em; }
.map-label.sea { font: italic 600 24px var(--serif); fill: #5d7f75; }
.map-label.stop { font-size: 22px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: #f1f4ec; stroke-width: 5px; stroke-linejoin: round; }
.map-credit { margin-top: 6px; font-size: 0.78rem; color: var(--muted); }
.map-label.villa { font: italic 600 30px var(--serif); fill: var(--olive); paint-order: stroke; stroke: #f1f4ec; stroke-width: 6px; stroke-linejoin: round; }


.btn {
  min-height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--olive); color: var(--white);
  font: 500 1rem var(--sans); cursor: pointer;
}

.site-footer { text-align: center; padding: 40px var(--gutter) 40px; color: var(--muted); font: italic 1.1rem var(--serif); }
.site-footer p { margin: 0; }

@media (min-width: 40rem) {
  .hero-names { font-size: 5.6rem; }
  .scene { height: 420px; }
}

/* RSVP form */
.panel p.deadline { text-align: center; font: italic 600 1.5rem/1.3 var(--serif); color: var(--olive); margin-bottom: 14px; }

/* Deadline banner on the first screen (until the invitation has replied) */
.deadline-banner { margin: 16px auto 0; max-width: 22rem; padding: 14px 18px 16px; border: 1.5px solid var(--olive); border-radius: 14px; background: var(--white); }
.deadline-banner .db-label { margin: 0; font-size: 0.95rem; letter-spacing: 0.02em; color: var(--muted); }
.deadline-banner .db-date { margin: 0 0 10px; font: italic 600 2.5rem/1.1 var(--serif); color: var(--olive); }
.db-cta { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
#rsvp-form { margin-top: 8px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.adults { text-align: center; font-weight: 500; }
.block { padding: 18px 0; border-top: 1px solid var(--stone); }
.block legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; font: italic 600 1.35rem var(--serif); color: var(--olive); text-align: center; }
.block > legend + * { clear: both; }
.block > label.text:first-child { margin-top: 0; }
label.text > .label-strong { font: italic 600 1.35rem var(--serif); color: var(--olive); margin-bottom: 6px; }
label.text > .hint { color: var(--muted); margin-bottom: 6px; }
.choice .num { min-width: 52px; justify-content: center; padding: 0 16px; }

.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  border: 1.5px solid var(--stone); border-radius: 999px; cursor: pointer; color: var(--ink);
}
.choice input:checked + span { background: var(--olive); border-color: var(--olive); color: var(--white); }
.choice input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 3px; }
.choice input[aria-invalid="true"] + span { border-color: #a3341f; }

label.text { display: block; margin-top: 12px; }
label.text > span { display: block; font-size: 0.95rem; margin-bottom: 4px; }
input[type=text], input[type=number], textarea {
  width: 100%; padding: 11px 12px; text-align: left; font: inherit; color: var(--ink);
  border: 1.5px solid var(--stone); border-radius: 6px; background: var(--white);
}
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--olive); outline-offset: 1px; border-color: var(--olive); }
input[aria-invalid="true"] { border-color: #a3341f; }
textarea { resize: vertical; }
input[type=number] { max-width: 8rem; display: block; margin: 0 auto; text-align: center; }

.song { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding-bottom: 6px; }
.song .remove { grid-column: 1 / -1; justify-self: center; }
.btn-link { min-height: 44px; padding: 0; border: 0; background: none; color: var(--olive); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.field-error { margin: 6px 0 0; color: #a3341f; font-size: 0.95rem; }
.form-error { margin: 0 0 8px; padding: 12px 14px; border-top: 3px solid #a3341f; background: #fbf1ee; color: #6e2414; text-align: center; }
.privacy { margin: 20px 0 18px; font-size: 0.9rem; color: var(--muted); }
#submit-btn { width: 100%; }
#submit-btn:disabled { opacity: 0.6; cursor: wait; }
.submit-status { min-height: 1.5em; margin: 10px 0 0; text-align: center; color: var(--muted); }

.done { text-align: center; padding: 8px 0; }
.done-title { margin: 4px 0; font: italic 600 2rem var(--serif); color: var(--olive); }
.btn-outline { background: none; color: var(--olive); border: 1.5px solid var(--olive); }
