:root {
  --color-bg: #faf9f6;
  --color-surface: #f2f0ea;
  --color-text: #2b2824;
  --color-text-light: rgba(43, 40, 36, 0.7);
  --color-accent: #7f9560;
  --color-accent-700: #4c5c38;
  --color-accent-2: #b95861;
  --color-divider: rgba(43, 40, 36, 0.14);
  --font-script: 'Alex Brush', cursive;
  --font-heading: 'Cormorant', serif;
  --font-body: 'Cormorant', serif;
  --radius-md: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  scroll-behavior: smooth;
}

a { color: var(--color-accent-700); }

/* Language toggle logic */
[data-en] { display: none; }
html[data-lang="en"] [data-en] { display: inline; }
html[data-lang="en"] [data-de] { display: none; }

/* Nav (tab bar) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 14px 32px;
  background: rgba(250, 249, 246, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-divider);
}

.site-logo {
  display: inline-flex;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  color: var(--color-accent-700);
  text-decoration: none;
  padding-right: 4px;
  flex: 0 0 auto;
}

.site-logo-j {
  position: relative;
  top: 0.16em;
  margin-right: -0.25em;
}

.site-logo:hover { color: var(--color-accent-2); }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex: 1;
}

.tab-link {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text);
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.tab-link:hover {
  background: var(--color-surface);
  color: var(--color-accent-700);
}

.tab-link.active {
  background: var(--color-accent);
  color: #fff;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--color-accent-700);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 0;
}

.lang-toggle {
  display: flex;
  gap: 0.25rem;
}

.lang-btn {
  border: 1px solid var(--color-accent-2);
  background: none;
  color: var(--color-accent-2);
  font-family: var(--font-body);
  font-size: 0.8rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--color-accent-2);
  color: #fff;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(96px, 18vw, 160px) 24px clamp(72px, 12vw, 120px);
  text-align: center;
}

.hero-leaf {
  position: absolute;
  pointer-events: none;
}

.hero-leaf-tl { top: 0; left: 0; width: clamp(110px, 20vw, 220px); }
.hero-leaf-br { bottom: 0; right: 0; width: clamp(110px, 20vw, 220px); }

.eyebrow {
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  margin: 0 0 18px;
}

.hero-title {
  font-weight: 400;
  font-size: clamp(56px, 10vw, 120px);
  margin: 0;
  line-height: 1;
}

.hero-photo {
  display: block;
  width: clamp(280px, 55vw, 480px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin: 28px auto 8px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
}

.hero-date {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 22px;
  margin: 22px 0 10px;
}

.hero-sub {
  max-width: 46ch;
  margin: 0 auto;
  font-size: 17px;
  opacity: 0.8;
}

.hero-verse {
  max-width: 42ch;
  margin: 32px auto 0;
  font-size: 15px;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-accent-700);
  opacity: 0.85;
}

.countdown {
  margin: 36px 0 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  opacity: 0.8;
}

.script-heading {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--color-text);
}

/* Save the Date */
.save-date-card { padding-top: 8px; }

.save-date-video {
  display: block;
  width: clamp(280px, 62vw, 440px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  margin: 0 auto 28px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  background: #000;
  cursor: pointer;
}

.save-date-names {
  font-size: clamp(34px, 6vw, 52px);
  margin: 4px 0 26px;
}

.save-date-day {
  font-family: var(--font-heading);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--color-accent-700);
  margin: 0 0 4px;
}

.save-date-full {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(26px, 5vw, 36px);
  margin: 0 0 28px;
}

.btn-add-calendar {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 26px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent-700);
  color: #fff;
  cursor: pointer;
  margin-top: 8px;
}

.btn-add-calendar:hover { opacity: 0.9; }

/* Tab switching */
.tab-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sections */
.section-narrow { max-width: 760px; margin: 0 auto; padding: 64px 24px; }
.section-wide { max-width: 900px; margin: 0 auto; padding: 64px 24px; }
.center { text-align: center; }

.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--color-accent-700);
  margin: 0 0 36px;
}

.divider-spaced { margin-top: 56px; margin-bottom: 28px; }

.divider .line {
  flex: 1;
  height: 1px;
  background: var(--color-divider);
}

.divider-text { font-size: 30px; white-space: nowrap; }

.placeholder-text {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.85;
}

.placeholder-text.center { text-align: center; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--color-divider);
  padding: 16px 4px;
}

.faq-item summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 17px;
}

.faq-item p {
  margin: 12px 0 0;
  font-size: 15px;
  opacity: 0.8;
}

/* Contact form (FAQ) */
.contact-form {
  max-width: 480px;
  margin: 0 auto;
}

.contact-form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.contact-input {
  font-family: var(--font-body);
  font-size: 16px; /* keep >=16px: prevents iOS Safari auto-zoom on focus */
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  width: 100%;
}

.contact-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.contact-textarea {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  resize: vertical;
}

.contact-submit {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent-700);
  color: #fff;
  cursor: pointer;
}

.contact-submit:hover { opacity: 0.9; }
.contact-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Zeitplan timeline (icons + heart markers, alternating) */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--color-divider);
  transform: translateX(-50%);
}

.tl-item {
  display: grid;
  grid-template-columns: 1fr 34px 1fr;
  align-items: center;
  column-gap: 20px;
  margin-bottom: 40px;
}

.tl-item:last-child { margin-bottom: 0; }
.tl-item > * { grid-row: 1; }

.tl-marker {
  grid-column: 2;
  justify-self: center;
  width: 13px;
  height: 13px;
  background: var(--color-accent-2);
  transform: rotate(-45deg);
  border-radius: 0 0 2px 0;
  position: relative;
  z-index: 2;
}

.tl-marker::before,
.tl-marker::after {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  background: var(--color-accent-2);
  border-radius: 50%;
}

.tl-marker::before { top: -6.5px; left: 0; }
.tl-marker::after { top: 0; right: -6.5px; }

.tl-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(127, 149, 96, 0.14);
  color: var(--color-accent-700);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-icon svg { width: 40px; height: 40px; }

.tl-item:nth-child(odd) .tl-content { grid-column: 1; text-align: right; }
.tl-item:nth-child(odd) .tl-icon { grid-column: 3; justify-self: start; }

.tl-item:nth-child(even) .tl-icon { grid-column: 1; justify-self: end; }
.tl-item:nth-child(even) .tl-content { grid-column: 3; text-align: left; }

.tl-time {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 15px;
  color: var(--color-text);
  opacity: 0.65;
  margin: 0 0 2px;
}

.tl-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 19px;
}

.tl-sub {
  margin: 4px 0 0;
  font-size: 14px;
  opacity: 0.7;
}

/* Info cards (Zeitplan notes) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.info-card {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 24px;
}

.info-card h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-family: var(--font-heading);
}

.info-card p {
  margin: 0 0 10px;
  font-size: 14.5px;
  opacity: 0.8;
  line-height: 1.6;
}

.info-card p:last-child { margin-bottom: 0; }

/* Location */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 28px;
}

.location-grid h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-family: var(--font-heading);
}

.location-grid .tl-sub {
  margin: 0 0 14px;
  font-size: 14.5px;
  opacity: 0.75;
  line-height: 1.5;
}

.location-photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  display: block;
}

.map-embed {
  width: 100%;
  height: 220px;
  border: 6px solid var(--color-surface);
  outline: 1px solid var(--color-divider);
  box-sizing: border-box;
  border-radius: var(--radius-md);
}

.live-departures {
  max-width: 560px;
  margin: 0 auto;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  text-align: left;
}

.live-departures h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-family: var(--font-heading);
}

.live-departures .tl-sub {
  margin: 0 0 16px;
  font-size: 14.5px;
  opacity: 0.75;
  line-height: 1.5;
}

.departures-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.departure-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-divider);
  font-size: 15.5px;
}

.departure-item:first-child { border-top: none; }

.departure-badge {
  flex: 0 0 auto;
  min-width: 34px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  margin-top: 1px;
}

.departure-badge.badge-ubahn { background: var(--color-accent-700); }
.departure-badge.badge-tram { background: var(--color-accent); }
.departure-badge.badge-bus { background: var(--color-accent-2); }
.departure-badge.badge-train { background: var(--color-accent-700); }
.departure-badge.badge-night { background: var(--color-text); }

.departure-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.departure-direction {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.departure-stop {
  font-size: 13px;
  opacity: 0.65;
  margin-top: 1px;
}

.departure-time {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
}

.departure-clock {
  color: var(--color-accent-700);
  font-weight: 600;
}

.departure-countdown {
  font-size: 13px;
  opacity: 0.65;
  margin-top: 1px;
}

.departures-status {
  padding: 9px 0;
  font-size: 15px;
  opacity: 0.7;
}

.departures-updated {
  margin: 14px 0 0;
  font-size: 12.5px;
  opacity: 0.55;
  text-align: right;
}

.departures-more-info {
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.75;
  text-align: right;
}

.live-data-disclaimer {
  margin: 10px 0 0;
  font-size: 11.5px;
  opacity: 0.5;
  text-align: right;
  font-style: italic;
}

.departures-time-row {
  margin-bottom: 18px;
}

.departures-time-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.departures-time-controls .route-time-input {
  flex: 1 1 auto;
  min-width: 0;
}

.departures-time-controls .route-dest-btn {
  flex: 0 0 auto;
}

/* Opportunistic fix: script.js emits .departure-delay but no rule existed */
.departure-delay {
  color: var(--color-accent-2);
  font-size: 0.85em;
  margin-left: 4px;
}

/* Route planner */
.route-planner {
  max-width: 560px;
  margin: 32px auto 0;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  text-align: left;
}

.route-planner h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-family: var(--font-heading);
}

.route-planner .tl-sub {
  margin: 0 0 18px;
  font-size: 14.5px;
  opacity: 0.75;
  line-height: 1.5;
}

.route-dest-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.route-dest-btn {
  flex: 1 1 auto;
  min-width: 96px;
  border: 1px solid var(--color-accent);
  background: none;
  color: var(--color-accent-700);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.route-dest-btn.active {
  background: var(--color-accent);
  color: #fff;
}

.route-custom-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.route-time-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 16px;
}

.route-time-label {
  font-family: var(--font-body);
  font-size: 14.5px;
  opacity: 0.75;
}

.route-custom-input,
.route-time-input {
  font-family: var(--font-body);
  font-size: 16px; /* keep >=16px: prevents iOS Safari auto-zoom on focus */
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
}

.route-custom-input {
  flex: 1 1 auto;
  min-width: 0;
}

.route-custom-input:focus,
.route-time-input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.route-custom-submit {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-accent-700);
  color: #fff;
  cursor: pointer;
}

.route-custom-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.itinerary-dest {
  margin: 0 0 10px;
  font-size: 14.5px;
}

.itinerary-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
  font-family: var(--font-heading);
  margin-bottom: 10px;
}

.itinerary-duration {
  font-weight: 600;
  color: var(--color-accent-700);
  font-size: 18px;
}

.itinerary-transfers, .itinerary-times {
  font-size: 14px;
  opacity: 0.7;
}

.itinerary-legs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.itinerary-leg {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--color-divider);
  font-size: 15px;
}

.itinerary-leg:first-child { border-top: none; }

.leg-walk-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

.leg-walk-icon svg { width: 20px; height: 20px; }

.leg-detail {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.leg-mode-label { opacity: 0.65; }
.leg-duration { font-size: 13px; opacity: 0.6; }
.leg-direction { font-weight: 600; }
.leg-stop { font-size: 13px; opacity: 0.65; margin-top: 1px; }

/* Sitzplan */
.sitzplan-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  text-align: left;
}

.dashed-box {
  border: 1px dashed var(--color-divider);
  border-radius: var(--radius-md);
  padding: 56px 24px;
  font-size: 15px;
  opacity: 0.65;
  text-align: center;
  grid-column: 1 / -1;
}

.tisch-card {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}

.tisch-card h3 {
  font-family: var(--font-script);
  color: var(--color-accent-700);
  font-size: 26px;
  margin: 0 0 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.tisch-belegung {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-accent-700);
  background: var(--color-surface);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.tisch-card ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 15px;
}

/* Menu / Drinks */
.subheading-center {
  text-align: center;
  margin: 0 0 32px;
  font-size: 20px;
  font-family: var(--font-heading);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.menu-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.menu-grid h4 {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-700);
}

.menu-list {
  margin: 0;
  font-size: 15px;
  line-height: 2;
}

.menu-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  font-style: italic;
  opacity: 0.7;
}

/* Geschenke */
.qr-box {
  width: 220px;
  margin: 0 auto;
  text-align: center;
}

.qr-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
}

.qr-password {
  margin: 14px 0 0;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.qr-link {
  display: inline-block;
  text-decoration: none;
  margin-top: 18px;
}

.qr-hint {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.65;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 56px 24px 72px;
}

.footer-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.footer-divider .line {
  width: 60px;
  height: 1px;
  background: var(--color-divider);
}

.footer-heart { color: var(--color-accent-2); }

/* Responsive */
@media (max-width: 700px) {
  .site-header { padding: 12px 16px; flex-wrap: wrap; }
  .site-header { align-items: center; }
  .tabs {
    display: none;
    flex-direction: column;
    flex-basis: 100%;
    width: 100%;
    order: 3;
    padding-top: 0.5rem;
  }
  .tabs.open { display: flex; }
  .menu-toggle { display: flex; order: 2; }
  .lang-toggle { order: 1; align-items: center; }
  .hero-title { font-size: 15vw; }

  /* Timeline: single column, line on the left */
  .timeline::before { left: 26px; }

  .tl-item {
    grid-template-columns: 52px 1fr;
    column-gap: 14px;
    align-items: start;
  }

  .tl-item .tl-marker { grid-column: 1; grid-row: 1; justify-self: center; margin-top: 8px; }

  .tl-item:nth-child(odd) .tl-icon,
  .tl-item:nth-child(even) .tl-icon {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
  }

  .tl-icon svg { width: 30px; height: 30px; }

  .tl-item:nth-child(odd) .tl-content,
  .tl-item:nth-child(even) .tl-content {
    grid-column: 2;
    grid-row: 2;
    text-align: left;
  }

  .route-custom-form { flex-direction: column; }
  .route-custom-submit { width: 100%; }

  .contact-form-row { flex-direction: column; }
  .contact-submit { width: 100%; }
}
