/* ==========================================================
   Geoportal St. Ingbert – Theme für Bootstrap 5.3
   Zentrale Farbe: --gp-primary (Stadt-Rot, CI-Wert hier eintragen)
   ========================================================== */

:root {
  /* Stadt-Blau aus www.st-ingbert.de – für Flächen, Logo, große Schrift */
  --gp-brand: #0090CF;
  /* dunkleres Blau für Buttons, Links, kleine Schrift (Kontrast 5,2:1 zu Weiß) */
  --gp-primary: #0072B5;
  --gp-primary-rgb: 0, 114, 181;
  --gp-primary-dark: #005A8E;
  --gp-ink: #1C2424;
  --gp-paper: #F7F6F3;
  --gp-sand: #EDEBE6;
  --gp-line: #E4E0D6;

  --gp-font-display: "Fraunces", Georgia, serif;
  --gp-font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gp-font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  /* Bootstrap-Variablen überschreiben */
  --bs-primary: var(--gp-primary);
  --bs-primary-rgb: var(--gp-primary-rgb);
  --bs-link-color: var(--gp-primary);
  --bs-link-color-rgb: var(--gp-primary-rgb);
  --bs-link-hover-color: var(--gp-primary-dark);
  --bs-body-font-family: var(--gp-font-body);
  --bs-body-color: var(--gp-ink);
  --bs-body-bg: var(--gp-paper);
  --bs-border-color: var(--gp-line);
  --bs-focus-ring-color: rgba(var(--gp-primary-rgb), .35);
}

/* Buttons: Bootstrap kompiliert die Farben fest, daher hier setzen */
.btn-primary {
  --bs-btn-bg: var(--gp-primary);
  --bs-btn-border-color: var(--gp-primary);
  --bs-btn-hover-bg: var(--gp-primary-dark);
  --bs-btn-hover-border-color: var(--gp-primary-dark);
  --bs-btn-active-bg: var(--gp-primary-dark);
  --bs-btn-active-border-color: var(--gp-primary-dark);
  --bs-btn-focus-shadow-rgb: var(--gp-primary-rgb);
  --bs-btn-disabled-bg: var(--gp-primary);
  --bs-btn-disabled-border-color: var(--gp-primary);
  --bs-btn-disabled-opacity: .4;
  font-weight: 600;
}
.text-bg-primary { background-color: var(--gp-primary) !important; color: #fff !important; }

.font-display { font-family: var(--gp-font-display); letter-spacing: -.01em; }
.font-mono { font-family: var(--gp-font-mono); }
.bg-sand { background: var(--gp-sand); }

.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; }

/* ---------- Service-Leiste & Header ---------- */
.servicebar { background: var(--gp-sand); font-size: .8125rem; padding: .25rem 0; }
.servicebar .btn-link { white-space: nowrap; padding-left: .4rem; padding-right: .4rem; }
.servicebar .btn-link { text-decoration: none; font-size: .8125rem; }
.site-header { border-bottom: 4px solid var(--gp-brand); padding: .9rem 0; }
.site-header .nav-link { color: var(--gp-ink); font-weight: 500; }
.site-header .nav-link:hover { color: var(--gp-primary); }
.brand-mark {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--gp-brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: #ECE8DE; }
.hero-map { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-card {
  background: #fff; border-radius: 28px; padding: 2rem;
  box-shadow: 0 20px 50px rgba(28, 36, 36, .12);
}
@media (min-width: 992px) {
  .hero { min-height: clamp(640px, 44vw, 900px); } /* wächst mit der Breite, damit Kirche und Glaskuppel ins Bild passen */
  .hero-card { padding: 2.75rem; }
}
.hero-title { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.02; font-weight: 600; margin-bottom: 1rem; }
.hero-title em { font-weight: 500; }
.badge-new {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .3rem .9rem .3rem .3rem; border-radius: 999px;
  background: var(--gp-paper); color: var(--gp-ink); font-size: .875rem;
}
.search-field {
  display: flex; align-items: center; gap: .75rem;
  height: 60px; padding: 0 .375rem 0 1.1rem;
  background: var(--gp-paper); border: 1px solid #D3CEC2; border-radius: 16px;
  color: #56605F;
}
.search-field:focus-within { border-color: var(--gp-primary); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.search-field .form-control { border: 0; background: transparent; box-shadow: none; padding: 0; font-size: 1.05rem; }
.search-field .btn { height: 48px; border-radius: 12px; padding: 0 1.5rem; }
.chip {
  padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--gp-line);
  color: var(--gp-ink); text-decoration: none;
}
.chip:hover { border-color: var(--gp-primary); color: var(--gp-primary); }

.hero-legend {
  position: absolute; right: 1.5rem; top: 3rem; width: 220px;
  flex-direction: column; gap: .6rem; padding: 1.1rem;
  background: #fff; border-radius: 18px; font-size: .875rem;
  box-shadow: 0 12px 30px rgba(28, 36, 36, .10);
}
.hero-legend .legend-title { font-family: var(--gp-font-mono); font-size: .7rem; letter-spacing: .08em; color: #56605F; }
.hero-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: .6rem; vertical-align: -1px; }
.hero-mapbtn { position: absolute; right: 1.5rem; bottom: 2.5rem; font-weight: 600; }
@media (max-width: 991.98px) { .hero-mapbtn { position: static; margin-top: 1rem; } }

/* ---------- Themen-Bento ---------- */
.bento { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 1.5rem;
  min-height: 170px; padding: 1.5rem; border-radius: 24px;
  background: var(--tile-bg, #fff); color: var(--gp-ink); text-decoration: none;
  transition: transform .15s ease;
}
.tile:hover { color: var(--gp-ink); transform: translateY(-3px); }
.tile:focus-visible { outline: 3px solid var(--gp-primary); outline-offset: 3px; }
.tile-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; color: var(--tile-fg);
  display: flex; align-items: center; justify-content: center;
}
.tile-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile-title { display: block; font-family: var(--gp-font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }
.tile-lg .tile-title { font-size: 2.1rem; }
.tile-sub { display: block; margin-top: .35rem; font-size: .9rem; opacity: .8; }
.tile-cta { background: #fff; border: 1.5px dashed #BDB7A8; }

@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .area-bau, .area-luf { grid-column: span 2; }
}
@media (min-width: 1200px) {
  .bento {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 210px);
    grid-template-areas:
      "bau bau umw lie"
      "ver fre umw bil"
      "ent luf luf cta";
  }
  .area-bau { grid-area: bau; } .area-umw { grid-area: umw; } .area-lie { grid-area: lie; }
  .area-ver { grid-area: ver; } .area-fre { grid-area: fre; } .area-bil { grid-area: bil; }
  .area-ent { grid-area: ent; } .area-luf { grid-area: luf; } .area-cta { grid-area: cta; }
}

/* ---------- Karten unten ---------- */
.news-card, .service-card { border-radius: 20px; background: #fff; color: var(--gp-ink); }
.news-card:hover, .service-card:hover { border-color: var(--gp-primary); }
.news-card .card-body, .service-card .card-body, .contact-card .card-body { padding: 1.75rem; }
.contact-card { border-radius: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--gp-ink); color: #C6CDCB; }
.site-footer a { color: #C6CDCB; text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ---------- Barrierefreiheit ---------- */
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } .tile:hover { transform: none; } }

html.high-contrast {
  --gp-ink: #000; --gp-paper: #fff; --gp-sand: #fff; --gp-line: #000;
  --gp-primary: #005A8E; --gp-primary-rgb: 0, 90, 142; --gp-brand: #005A8E;
}
html.high-contrast .tile { background: #fff; border: 2px solid #000; }
html.high-contrast .tile-sub, html.high-contrast .text-body-secondary { opacity: 1; color: #000 !important; }
html.high-contrast .hero-map { display: none; }
html.high-contrast .news-card, html.high-contrast .service-card { border: 2px solid #000; }

/* ==========================================================
   Unterseiten
   ========================================================== */
.site-header .nav-link.active { color: var(--gp-primary); font-weight: 600; }

.page-head { background: var(--gp-sand); padding: 2.5rem 0 3rem; }
.page-head .breadcrumb { font-size: .875rem; margin-bottom: 1.25rem; }
.page-head .breadcrumb a { text-decoration: none; }
.page-title { font-size: clamp(2.25rem, 4vw, 3.5rem); font-weight: 600; line-height: 1.05; margin-bottom: .75rem; }
.page-lead { font-size: 1.15rem; line-height: 1.55; color: #3D4747; max-width: 46rem; margin: 0; }

.prose { max-width: 46rem; font-size: 1.05rem; line-height: 1.65; }
.prose h2 { font-family: var(--gp-font-display); font-weight: 600; font-size: 1.85rem; margin: 0 0 1rem; }
.prose h3 { font-weight: 600; font-size: 1.2rem; margin: 1.75rem 0 .5rem; }
.content-block { scroll-margin-top: 1.5rem; }
.content-block + .content-block { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--gp-line); }

/* Gut sichtbare Markierung für noch zu füllende Inhalte */
.platzhalter {
  padding: 1rem 1.25rem; border: 2px dashed #C9A227; border-radius: 12px;
  background: #FFF8E1; color: #5C4A00; font-size: .95rem;
}
.platzhalter code { color: inherit; }

.accept-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.5rem; padding: 1.25rem; background: #fff; border: 1px solid var(--gp-line); border-radius: 14px;
}

.side-card { border-radius: 20px; overflow: hidden; background: #fff; }
.side-card .card-img-top { aspect-ratio: 16 / 9; object-fit: cover; background: var(--gp-sand); }
.note-card { background: var(--gp-sand); border: 0; }
.toc li + li { margin-top: .5rem; }
.toc a { text-decoration: none; }

.service-tile { border-radius: 20px; overflow: hidden; background: #fff; }
.service-tile .card-img-top { aspect-ratio: 16 / 9; object-fit: cover; background: var(--gp-sand); }
.btn-outline-primary {
  --bs-btn-color: var(--gp-primary); --bs-btn-border-color: var(--gp-primary);
  --bs-btn-hover-bg: var(--gp-primary); --bs-btn-hover-border-color: var(--gp-primary);
  --bs-btn-active-bg: var(--gp-primary-dark); --bs-btn-active-border-color: var(--gp-primary-dark);
  font-weight: 600;
}

/* Umweltkarte */
.layer-panel .form-check { margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--gp-primary); border-color: var(--gp-primary); }
.form-check-input:focus { box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-range::-webkit-slider-thumb { background: var(--gp-primary); }
.form-range::-moz-range-thumb { background: var(--gp-primary); }
.map-card { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--gp-line); }
.map { height: 620px; background: #ECE8DE; }
@media (max-width: 991.98px) { .map { height: 440px; } }
.map-attr {
  position: absolute; left: .75rem; bottom: .75rem; padding: .2rem .5rem;
  background: rgba(255, 255, 255, .9); border-radius: 6px; font-size: .7rem;
}
.map-card .ol-attribution { display: none; }
.info-frame { width: 100%; height: 280px; border: 0; }

html.high-contrast .page-head { background: #fff; border-bottom: 2px solid #000; }
html.high-contrast .platzhalter { background: #fff; }

/* ---------- Kartendienst-Karten (Startseite) ---------- */
.service-tile .card-img-top { color: transparent; } /* Alt-Text nicht als Text über dem Bild zeigen */
.service-tile .img-missing { display: flex; align-items: center; justify-content: center; color: #9AA3A1; }
.service-tile .img-missing svg { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.service-tile { transition: border-color .15s ease; }
.service-tile:hover { border-color: var(--gp-primary); }

.meldung-banner {
  display: flex; align-items: center; gap: 1.25rem; padding: 1.25rem 1.5rem;
  background: var(--gp-paper); border: 1.5px dashed #BDB7A8; border-radius: 20px;
  color: var(--gp-ink); text-decoration: none;
}
.meldung-banner:hover { border-color: var(--gp-primary); color: var(--gp-ink); }
.meldung-icon {
  flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%;
  background: #fff; color: var(--gp-primary);
  display: flex; align-items: center; justify-content: center;
}
.meldung-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 575.98px) { .meldung-banner { flex-wrap: wrap; } }
html.high-contrast .service-tile, html.high-contrast .meldung-banner { border: 2px solid #000; }

/* ---------- Hero mit 3D-Foto ---------- */
.hero-photo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 30% 20%; /* Ausschnitt: Kirche oben bis Glaskuppel unten */
}
/* leichter Schleier rechts, damit die Karte ruhig sitzt */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(270deg, rgba(28, 36, 36, .35) 0%, rgba(28, 36, 36, .1) 45%, rgba(28, 36, 36, 0) 70%);
}
.hero > .container-xxl { z-index: 1; }
@media (min-width: 992px) {
  .hero-mapbtn { right: auto; left: 1.5rem; }
  .hero-caption {
    position: absolute; left: 1.5rem; bottom: 6.25rem;
    padding: .3rem .75rem; border-radius: 999px; font-size: .75rem;
    background: rgba(255, 255, 255, .85); color: var(--gp-ink); white-space: nowrap;
  }
}
@media (max-width: 991.98px) {
  .hero { background: var(--gp-sand); }
  .hero::after { display: none; }
  .hero-photo { position: relative; height: 240px; object-position: 35% 0%; }
  .hero > .container-xxl { margin-top: -3rem; }
  .hero-caption { display: none; }
  .hero-mapbtn { display: block; text-align: center; }
}
html.high-contrast .hero-photo { display: none; }

/* ---------- Kontaktkarte / Sprechzeiten ---------- */
.side-card address { font-style: normal; line-height: 1.5; }
.sprechzeiten { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; }
.sprechzeiten dt { font-weight: 500; }
.sprechzeiten dd { margin: 0; }
.prose .alert { border-radius: 14px; margin: 1.5rem 0; }
.prose ul li + li { margin-top: .6rem; }

/* ---------- Anleitung / Allgemeines ---------- */
.wege { display: grid; gap: 1rem; margin: 1.25rem 0 2rem; }
@media (min-width: 768px) { .wege { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.weg { background: #fff; border: 1px solid var(--gp-line); border-radius: 16px; padding: 1.25rem; font-size: .95rem; }
.weg h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.weg p { margin: 0; }
.screenshot { margin: 1.5rem 0; }
.screenshot img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--gp-line); background: var(--gp-sand); }
.screenshot figcaption { font-size: .85rem; color: #56605F; margin-top: .5rem; }
.planarten { margin: 1.25rem 0 0; }
.planarten dt { font-weight: 600; font-size: 1.1rem; margin-top: 1.5rem; }
.planarten dt:first-child { margin-top: 0; }
.planarten dt span { display: block; font-family: var(--gp-font-mono); font-size: .75rem; font-weight: 500; color: #56605F; margin-top: .15rem; }
.planarten dd { margin: .4rem 0 0; }

/* ---------- FNP / Downloads / Impressum ---------- */
.plan-figure a { display: block; }
.plan-figure img { transition: opacity .15s ease; }
.plan-figure a:hover img { opacity: .9; }
.download-link {
  display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem;
  border: 1px solid var(--gp-line); border-radius: 14px; text-decoration: none; color: var(--gp-ink);
}
.download-link:hover { border-color: var(--gp-primary); color: var(--gp-ink); }
.download-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--gp-primary); color: #fff; display: flex; align-items: center; justify-content: center;
}
.download-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prose address { font-style: normal; }
.nachweise dt { font-weight: 600; margin-top: 1rem; }
.nachweise dt:first-child { margin-top: 0; }
.nachweise dd { margin: .2rem 0 0; }

/* Stadt-Blau für die große Headline-Zeile */
.hero-title em.text-primary { color: var(--gp-brand) !important; }

/* ---------- Kartendienste mit Icons (Startseite) ---------- */
.themen-warm { background: #F3F0E9; }
.service-card-icon {
  border: 0; border-radius: 24px; background: #FFFDF9;
  box-shadow: 0 1px 2px rgba(28, 36, 36, .05), 0 6px 20px rgba(28, 36, 36, .05);
  transition: transform .15s ease, box-shadow .15s ease;
}
.service-card-icon .card-body { padding: 1.75rem; }
.service-card-icon:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(28, 36, 36, .06), 0 14px 32px rgba(28, 36, 36, .10); }
.service-card-icon:focus-within { outline: 3px solid var(--gp-primary); outline-offset: 3px; }
.svc-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: #E3F1F9; color: var(--gp-primary);
  display: flex; align-items: center; justify-content: center;
}
.svc-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.svc-link { font-weight: 600; text-decoration: none; }
.svc-link:focus-visible { outline: none; }
.themen-warm .meldung-banner { background: #FFFDF9; }
@media (prefers-reduced-motion: reduce) { .service-card-icon, .service-card-icon:hover { transition: none; transform: none; } }
html.high-contrast .themen-warm { background: #fff; }
html.high-contrast .service-card-icon { border: 2px solid #000; box-shadow: none; }

/* ---------- Meldungen ---------- */
.servicebar-melden {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--gp-primary); font-weight: 600; text-decoration: none;
}
.servicebar-melden:hover { color: var(--gp-primary-dark); text-decoration: underline; }
.meldung-card {
  display: flex; align-items: center; gap: 1.5rem; padding: 1.75rem;
  background: #FFFDF9; border-radius: 24px;
  box-shadow: 0 1px 2px rgba(28, 36, 36, .05), 0 6px 20px rgba(28, 36, 36, .05);
}
.meldung-card p { max-width: 40rem; }
@media (max-width: 767.98px) {
  .meldung-card { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
html.high-contrast .meldung-card { border: 2px solid #000; box-shadow: none; }

/* ---------- Melden-Button in der Kopfleiste ---------- */
.nav-melden, .nav-melden-mobil { display: inline-flex; align-items: center; gap: .4rem; }
.nav-melden-mobil { width: 44px; height: 44px; padding: 0; justify-content: center; }
.footer-login { opacity: .75; }

/* ---------- Themen-Tabs Umweltkarte ---------- */
.theme-tabs { display: flex; flex-wrap: wrap; gap: .75rem; }
.theme-tab {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; padding: .6rem 1.25rem;
  border: 1px solid var(--gp-line); border-radius: 999px; background: #fff;
  font: inherit; font-weight: 600; color: var(--gp-ink); cursor: pointer;
}
.theme-tab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-tab:hover { border-color: var(--gp-primary); }
.theme-tab.active { background: var(--gp-primary); border-color: var(--gp-primary); color: #fff; }
.theme-tab:focus-visible { outline: 3px solid var(--gp-primary); outline-offset: 2px; }
.theme-info .prose { max-width: 46rem; }
.layer-error .form-check-label { color: #B42318; }
.layer-error .form-check-label::after { content: " – lädt nicht"; font-size: .8em; }

/* ---------- Geodaten: Dienstverzeichnis ---------- */
.dienst-card {
  display: flex; align-items: center; gap: 1.25rem; margin: 1.5rem 0 2rem; padding: 1.5rem;
  background: #FFFDF9; border-radius: 24px; text-decoration: none; color: var(--gp-ink);
  box-shadow: 0 1px 2px rgba(28, 36, 36, .05), 0 6px 20px rgba(28, 36, 36, .06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dienst-card:hover { color: var(--gp-ink); transform: translateY(-2px); box-shadow: 0 2px 4px rgba(28, 36, 36, .06), 0 14px 32px rgba(28, 36, 36, .10); }
.dienst-card:focus-visible { outline: 3px solid var(--gp-primary); outline-offset: 3px; }
@media (max-width: 767.98px) { .dienst-card { flex-direction: column; align-items: flex-start; } }
.dienst-themen { display: grid; grid-template-columns: 9rem 1fr; gap: .75rem 1rem; margin: 1rem 0; }
.dienst-themen dt { font-weight: 600; padding-top: .3rem; }
.dienst-themen dd { margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 575.98px) { .dienst-themen { grid-template-columns: 1fr; gap: .25rem; } .dienst-themen dd { margin-bottom: .75rem; } }
.tag { padding: .25rem .7rem; border-radius: 999px; background: #E3F1F9; color: #0B4F79; font-size: .875rem; }
@media (prefers-reduced-motion: reduce) { .dienst-card, .dienst-card:hover { transition: none; transform: none; } }
html.high-contrast .tag { background: #fff; border: 1px solid #000; color: #000; }
.dienst-card .svc-icon, .meldung-card .svc-icon { flex-shrink: 0; }
