:root{
  --bg: #eff4fa;
  --text: #2a2a2a;
  --muted:#6b6b6b;
  --accent:#222;
  --ring: rgba(0,0,0,.08);
  --maxw: 980px;
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; }
body {
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans";
  color: var(--text);
  background: var(--bg);
}

/* Header / brand */
.site-header { margin: 0 auto; padding: 24px 20px 8px; max-width: var(--maxw); }
.brand { text-align: center; margin-bottom: 8px; }
.brand h1 { font-family: ui-serif, Georgia, Times, serif; font-weight: 600; letter-spacing: .08em; margin: 6px 0 2px; text-transform: uppercase; }
.brand .meta { color: var(--muted); margin: 0; }

/* Nav */
.nav {
  margin: 18px auto 0;
  max-width: var(--maxw);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;         /* centered */
  gap: 6px 16px;
  border-top: 1px solid var(--ring);
  padding-top: 12px;
}
/* Flat text tabs with animated underline */
.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--text);
  padding: 8px 6px 12px;       /* extra bottom space for the line */
  border-radius: 0;            /* no rounded pills */
}

/* the line */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: #d3d3d3;         /* grey on hover */
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}

/* show grey line on hover/focus */
.nav-link:hover::after,
.nav-link:focus-visible::after {
  transform: scaleX(1);
}

/* active tab: yellow line */
.nav-link.active::after {
  transform: scaleX(1);
  background: #ffd54a;
}

/* optional: accessible focus ring */
.nav-link:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}


/* Language dropdown */
.lang-dd { position: relative; }
/* Language dropdown trigger styled like a flat tab */
.lang-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;                      /* remove pill look */
  padding: 8px 6px 12px;          /* match .nav-link padding (bottom = underline space) */
  cursor: pointer;
  color: var(--text);
  line-height: 1.2;
}
/* grey hover line; yellow when menu is open (active-like) */
.lang-trigger::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: #d3d3d3;            /* grey on hover */
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 160ms ease;
}
.lang-trigger:hover::after,
.lang-trigger:focus-visible::after {
  transform: scaleX(1);
}
.lang-dd.open .lang-trigger::after {
  transform: scaleX(1);
  background: #ffd54a;            /* yellow when dropdown is open */
}

/* optional: subtle focus ring for accessibility */
.lang-trigger:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 3px rgba(0,0,0,.06);
}

/* Tiny optical lift for language label so it aligns with tabs */
#langCurrent,
.lang-trigger svg {
  position: relative;
  top: -3px;   /* change to -2px if you want it a touch higher */
}
.lang-dd { position: relative; align-self: flex-end; } /* sit on the same baseline as links */

.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  list-style: none; margin: 0; padding: 6px;
  background: #fff; border: 1px solid var(--ring); border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08); min-width: 170px; z-index: 20;
  display: none;
}
.lang-dd.open .lang-menu, .lang-trigger[aria-expanded="true"] + .lang-menu { display: block; }
.lang-menu li { padding: 8px 10px; display: flex; gap: 8px; align-items: center; border-radius: 8px; cursor: pointer; }
.lang-menu li:hover { background: #f4f4f4; }
.lang-menu li[aria-selected="true"] { background: #fff6cc; } /* highlight selected */
.flag { width: 1.1em; line-height: 1; }


/* Layout */
.container { max-width: var(--maxw); margin: 22px auto 80px; padding: 0 20px; }
.page { display: none; }
.page.active { display: block; }

/* Presentation grid */
.intro-grid {
  display: grid;
  grid-template-columns: minmax(220px, 360px) 1fr;  /* photo left, text right */
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) {
  .intro-grid { grid-template-columns: 1fr; }
}
.intro-photo img {
  width: 100%; height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 18px rgba(0,0,0,.06);
  display: block;
}

.hero-img { margin: 0 0 14px; }
.hero-img img { width: 100%; height: auto; border-radius: 18px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }

h2 {
  font-family: ui-serif, Georgia, Times, serif;
  font-size: 28px;
  margin: 10px 0 8px;
  letter-spacing: .02em;
}
.facts { padding-left: 18px; }

.gifts, .contact-card { background: white; border-radius: 16px; padding: 14px; box-shadow: 0 1px 0 var(--ring); }
.contact-card { display: inline-block; margin-top: 8px; }

.iban-box { margin-top: 16px; background: white; padding: 14px; border-radius: 16px; box-shadow: 0 1px 0 var(--ring); }
.iban-line { display: flex; gap: 8px; }
.iban-line input { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--ring); background: #fff; }
.btn { border: 1px solid var(--ring); background: #000; color: #fff; border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.muted { color: var(--muted); font-size: 0.9rem; }

/* Footer */
.site-footer { text-align: center; color: var(--muted); padding: 20px; border-top: 1px solid var(--ring); }

/* --- Hamburger base (hidden on desktop) --- */
.hamburger {
  position: absolute;
  top: 20px; right: 20px;
  z-index: 40;
  border: 0; background: transparent; padding: 8px; cursor: pointer;
  display: none; /* shown on small screens below */
}

.hamburger-box { width: 28px; height: 22px; display: inline-block; position: relative; }
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
  position: absolute; width: 28px; height: 2px; background: var(--text); left: 0; transition: transform 180ms ease, opacity 180ms ease, top 180ms ease;
}
.hamburger-inner { top: 10px; }
.hamburger-inner::before { content: ""; top: -8px; }
.hamburger-inner::after  { content: ""; top: 8px; }

/* X state */
.menu-open .hamburger-inner { transform: rotate(45deg); }
.menu-open .hamburger-inner::before { top: 0; transform: rotate(90deg); }
.menu-open .hamburger-inner::after  { top: 0; opacity: 0; }

/* Backdrop for the panel */
.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.25);
  z-index: 30; opacity: 0; transition: opacity 180ms ease;
}
.menu-open .backdrop { opacity: 1; }
.backdrop[hidden] { display: none; }

/* ===== Gifts grid ===== */
.gift-sections { display: grid; gap: 28px; }

.gift-section { display: grid; gap: 14px; }
.gift-section h3 {
  font-family: ui-serif, Georgia, Times, serif;
  font-size: 22px;
  margin: 0;
}

.gift-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 680px) {
  .gift-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .gift-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* 4 per row on desktop */
}

.gift-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 0 var(--ring);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.gift-img { aspect-ratio: 4/3; background: #f4f4f4; overflow: hidden; }
.gift-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gift-info { padding: 12px; display: grid; gap: 8px; }
.gift-name { margin: 0; font-weight: 600; }
.gift-price { color: var(--muted); font-size: 0.95rem; }

.gift-progress { height: 8px; background: #eee; border-radius: 999px; overflow: hidden; }
.gift-progress__bar { height: 100%; width: 0%; background: #ffd54a; transition: width 200ms ease; }

.gift-progress__label { font-size: 0.9rem; color: var(--muted); }
.gift-cta { margin-top: 6px; display: flex; justify-content: flex-end; }
.gift-cta .btn { padding: 8px 10px; }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.modal::before {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35);
}

/* Allow scrolling inside the modal when content grows (e.g., after submit) */
.modal { overflow: auto; }

.modal__dialog {
  max-height: calc(100vh - 12vh);  /* fits on small screens */
  overflow: auto;                   /* the dialog itself scrolls */
}

.modal__dialog {
  position: relative; max-width: 520px; margin: 8vh auto; z-index: 1;
  background: #fff; border-radius: 16px; box-shadow: 0 12px 32px rgba(0,0,0,.18);
  padding: 16px 16px 18px;
}
.modal__close {
  position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 20px; cursor: pointer;
}
.modal__subtitle { margin: 6px 0 8px; color: var(--muted); }

.form-row { display: grid; gap: 6px; margin: 10px 0; }
.form-row input, .form-row select, .form-row textarea {
  padding: 10px; border: 1px solid var(--ring); border-radius: 10px; background: #fff;
}
.check-row { display: flex; align-items: center; gap: 8px; }

.payment-instructions {
  background: #fafafa; border: 1px dashed var(--ring); padding: 10px; border-radius: 10px; font-size: 0.95rem;
}
.payment-line { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.payment-line code { background: #fff; border: 1px solid var(--ring); padding: 6px 8px; border-radius: 8px; }
.payment-copy { border: 1px solid var(--ring); background: #000; color:#fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; }

.modal__actions { display: flex; justify-content: center; margin-top: 10px; }
.thanks { text-align: center; margin-top: 12px; }
.hidden { display: none; }

/* Prevent background scroll while modal open */
body.modal-open { overflow: hidden; }

/* ===== Gift filters ===== */
.gift-filters {
  display: flex;
  gap: 12px 18px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 10px;
}
.gift-filter {
  display: grid;
  gap: 6px;
}
.gift-filter select {
  padding: 8px 10px;
  border: 1px solid var(--ring);
  border-radius: 10px;
  background: #fff;
}

/* Disabled contribute button */
.btn[disabled], .btn.disabled {
  background: #d9d9d9;
  color: #666;
  cursor: not-allowed;
  border-color: var(--ring);
}



/* --- Mobile nav panel --- */
@media (max-width: 760px) {
  .site-header { position: relative; }
  .hamburger { display: inline-block; }

  /* Slide-down panel (fully hidden when closed) */
  .nav {
    position: fixed;
    left: 0; right: 0; top: 0;
    background: var(--bg);
    padding: 70px 20px 18px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border-top: 0;

    /* Hide states to avoid the “sliver” */
    transform: translate3d(0, calc(-100% - 2px), 0); /* over-translate by 2px */
    opacity: 0;                   /* fully hidden */
    pointer-events: none;         /* not clickable when closed */
    box-shadow: none;             /* no shadow while closed */
    will-change: transform;
    transition: transform 200ms ease, opacity 150ms ease;

    z-index: 35;
  }

  /* Open state */
  .menu-open #siteNav {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 12px 24px rgba(0,0,0,.08);
  }

  .nav-link { padding: 10px 2px 12px; text-align: center; }
  .lang-dd { align-self: center; }
  .lang-trigger { padding: 10px 2px 12px; }
}



/* Keep desktop alignment/centering rules intact */
@media (min-width: 761px) {
  /* Ensure header nav stays centered and baseline-aligned on desktop */
  .nav {
    position: static;
    transform: none !important;
    padding-top: 12px;
  }
}

/* iOS notch/safe area support */
@supports (padding: max(0px)) {
  @media (max-width: 760px) {
    .nav { padding-top: calc(70px + env(safe-area-inset-top)); }
    .hamburger { top: calc(20px + env(safe-area-inset-top)); }
  }
}

