/* =====================================================================
   Startseite
   ===================================================================== */

/* ---------- Titelbild des Monats ----------
   Das Bild steht im Mittelpunkt: fast bildschirmhoch, ohne Kasten darüber.
   Bildausschnitt, Textseite und Textposition (mobil) kommen aus dem Verwaltungsbereich. */
.gb-hero { position: relative; isolation: isolate; background: #0b0f12; color: #fff; overflow: hidden; }
.gb-hero__media { position: relative; margin: 0; height: clamp(520px, calc(100svh - 94px), 940px); overflow: hidden; }
.gb-hero__img { width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
  .js .gb-hero__img { animation: gbHeroSettle 1.8s var(--gb-ease) both; }
  .js .gb-hero__copy > * { animation: gbHeroText .8s var(--gb-ease) both; }
  .js .gb-hero__copy > :nth-child(2) { animation-delay: .12s; }
  .js .gb-hero__copy > :nth-child(3) { animation-delay: .22s; }
  .js .gb-hero__copy > :nth-child(4) { animation-delay: .32s; }
}
@keyframes gbHeroSettle { from { transform: scale(1.06); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes gbHeroText { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
/* Lesbarkeit: nur unten bzw. zur Textseite hin leicht abdunkeln */
.gb-hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, transparent 18%, transparent 52%, rgba(0, 0, 0, .62) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .3) 0%, transparent 45%);
}
.gb-hero.is-right .gb-hero__media::after {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, transparent 18%, transparent 52%, rgba(0, 0, 0, .62) 100%),
    linear-gradient(270deg, rgba(0, 0, 0, .3) 0%, transparent 45%);
}
.gb-hero__text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding-bottom: clamp(36px, 6vw, 72px); pointer-events: none; }
.gb-hero__copy { max-width: 640px; pointer-events: auto; }
.gb-hero.is-right .gb-hero__copy { margin-left: auto; text-align: right; }
.gb-hero.is-right .gb-hero__actions { justify-content: flex-end; }
.gb-hero__copy h1 {
  color: #fff; margin: 16px 0 12px; font-size: clamp(2.4rem, 1.5rem + 3.4vw, 4.25rem); line-height: 1.04; letter-spacing: -.028em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}
.gb-hero__lead { margin: 0; font-size: clamp(1.1rem, 1rem + .5vw, 1.375rem); line-height: 1.45; color: rgba(255, 255, 255, .92); letter-spacing: -.012em; text-shadow: 0 1px 16px rgba(0, 0, 0, .4); }
.gb-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 26px; }
.gb-hero__link { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; text-decoration: none; font-size: 1.0625rem; }
.gb-hero__link i { font-size: .8em; transition: transform .2s var(--gb-ease); }
.gb-hero__link:hover { color: #fff; text-decoration: underline; text-underline-offset: .2em; }
.gb-hero__link:hover i { transform: translateX(3px); }
.gb-hero .gb-btn--light { --b-bg: rgba(255, 255, 255, .92); --b-fg: #1a1a1a; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.gb-hero .gb-btn--light:hover { --b-bg: #fff; --b-fg: #db0059; }
.gb-hero__zoom {
  position: absolute; top: 18px; right: 18px; z-index: 3; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .38); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: background .2s;
}
.gb-hero__zoom:hover { background: rgba(0, 0, 0, .6); }
.gb-hero__credit {
  position: absolute; right: 18px; bottom: 16px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  background: rgba(0, 0, 0, .32); color: rgba(255, 255, 255, .88); font-size: .6875rem; line-height: 1.5; letter-spacing: .01em; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gb-hero__credit i { font-size: .85em; opacity: .85; }
.gb-hero.is-right .gb-hero__credit { right: auto; left: 18px; }
@media (min-width: 900px) { .gb-hero__credit { bottom: 20px; } }

/* Handy: Bild ohne Text darüber, Text darunter (oder darüber, je nach Einstellung) */
@media (max-width: 899px) {
  .gb-hero { display: flex; flex-direction: column; background: var(--gb-bg); color: var(--gb-text); }
  .gb-hero.is-mtop { flex-direction: column-reverse; }
  .gb-hero__media { height: auto; aspect-ratio: 6 / 5; max-height: 72svh; }
  .gb-hero__media::after { background: linear-gradient(180deg, transparent 70%, rgba(0, 0, 0, .25) 100%); }
  .gb-hero__text { position: static; padding: 22px 0 8px; }
  .gb-hero.is-mtop .gb-hero__text { padding: 18px 0 20px; }
  .gb-hero__copy, .gb-hero.is-right .gb-hero__copy { max-width: none; margin: 0; text-align: left; }
  .gb-hero.is-right .gb-hero__actions { justify-content: flex-start; }
  .gb-hero__copy h1 { color: var(--gb-heading); text-shadow: none; font-size: clamp(2rem, 1.3rem + 4vw, 2.8rem); margin: 12px 0 10px; }
  .gb-hero__lead { color: var(--gb-muted); text-shadow: none; font-size: 1.125rem; }
  .gb-hero__link { color: var(--gb-link); }
  .gb-hero__link:hover { color: var(--gb-link-hover); }
  .gb-hero .gb-btn--light { --b-bg: var(--gb-accent); --b-fg: var(--gb-accent-contrast); backdrop-filter: none; }
  .gb-hero .gb-btn--light:hover { --b-bg: var(--gb-magenta-fill); --b-fg: #fff; }
  .gb-hero__credit, .gb-hero.is-right .gb-hero__credit { left: auto; right: 10px; bottom: 10px; font-size: .6875rem; }
  .gb-hero__zoom { top: 12px; right: 12px; width: 40px; height: 40px; }
}

/* ---------- Fahrplanauskunft (Markenblau wie bisher) ---------- */
.gb-planner { padding-block: clamp(56px, 8vw, 104px); background: linear-gradient(135deg, var(--gb-blue-brand) 0%, var(--gb-blue-dark) 100%); color: #fff; }
body.dark-mode .gb-planner { background: linear-gradient(135deg, #16354a 0%, #0f2433 100%); }
.gb-planner__head { text-align: center; margin: 0 auto clamp(26px, 4vw, 40px); max-width: 820px; }
.gb-planner__head h2 { color: #fff; margin: 0; font-size: clamp(2rem, 1.4rem + 2.2vw, 3.25rem); }
.gb-planner__head h2 span { color: rgba(255, 255, 255, .72); }
.gb-planner__widget { position: relative; max-width: 960px; min-height: 280px; margin: 0 auto; border-radius: var(--gb-r-l); overflow: hidden; background: #fff; box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .45); filter: hue-rotate(-20deg); }
.gb-planner__widget .gb-skeleton { position: absolute; inset: 0; height: auto; border-radius: 0; z-index: 0; }
.gb-planner__widget [data-hfs-widget] { position: relative; z-index: 1; }
.gb-planner__links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 0; padding: 0; }
.gb-planner__links a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 99px; background: rgba(255, 255, 255, .14); color: #fff; text-decoration: none; font-weight: 600; font-size: .9375rem; transition: background .2s; }
.gb-planner__links a:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.gb-planner__fallback { display: grid; place-items: center; gap: 12px; min-height: 240px; padding: 24px; text-align: center; color: var(--gb-text); filter: hue-rotate(20deg); }
.gb-planner :focus-visible { outline-color: #fff; }

/* ---------- Schnellzugriff als Linienverlauf ---------- */
.gb-route { padding-block: clamp(56px, 7vw, 96px) 0; }
.gb-route__title { position: absolute; }
.gb-route__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gb-route__stop { position: relative; }
.gb-route__stop::before {
  content: ""; position: absolute; top: 10px; left: 0; right: 0; height: 4px; background: var(--gb-blue-dark); opacity: 1;
}
.gb-route__stop:first-child::before { left: 10px; }
.gb-route__stop:last-child::before { right: calc(100% - 14px); }
.gb-route__link { position: relative; display: block; padding: 0 16px 8px 0; text-decoration: none; color: var(--gb-heading); }
.gb-route__dot {
  position: relative; z-index: 1; display: block; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gb-bg); border: 4px solid var(--gb-blue-dark); margin-bottom: 14px;
  transition: background .2s, border-color .2s, transform .2s var(--gb-ease);
}
.gb-route__name { display: flex; align-items: center; gap: 8px; font-family: var(--gb-font-head); font-weight: 700; font-size: 1.1875rem; line-height: 1.2; letter-spacing: -.02em; }
.gb-route__name i { color: var(--gb-magenta); font-size: .95rem; }
.gb-route__hint { display: block; margin-top: 4px; color: var(--gb-muted); font-size: .9375rem; line-height: 1.4; }
.gb-route__link:hover { color: var(--gb-heading); }
.gb-route__link:hover .gb-route__dot, .gb-route__link:focus-visible .gb-route__dot { background: var(--gb-magenta); border-color: var(--gb-magenta); transform: scale(1.12); }
.gb-route__link:hover .gb-route__name { text-decoration: underline; text-decoration-color: var(--gb-magenta); text-underline-offset: .2em; }
/* Linie „fährt ein“: Abschnitt für Abschnitt, jede Haltestelle leuchtet kurz auf */
.gb-route__stop:nth-child(2) { --i: 1; } .gb-route__stop:nth-child(3) { --i: 2; } .gb-route__stop:nth-child(4) { --i: 3; }
.gb-route__stop:nth-child(5) { --i: 4; } .gb-route__stop:nth-child(6) { --i: 5; }
.gb-route.is-ready .gb-route__stop::before { transform: scaleX(0); transform-origin: left center; }
.gb-route.is-ready .gb-route__dot { border-color: var(--gb-line-strong); }
.gb-route.is-run .gb-route__stop::before { transform: none; transition: transform .34s linear; transition-delay: calc(var(--i, 0) * .3s); }
.gb-route.is-run .gb-route__dot { border-color: var(--gb-blue-dark); animation: gbStopLight .7s var(--gb-ease) both; animation-delay: calc(var(--i, 0) * .3s); }
@keyframes gbStopLight { 0% { border-color: var(--gb-line-strong); } 35% { border-color: var(--gb-magenta); background: var(--gb-magenta); transform: scale(1.18); } 100% { border-color: var(--gb-blue-dark); transform: none; } }
@media (max-width: 899px) {
  .gb-route.is-ready .gb-route__stop::before { transform: scaleY(0); transform-origin: center top; }
}
@media (max-width: 899px) {
  .gb-route__list { grid-template-columns: 1fr; }
  .gb-route__stop::before { top: 0; bottom: 0; left: 10px; right: auto; width: 4px; height: auto; }
  .gb-route__stop:first-child::before { top: 18px; left: 10px; }
  .gb-route__stop:last-child::before { bottom: calc(100% - 18px); right: auto; }
  .gb-route__link { display: grid; grid-template-columns: 24px 1fr; column-gap: 16px; padding: 8px 0 14px; }
  .gb-route__dot { margin: 2px 0 0; grid-row: span 2; }
}

/* ---------- Meldungen & Termine ---------- */
.gb-news { display: grid; gap: 0; }
.gb-newsitem { position: relative; display: grid; gap: 8px 24px; padding-block: 26px; border-bottom: 1px solid var(--gb-line); }
.gb-newsitem:first-child { padding-top: 0; }
.gb-newsitem:last-child { border-bottom: 0; }
.gb-newsitem.has-image { grid-template-columns: 220px minmax(0, 1fr); }
.gb-newsitem__media { grid-row: span 4; align-self: start; display: block; border-radius: var(--gb-r-m); overflow: hidden; background: var(--gb-surface); }
.gb-newsitem__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .6s var(--gb-ease); }
.gb-newsitem:hover .gb-newsitem__img { transform: scale(1.03); }
.gb-newsitem h3 { margin: 4px 0 2px; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.022em; }
.gb-newsitem h3 a { color: var(--gb-heading); text-decoration: none; }
.gb-newsitem h3 a:hover { color: var(--gb-link); }
.gb-newsitem h3 a::after { content: ""; position: absolute; inset: 0; }
.gb-newsitem .gb-chips, .gb-newsitem .gb-chips a { position: relative; z-index: 1; }
.gb-newsitem p { margin: 0; color: var(--gb-text); font-size: 1.0625rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Erste Meldung groß */
.gb-newsitem.is-lead { grid-template-columns: 1fr; padding-bottom: 32px; }
.gb-newsitem.is-lead .gb-newsitem__media { grid-row: auto; border-radius: var(--gb-r-l); margin-bottom: 10px; }
.gb-newsitem.is-lead .gb-newsitem__img { aspect-ratio: 16 / 9; }
.gb-newsitem.is-lead h3 { font-size: clamp(1.7rem, 1.3rem + 1.2vw, 2.25rem); letter-spacing: -.028em; }
.gb-newsitem.is-lead p { font-size: 1.125rem; -webkit-line-clamp: 4; }
@media (max-width: 599px) {
  .gb-newsitem.has-image:not(.is-lead) { grid-template-columns: 104px minmax(0, 1fr); column-gap: 16px; }
  .gb-newsitem:not(.is-lead) .gb-newsitem__media { grid-row: span 2; }
  .gb-newsitem:not(.is-lead) .gb-newsitem__img { aspect-ratio: 1; }
  .gb-newsitem:not(.is-lead) h3 { font-size: 1.25rem; }
  .gb-newsitem p, .gb-newsitem .gb-chips { grid-column: 1 / -1; }
  .gb-newsitem p { -webkit-line-clamp: 4; }
}

.gb-events { padding: clamp(22px, 3vw, 32px); background: var(--gb-surface); border-radius: var(--gb-r-xl); align-self: start; }
.gb-events h2 { font-size: 1.75rem; margin-bottom: 20px; }
.gb-events__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gb-event { position: relative; display: flex; gap: 16px; align-items: center; padding: 12px; margin: 0 -12px; border-radius: var(--gb-r-m); transition: background .2s; }
.gb-event:hover { background: var(--gb-surface-2); }
.gb-event__title { font-weight: 650; color: var(--gb-heading); line-height: 1.3; font-size: 1.0625rem; letter-spacing: -.015em; }
.gb-event__title a { color: inherit; text-decoration: none; }
.gb-event__title a::after { content: ""; position: absolute; inset: 0; }
.gb-event__meta { font-size: .9375rem; color: var(--gb-muted); margin-top: 2px; }
.gb-event--featured { flex-wrap: wrap; align-items: flex-start; background: var(--gb-card); margin: 0 0 12px; padding: 18px; box-shadow: var(--gb-shadow-1); }
.gb-event--featured:hover { background: var(--gb-card); box-shadow: var(--gb-shadow-2); }
.gb-event--featured .gb-event__body { flex: 1 1 160px; }
.gb-event--featured .gb-event__title { font-size: 1.25rem; }
.gb-event__desc { flex-basis: 100%; margin: 6px 0 0; font-size: 1rem; color: var(--gb-text); }
.gb-event__cta { position: relative; z-index: 1; margin-top: 12px; }
.gb-events__all { margin-top: 18px; }

/* ---------- Entdecken: vier gleich große Kacheln ---------- */
.gb-tiles { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gb-tile { position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 5; border-radius: var(--gb-r-xl); overflow: hidden; color: #fff; text-decoration: none; background: var(--gb-blue-dark); isolation: isolate; box-shadow: var(--gb-shadow-1); transition: box-shadow .3s var(--gb-ease), transform .3s var(--gb-ease); }
.gb-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s var(--gb-ease); }
.gb-tile::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .78) 100%); }
.gb-tile:hover { color: #fff; box-shadow: var(--gb-shadow-3); transform: translateY(-3px); }
.gb-tile:hover img { transform: scale(1.05); }
.gb-tile__body { position: relative; width: 100%; padding: 24px 22px; }
.gb-tile h3 { color: #fff; margin: 0 0 4px; font-size: 1.625rem; letter-spacing: -.025em; }
.gb-tile p { margin: 0; color: rgba(255, 255, 255, .9); font-size: 1rem; padding-right: 40px; }
.gb-tile__go { position: absolute; right: 18px; bottom: 22px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: .8rem; transition: background .2s, transform .2s var(--gb-ease); }
.gb-tile:hover .gb-tile__go { background: var(--gb-magenta-fill); transform: translateX(2px); }
@media (max-width: 1023px) { .gb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gb-tile { aspect-ratio: 4 / 3; } }
@media (max-width: 599px) {
  /* Handy: wischbare Reihe wie bei Apple */
  .gb-tiles { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gb-gutter)); padding: 4px var(--gb-gutter) 12px; scrollbar-width: none; }
  .gb-tiles::-webkit-scrollbar { display: none; }
  .gb-tile { flex: 0 0 78%; aspect-ratio: 4 / 5; scroll-snap-align: start; }
}

/* ---------- Mitmachen & Social ---------- */
.gb-community { display: grid; gap: 24px; }
@media (min-width: 900px) { .gb-community { grid-template-columns: 1fr 1fr; } }
.gb-join { position: relative; overflow: hidden; padding: clamp(28px, 4vw, 48px); border-radius: var(--gb-r-xl); background: linear-gradient(135deg, #2c6e96 0%, #245b7c 100%); color: #fff; box-shadow: 0 20px 40px -18px rgba(58, 138, 189, .55); }
body.dark-mode .gb-join { background: linear-gradient(135deg, #1d4a66 0%, #16384e 100%); box-shadow: none; }
.gb-join::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .07); pointer-events: none; }
.gb-join h2 { color: #fff; }
.gb-join p { color: rgba(255, 255, 255, .92); max-width: 50ch; }
.gb-join__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.gb-social { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.gb-social a {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 16px; padding: 14px 18px;
  border: 0; border-radius: var(--gb-r-l); text-decoration: none; color: var(--gb-heading); background: var(--gb-surface);
  transition: border-color .15s, background .15s;
}
.gb-social a:hover { background: var(--gb-surface-2); color: var(--gb-heading); }
.gb-social__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-size: 1.35rem; color: #fff; }
.gb-social strong { display: block; font-size: 1.1rem; }
.gb-social a > span:not(.gb-social__icon) > span { display: block; color: var(--gb-muted); font-size: .93rem; }
.gb-social .gb-social__icon i { color: #fff; }
.gb-social .fa-arrow-up-right-from-square { color: var(--gb-muted); font-size: .9rem; }

/* Fahrplan-Widget im Dunkelmodus: schwebende Auswahllisten lesbar halten
   (gilt nur für fremde Elemente des Widgets – alle eigenen GöBUS-Elemente wie „Frag GöBUS“ sind ausgenommen) */
body.dark-mode.has-hafas > :not(header):not(main):not(footer):not(script):not(style):not(dialog):not([id^="gb-"]):not([class^="gb-"]):not([class*=" gb-"]) {
  color: #1a1a1a;
  --text-color: #1a1a1a;
  --hfs-color-text: #1a1a1a;
  --mdc-theme-text-primary-on-background: #1a1a1a;
}
