/* ============================================================
   Eric & Johanna — bröllopssajt
   Design: sand/oliv/smör, Fraunces + Karla, ett ljust ljust läge.
   ============================================================ */

:root {
  --bg: #FEFCF4;
  --bg-alt: #FBF1D8;
  --sand: #E9D9AE;
  --oliv: #6E6B33;
  --oliv-deep: #3D3A1C;
  --ink: #4A4723;
  --ink-soft: #7A754A;
  --smor: #E8B93D;
  --smor-soft: #F6E2A4;
  --line: rgba(74, 71, 35, 0.16);
  --card-bg: #FFFEFA;
  --shadow: 0 1px 2px rgba(74, 71, 35, 0.07);
  --shadow-md: 0 6px 20px rgba(74, 71, 35, 0.12);
  --focus: #6E6B33;
  --radius: 3px;
  --max: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

img, svg { max-width: 100%; display: block; }

a { color: var(--oliv); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------------------------------------------------------------
   Lösenordsgrind
   --------------------------------------------------------------- */
#password-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#password-gate.hidden { display: none; }

#site-content { display: none; }
#site-content.unlocked { display: block; }
body.gate-open { overflow: hidden; }

.gate-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.gate-eyebrow {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--oliv);
  font-size: 1rem;
  margin: 0 0 6px;
}
.gate-title {
  font-size: clamp(2rem, 9vw, 2.6rem);
  margin: 0 0 8px;
  line-height: 1.05;
}
.gate-sub {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 26px;
}
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gate-input {
  font-family: 'Karla', sans-serif;
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
}
.gate-error {
  color: #A24438;
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ---------------------------------------------------------------
   Knappar / etiketter
   --------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--oliv);
  border: none;
  padding: 14px 30px;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: var(--oliv-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.eyebrow {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--oliv);
  font-size: 0.95rem;
  margin: 0 0 8px;
}

.ui-label {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--oliv);
}

.tabular { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------
   Nav
   --------------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(254, 252, 244, 0.92);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  max-width: var(--max);
  margin: 0 auto;
}
.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.nav-links.open { display: flex; flex-basis: 100%; }
.nav-links a {
  display: block;
  padding: 14px 22px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--line);
}
.nav-links a:hover { color: var(--oliv); }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex;
    flex-direction: row;
    gap: 26px;
    border-top: none;
    background: none;
  }
  .nav-links a {
    padding: 0;
    border-bottom: none;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
  }
}

/* ---------------------------------------------------------------
   Hero
   --------------------------------------------------------------- */
.hero {
  padding: 52px 22px 36px;
  text-align: center;
}
.hero-names {
  font-family: 'Rouge Script', cursive;
  font-weight: 400;
  font-size: clamp(3.6rem, 16vw, 6.5rem);
  line-height: 1.2;
  letter-spacing: 0;
  margin: 10px 0 4px;
}
.hero-names .amp {
  font-style: normal;
  font-weight: 400;
  color: var(--oliv);
  padding: 0 0.08em;
}
.hero-date {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0;
}

.hero-art {
  width: min(72%, 380px);
  aspect-ratio: 999 / 319;
  margin: 10px auto 8px;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-greeting {
  max-width: 56ch;
  margin: 18px auto 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 30px auto 0;
}
.countdown-cell { min-width: 56px; }
.countdown-num {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(3.4rem, 15vw, 5.6rem);
  color: var(--oliv);
  display: block;
  line-height: 1;
}
.countdown-label {
  font-family: 'Karla', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-facts-title {
  text-align: center;
  margin: 34px 0 0;
}
.hero-facts {
  max-width: 420px;
  margin: 14px auto 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.hero-fact {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.9rem;
}
.hero-fact-label { color: var(--ink-soft); padding-top: 2px; }
.hero-fact-value {
  color: var(--ink);
  font-weight: 700;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.hero-fact-map {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--oliv);
  text-decoration: none;
}
.hero-fact-map:hover { text-decoration: underline; }

.hero-cta {
  margin-top: 30px;
}

/* ---------------------------------------------------------------
   Sektioner / avdelare
   --------------------------------------------------------------- */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.section.alt { background: var(--bg-alt); }

.section-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px 30px;
}
.section-title {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
}

/* ---------------------------------------------------------------
   Praktisk info
   --------------------------------------------------------------- */
.info-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 620px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
}
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 24px;
}
.info-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}
.info-card p {
  color: var(--ink-soft);
  font-size: 0.94rem;
  margin-bottom: 8px;
}
.info-card p:last-child { margin-bottom: 0; }
.map-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  margin-top: 10px;
}
.map-link::after { content: "→"; transition: transform 0.15s ease; }
.map-link:hover::after { transform: translateX(3px); }

.placeholder {
  color: var(--oliv-deep);
  background: var(--smor-soft);
  padding: 0.05em 0.4em;
  border-radius: 2px;
  font-style: italic;
  font-size: 0.95em;
}

.dress-code-line {
  display: flex;
  align-items: center;
  gap: 8px;
}
.info-trigger {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--oliv);
  background: none;
  color: var(--oliv);
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 0.72rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  cursor: pointer;
}
.info-trigger:hover { background: var(--bg-alt); }
.info-popover {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.info-popover p {
  color: var(--ink-soft);
  font-size: 0.86rem;
  margin: 0;
}

/* ---------------------------------------------------------------
   Program / tidslinje
   --------------------------------------------------------------- */
.timeline {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-day {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 18px;
}
.timeline-day + .timeline-day { margin-top: 6px; }
.timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timeline-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--oliv);
  margin-top: 6px;
  flex-shrink: 0;
}
.timeline-line {
  width: 1px;
  flex: 1;
  background: var(--line);
  margin-top: 4px;
}
.timeline-day:last-child .timeline-line { display: none; }
.timeline-content { padding-bottom: 40px; }
.timeline-day-name {
  font-size: 1.35rem;
  margin-bottom: 4px;
}
.timeline-day-date {
  display: block;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.timeline-events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.timeline-event {
  display: grid;
  grid-template-columns: minmax(62px, max-content) 1fr;
  column-gap: 14px;
  row-gap: 2px;
}
.timeline-event-time {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--oliv);
  font-size: 0.92rem;
  padding-top: 1px;
}
.timeline-event-body p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin-top: 2px;
}
.timeline-event-body strong { color: var(--ink); }
.timeline-event-spaced p { margin-top: 14px; }

/* ---------------------------------------------------------------
   OSA-formulär
   --------------------------------------------------------------- */
.rsvp-form {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row label {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
}
.form-row .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.8rem;
}
.form-grid-2 {
  display: grid;
  gap: 16px;
}
@media (min-width: 560px) {
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
}

.names-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.name-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.name-row-label {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oliv);
  margin: 0 0 8px;
}
input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
  font-family: 'Karla', sans-serif;
  font-size: 1rem;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--ink);
  width: 100%;
}
textarea { resize: vertical; min-height: 90px; }

fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
fieldset legend {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink);
  padding: 0;
  margin-bottom: 4px;
}
.radio-row, .check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.radio-row label, .check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 0.94rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 9px 16px;
  cursor: pointer;
}
.radio-row input, .check-row input { accent-color: var(--oliv); }

.rsvp-status {
  font-size: 0.92rem;
  min-height: 1.4em;
}
.rsvp-status.ok { color: var(--oliv-deep); }
.rsvp-status.error { color: #A24438; }

.rsvp-success {
  display: none;
  text-align: center;
  padding: 40px 22px;
}
.rsvp-success.show { display: block; }
.rsvp-success h3 { font-size: 1.6rem; margin-bottom: 10px; }
.rsvp-success p { color: var(--ink-soft); }
.rsvp-success .sign-off-text { color: var(--ink); margin: 18px auto; }
.rsvp-success-note { font-size: 0.88rem; }
.rsvp-again-btn { margin-top: 26px; }

/* ---------------------------------------------------------------
   Bröllopsföljet
   --------------------------------------------------------------- */
.party-section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
}

.host-profiles {
  display: grid;
  gap: 30px;
  margin-bottom: 20px;
}
@media (min-width: 620px) {
  .host-profiles { grid-template-columns: 1fr 1fr; }
}
.host-profile {
  text-align: center;
}
.host-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto 14px;
}
.host-photo .placeholder { font-size: 0.62rem; }
.host-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.host-profile h3 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}
.host-profile .ui-label { display: block; margin-bottom: 10px; }
.host-bio {
  color: var(--ink-soft);
  font-size: 0.92rem;
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}
.host-contact-note {
  color: var(--ink-soft);
  font-size: 0.86rem;
  max-width: 38ch;
  margin: 12px auto 0;
}
.host-contact-note-shared {
  text-align: center;
  max-width: 52ch;
  margin: 0 auto 44px;
}

/* ---------------------------------------------------------------
   Sign-off (visas nu i OSA-formulärets bekräftelse)
   --------------------------------------------------------------- */
.sign-off-text {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.9rem, 5.5vw, 3rem);
  line-height: 1.35;
  max-width: 24ch;
  margin: 0 auto;
  color: var(--ink);
  text-wrap: balance;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  padding: 34px 22px 50px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
