/* =========================================================================
   Ruf:Zu — landing page (index.html)
   Section styles specific to the full landing page. Shared chrome (topbar,
   nav, contact, footer) lives in theme.css.
   ========================================================================= */

.section { padding: 3.5rem 0; }
.section-gray { background: var(--surface-sunken); }

.section-title { text-align: center; }

.lead {
  max-width: 620px;
  margin: 0 auto 2.5rem;
  text-align: center;
  color: var(--text);
}

/* =========================================================================
   Hero card  (#start)
   ========================================================================= */
.hero-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: min(1560px, 96vw); /* wider than the content column — overflows the sides */
  min-height: 60vh;
  margin: 2.5rem auto 0;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 12px 30px -12px rgba(66, 50, 20, 0.45);
}

@media (min-width: 1141px) {
  .hero-card { margin-inline: auto; }
}

.hero-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 0;
  background: var(--bg);
  border: 10px solid var(--orange);
  border-right: 0;
  border-radius: 30px 0 0 30px;
  background-clip: padding-box;
  overflow: hidden;
}

.hero-photo picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  margin: 0 auto;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--orange);
  color: #fff;
  text-align: center;
}

.hero-app {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(0.9rem, 1.4vw, 1.25rem);
  line-height: 1.3;
  text-align: left;
}

.hero-qr {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
}

.hero-qr:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.hero-app img {
  display: block;
  flex: 0 0 auto;
  width: clamp(6.25rem, 9vw, 7rem);
  padding: 0.35rem;
  background: #fff;
}

.hero-app p {
  margin: 0;
}

.hero-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.2rem, 3.6vw, 3.1rem);
  line-height: 1.1;
  color: #fff;
}

.hero-title .accent { color: #424243; }

.hero-title .region-name {
  display: inline-block;
  min-height: 1.1em;
  font-size: clamp(1.6rem, 2.8vw, 3rem);
  white-space: nowrap;
}

.hero-title .region-name.is-updating {
  animation: region-reveal 0.35s ease both;
}

@keyframes region-reveal {
  from { opacity: 0; transform: translateY(0.25em); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.hero-panel .btn-primary,
.stops-card .btn-primary {
  background: #fff;
  color: var(--orange-dark);
}

.hero-panel .btn-primary:hover,
.hero-panel .btn-primary:focus-visible,
.stops-card .btn-primary:hover,
.stops-card .btn-primary:focus-visible {
  background: #4a3208;
  color: #fff;
  box-shadow: 0 8px 18px rgba(74, 50, 8, 0.32);
}

.hero-stats {
  display: flex;
  gap: 3rem;
  margin-top: 0.5rem;
}

.stat { text-align: center; }

.stat-num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1;
}

.stat-label { font-size: 1rem; color: rgba(255, 255, 255, 0.85); }

@media (prefers-color-scheme: dark) {
  .hero-panel .btn-primary:hover,
  .hero-panel .btn-primary:focus-visible,
  .stops-card .btn-primary:hover,
  .stops-card .btn-primary:focus-visible {
    background: #171718;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  }

  .hero-panel .btn-ghost,
  .stops-card .btn-ghost {
    background: #4a3208;
    border: 1px solid #4a3208;
    color: #fff;
  }

  .hero-panel .btn-ghost:hover,
  .hero-panel .btn-ghost:focus-visible,
  .stops-card .btn-ghost:hover,
  .stops-card .btn-ghost:focus-visible {
    background: #fff;
    border-color: transparent;
    color: #4a3208;
  }
}

/* =========================================================================
   Features / advantages  (#vorteile)
   ========================================================================= */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 1.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.iconbox { text-align: center; }

.iconbox .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--surface-panel);
  color: var(--orange);
}

.iconbox .icon svg { width: 50px; height: 50px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.iconbox h3 {
  font-size: 1.375rem;
  margin-bottom: 0.5rem;
}

.iconbox p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.features .iconbox:last-child { grid-column: 2; }

/* =========================================================================
   How it works  (#funktion)
   ========================================================================= */
.funktion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
}

.funktion-figure {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.funktion-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-header);
}

.funktion-figure figcaption {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: center;
}

.funktion-figure figcaption a { color: inherit; }

.funktion-text h2 { margin-bottom: 1rem; }
.funktion-text p { margin: 0 0 1.25rem; }

/* =========================================================================
   Tariffs table  (#tarife)
   ========================================================================= */
#tarife { padding-top: 3rem; }

.tarife-intro {
  max-width: var(--maxw);
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

#tarife h2 { margin-bottom: 1.1rem; }

.tarife-wrap { max-width: var(--maxw); margin: 0 auto; overflow-x: auto; }

.tarife-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tarife-table th,
.tarife-table td {
  padding: 0.85rem 1rem;
  text-align: center;
  vertical-align: middle;
  border: 1px solid var(--border);
}

.tarife-table thead th {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text);
  background: var(--surface-panel);
}

.tarife-table tbody tr:nth-child(even) { background: var(--surface-stripe); }

.tarife-table .rowhead { font-weight: 700; text-align: left; }

.tarife-table .comfort-cell {
  min-width: 9rem;
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--bg);
}

.tarife-table .more-zones-cell {
  width: 30%;
  min-width: 15rem;
  background: var(--bg);
}

.more-zones-cell span { display: block; margin-bottom: 0.75rem; }
.more-zones-cell a { font-weight: 700; }

.mobile-zone-info { display: none; }

.tarife-notes {
  max-width: var(--maxw);
  margin: 1.5rem auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.tarife-notes p { margin: 0; }
.tarife-notes b { color: var(--text); }

/* =========================================================================
   Stops + map  (#haltestellen)
   ========================================================================= */
/* Unified card: map and orange CTA panel joined inside one rounded box. */
.stops-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  width: 100%;
  max-width: min(1560px, 96vw); /* wider than the content column — overflows the sides */
  min-height: 48vh;
  margin: 0 auto;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 12px 30px -12px rgba(66, 50, 20, 0.45);
}

.stops-map-wrap {
  overflow: hidden;
  height: 100%;
  min-height: 320px;
}

.stops-map {
  width: 100%;
  height: calc(100% + 64px); /* pad for cropped top bar */
  margin-top: -64px;         /* clip Google My Maps top bar */
  border: 0;
}

.stops-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--orange);
  color: #fff;
  text-align: center;
}

.stops-card h2 {
  color: #fff;
  margin: 0;
  font-size: clamp(2.2rem, 3.6vw, 3.1rem);
}
.stops-card p { margin: 0; }

.stops-actions {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.6rem;
  width: min(100%, 24rem);
}

.stops-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: clamp(0.65rem, 2.5vw, 2rem);
  white-space: nowrap;
}

.pdf-link {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.5rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
}

.pdf-link:hover,
.pdf-link:focus-visible { color: #4a3208; }
.pdf-link svg { flex: 0 0 auto; width: 1.4rem; height: 1.4rem; fill: currentColor; margin-top: 0.1rem; }

/* =========================================================================
   Municipality crests  (#gemeinden) — desktop only, decorative
   ========================================================================= */
.crests {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 7vw, 7rem);
  max-width: min(1720px, 92vw);
  margin: 0 auto;
  padding: 3.5rem clamp(1.5rem, 4vw, 4rem);
}

.crests img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .hero-title .region-name.is-updating { animation: none; }
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 899px) {
  .hero-card {
    grid-template-columns: 1fr;
    width: auto;
    max-width: none;
    margin: 1.5rem 1rem 0;
  }

  .hero-photo {
    min-height: 240px;
    border-right: 10px solid var(--orange);
    border-bottom: 0;
    border-radius: 30px 30px 0 0;
  }

  /* Prevent a sub-pixel hairline where the stacked hero pieces meet. */
  .hero-panel { margin-top: -1px; }

  .hero-title .region-name { font-size: clamp(1.85rem, 7vw, 2.25rem); }

  .hero-app {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .hero-app p { text-align: center; }

  .features { grid-template-columns: 1fr; }
  .features .iconbox:last-child { grid-column: auto; }

  .funktion-grid { grid-template-columns: 1fr; }

  .stops-grid { grid-template-columns: 1fr; }

  /* Stack the tariff table into one card per tariff row */
  .tarife-wrap { overflow-x: visible; }

  .tarife-table,
  .tarife-table tbody,
  .tarife-table tr,
  .tarife-table th,
  .tarife-table td { display: block; width: 100%; }

  .tarife-table thead { display: none; }

  .tarife-table tbody tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
  }

  .tarife-table tbody tr::after {
    content: "Komfortzuschlag\A € 2,00";
    grid-column: 1 / -1;
    padding: 0.65rem 1rem;
    white-space: pre-line;
    color: var(--text);
    background: var(--surface-stripe);
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
  }

  .tarife-table tbody tr:nth-child(even) { background: transparent; }

  .tarife-table td {
    width: auto;
    border-bottom: 1px solid var(--border);
    border-left: 0;
    border-right: 1px solid var(--border);
    border-top: 0;
    padding: 0.65rem 1rem;
  }

  .tarife-table td:nth-of-type(3) { border-right: 0; }

  .tarife-table td[colspan] {
    grid-column: 1 / -1;
    border-right: 0;
  }

  .tarife-table .rowhead {
    grid-column: 1 / -1;
    background: var(--surface-panel);
    font-family: var(--font-head);
    font-size: 1.05rem;
    text-align: center;
    border: 0;
    border-bottom: 1px solid var(--border);
  }

  .tarife-table .comfort-cell,
  .tarife-table .more-zones-cell { display: none; }

  /* Column heading printed above each value */
  .tarife-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
  }

  .mobile-zone-info {
    display: block;
    margin: 1.25rem 0 0;
    padding: 1rem;
    border-radius: 8px;
    background: var(--surface-panel);
    text-align: center;
  }

  .mobile-zone-info a { font-weight: 700; }

  .crests { display: none; }
}
