/* ===== Theme: edit these to change colours and fonts ===== */
:root {
  --bg: #fcfbf7;
  --bg-alt: #f2f1e8;
  --text: #3a3a36;
  --muted: #74766a;
  --accent: #6b7a48;      /* sage green from the watercolour stems */
  --accent-dark: #505c33;
  --card: #ffffff;
  --border: #e2e0d1;
  --font-heading: "Cormorant Garamond", Georgia, serif;
  --font-body: "Lato", "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --header-h: 60px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  font-size: 17px;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h2 { font-size: clamp(2rem, 5vw, 2.8rem); text-align: center; }
h3 { font-size: 1.4rem; }

a { color: var(--accent-dark); }
code { background: var(--bg-alt); padding: 0.1em 0.4em; border-radius: 4px; }
.muted { color: var(--muted); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 720px; }

.section { padding: 80px 0; }
.section.alt { background: var(--bg-alt); }
.section-lead { text-align: center; max-width: 680px; margin: 0 auto 40px; color: var(--muted); }
.intro p { text-align: center; }

/* ===== Header / nav ===== */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  height: var(--header-h);
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: 1100px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  white-space: nowrap; font-family: var(--font-heading); font-size: 1.6rem; font-weight: 600;
  text-decoration: none; color: var(--text);
}
.nav-links { list-style: none; display: flex; gap: 28px; margin: 0; padding: 0; }
.nav-links a {
  white-space: nowrap; text-decoration: none; color: var(--text); font-size: 0.85rem;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.nav-links a:hover { color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--text); }

/* ===== Hero ===== */
.hero {
  position: relative; overflow: hidden;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--header-h) + 40px) 20px 60px;
  padding-bottom: calc(60px + 12vh);
  background: #f9f8f5 url("assets/flowers/paper.webp") center / cover;
  color: var(--text);
}
.hero-content { position: relative; z-index: 1; }
.hero-kicker { letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.85rem; margin: 0 0 12px; color: var(--muted); }
.hero h1 { font-size: clamp(2.6rem, 9vw, 5.5rem); font-weight: 400; margin-bottom: 12px; }
.hero .amp { font-style: italic; color: var(--accent); }
.hero-date { font-size: 1.15rem; margin: 0 0 32px; }

/* ===== Decorations: watercolour wildflowers =====
   Images in assets/flowers/, extracted from the invitation PDF in assets/.
   <span class="fl fl-NAME"> shows one; set its height (or width) and position. */
.fl {
  display: block;
  background: var(--fl) center / contain no-repeat;
  pointer-events: none;
}
.fl-chamomile      { --fl: url("assets/flowers/chamomile.webp");      aspect-ratio: 229 / 559; }
.fl-chamomile-head { --fl: url("assets/flowers/chamomile-head.webp"); aspect-ratio: 126 / 93; }
.fl-grass          { --fl: url("assets/flowers/grass.webp");          aspect-ratio: 469 / 1000; }
.fl-buds           { --fl: url("assets/flowers/buds.webp");           aspect-ratio: 112 / 442; }
.fl-yellow-bloom   { --fl: url("assets/flowers/yellow-bloom.webp");   aspect-ratio: 244 / 1000; }
.fl-bud-stem       { --fl: url("assets/flowers/bud-stem.webp");       aspect-ratio: 513 / 776; }
.fl-bouquet        { --fl: url("assets/flowers/spring-bouquet.webp"); aspect-ratio: 600 / 1000; }
.fl-poppy          { --fl: url("assets/flowers/poppy.webp");          aspect-ratio: 536 / 1000; }
.fl-bee            { --fl: url("assets/flowers/bee.webp");            aspect-ratio: 376 / 304; }
.fl-bee-2          { --fl: url("assets/flowers/bee-2.webp");          aspect-ratio: 367 / 376; }
.flip { transform: scaleX(-1); }

/* Hero: wildflower border like the printed invitation */
.hero-fl { position: absolute; }
.hero-grass-l     { height: 72%; left: -40px;  bottom: -20px; }
.hero-chamomile-l { height: 40%; left: 2%;     top: calc(var(--header-h) + 10px); }
.hero-bloom-l     { height: 44%; left: 11%;    bottom: -30px; }
.hero-grass-r     { height: 66%; right: -40px; bottom: -20px; }
.hero-chamomile-r { height: 36%; right: 3%;    top: calc(var(--header-h) + 30px); }
.hero-budstem-r   { height: 34%; right: 9%;    bottom: -10px; }
.hero-buds-r      { height: 28%; right: 17%;   bottom: -10px; }
.hero-bouquet     { height: 22%; left: 50%;    bottom: -12px; translate: -50% 0; }
.hero-bee         { width: clamp(46px, 5vw, 78px); left: 17%;  top: 19%; rotate: -8deg; }
.hero-bee-2       { width: clamp(40px, 4.4vw, 66px); right: 20%; top: 20%; }
.hero-flower      { width: 52px; margin: 0 auto 14px; }

/* Section corners */
.deco { position: relative; overflow: hidden; }
.deco > .container { position: relative; z-index: 1; }
.corner { position: absolute; }
.corner-tr { top: 20px; right: 2%; }
.corner-tl { top: 30px; left: 3%; }
.corner-bl { bottom: -10px; left: 2%; }
.corner-br { bottom: -10px; right: 2%; }
.corner.fl-grass, .corner.fl-yellow-bloom { height: 340px; }
.corner.fl-chamomile, .corner.fl-bud-stem, .corner.fl-bouquet { height: 260px; }
.corner.fl-buds { height: 230px; }
.corner.fl-bee, .corner.fl-bee-2 { width: 64px; }
.side-l, .side-r { top: 50%; translate: 0 -50%; height: 440px; }
.side-l { left: calc(50% - 560px); }
.side-l.fl-poppy { height: 400px; left: calc(50% - 600px); }
.side-r { right: calc(50% - 560px); }

/* Divider under each section heading: chamomile between two lines */
h2::after {
  content: ""; display: block;
  width: 180px; height: 30px; margin: 12px auto 0;
  background:
    url("assets/flowers/chamomile-head.webp") center / 44px auto no-repeat,
    linear-gradient(var(--accent), var(--accent)) left center / 62px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right center / 62px 1px no-repeat;
}
.hero h1::after { content: none; }

.parking h3 { display: flex; align-items: center; gap: 10px; }
.parking h3::before {
  content: ""; width: 30px; height: 22px; flex: none;
  background: url("assets/flowers/chamomile-head.webp") center / contain no-repeat;
}

.footer-fl { width: 56px; margin: 0 auto 10px; }

.countdown { display: flex; justify-content: center; gap: 28px; margin-bottom: 36px; }
.countdown div { display: flex; flex-direction: column; min-width: 70px; }
.countdown span { font-family: var(--font-heading); font-size: 2.6rem; line-height: 1; }
.countdown small { text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.7rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-block; padding: 14px 34px;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  font: 400 0.85rem var(--font-body); letter-spacing: 0.15em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; transition: background 0.2s;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn-small { padding: 10px 22px; font-size: 0.75rem; }
.link { font-weight: 400; text-decoration: none; }

/* ===== Cards ===== */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.venue-name { font-weight: 700; margin-bottom: 0; }

/* ===== Timeline ===== */
.timeline { list-style: none; margin: 0 auto 50px; padding: 0; max-width: 720px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 88px; top: 8px; bottom: 8px;
  width: 1px; background: var(--accent);
}
.timeline li { display: grid; grid-template-columns: 70px 1fr; gap: 40px; padding: 0 0 30px; position: relative; }
.timeline li::before {
  content: ""; position: absolute; left: 83px; top: 8px;
  width: 11px; height: 11px; border-radius: 50%; background: var(--bg-alt); border: 2px solid var(--accent);
}
.timeline time { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600; color: var(--accent-dark); text-align: right; }
.timeline h3 { margin-bottom: 4px; }
.timeline p { margin: 0; }

/* ===== Grids ===== */
.info-cards, .rooms, .contacts {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.two-col { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.parking { max-width: 680px; margin: 40px auto 0; }
.room ul { padding-left: 1.1em; }

/* ===== Venue gallery (assets/venue/) ===== */
.gallery {
  display: grid; gap: 12px; margin-top: 40px;
  grid-template-columns: repeat(3, 1fr); grid-auto-rows: 220px;
}
.gallery img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius);
}
.gallery img:first-child { grid-row: span 2; }
@media (max-width: 700px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .gallery img:first-child { grid-column: span 2; grid-row: span 2; }
}

/* ===== Accommodation (on-site only) ===== */
.stay-booking { max-width: 820px; margin: 0 auto; text-align: center; }
.stay-facts {
  display: grid; gap: 18px; margin-bottom: 20px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.stay-label {
  display: block; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.stay-value { display: block; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 600; }
.stay-howto { max-width: 600px; margin: 0 auto 20px; }
.stay-subhead { text-align: center; margin: 50px 0 24px; }
.stay-notes { max-width: 680px; margin: 36px auto 0; padding-left: 1.1em; color: var(--muted); }
.contact p { margin: 0.2em 0; }

.map { margin-top: 30px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map { height: 400px; z-index: 0; }
.map-marker { background: none; border: 0; }
.map-marker img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.map-label.leaflet-tooltip {
  font: 400 0.85rem/1.3 var(--font-body); color: var(--text); text-align: center;
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.map-hide-labels .map-label,
.map-hide-chamomile .map-marker-chamomile { display: none; }
.map-label strong { display: block; font: 600 1.1rem var(--font-heading); }

/* ===== RSVP form ===== */
.rsvp-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; }
.field { margin: 0 0 22px; border: 0; padding: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field label, .field legend { display: block; font-weight: 400; margin-bottom: 6px; font-size: 0.95rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.field .choice { display: flex; align-items: center; gap: 10px; font-weight: 300; margin: 6px 0; cursor: pointer; }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.attending-only[hidden] { display: none; }
.form-status { margin: 16px 0 0; min-height: 1.5em; }
.form-status.ok { color: #3c7a4a; }
.form-status.error { color: #a33; }

/* ===== Footer ===== */
.site-footer { text-align: center; padding: 40px 20px; font-family: var(--font-heading); font-size: 1.2rem; }
.site-footer p { margin: 0.2em 0; }

/* ===== Mobile ===== */
@media (max-width: 760px) {
  .section { padding: 60px 0; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .rsvp-form { padding: 24px; }
  .timeline::before { left: 8px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 34px; }
  .timeline li::before { left: 3px; }
  .timeline time { text-align: left; }
  .hero-bloom-l, .hero-budstem-r, .hero-buds-r { display: none; }
  .hero-grass-l, .hero-grass-r { height: 32%; }
  .hero-chamomile-l, .hero-chamomile-r { height: 22%; }
  .hero-bouquet { height: 14%; }
  .hero-bee { display: none; }
  .hero-bee-2 { right: 30%; top: calc(var(--header-h) + 14px); width: 40px; }
  .corner { opacity: 0.3; scale: 0.7; }
}
/* Below this the corner flowers start to overlap the content, so fade them back */
@media (max-width: 1150px) {
  .side-l, .side-r { display: none; }
  /* Keep the poppy on narrower screens: move it to the section's top-right corner */
  .side-l.rsvp-poppy { display: block; height: 240px; top: 30px; left: auto; right: 2%; translate: none; }
}
@media (min-width: 761px) and (max-width: 1150px) {
  .corner { opacity: 0.45; }
  .hero-chamomile-l, .hero-chamomile-r { height: 28%; }
  .hero-grass-l, .hero-grass-r { height: 52%; }
  .hero-bloom-l { height: 36%; }
  .hero-bee { display: none; }
}

/* Language switch in the nav */
/* Collapse the nav into a menu before the (longer) Finnish labels run out of room */
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { display: block; padding: 14px 20px; }
}

/* ===== Password gate (see auth.js) ===== */
html.locked body > :not(.gate) { display: none !important; }
.gate {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: var(--bg-alt) url("assets/flowers/paper.webp") center / cover;
}
.gate-card {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 28px;
}
.gate-flower { display: block; width: 52px; margin: 0 auto 14px; }
.gate-card h1 { font-size: 2.4rem; }
.gate-card p { color: var(--muted); margin: 0 0 18px; }
.gate-card input {
  display: block; width: 100%; margin-bottom: 16px; padding: 12px 14px;
  font: inherit; color: var(--text); text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
.gate-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gate-card .gate-error { color: #a4453a; margin: 14px 0 0; min-height: 1.7em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
