/* =============================================================
   Stahlhofen am Wiesensee — Custom Theme auf Bootstrap 5.3
   ============================================================= */

:root {
  --sw-primary: #1f4d6b;         /* Wappen-Blau */
  --sw-primary-dark: #173a51;
  --sw-accent: #c9a227;          /* Gold aus dem Wappen */
  --sw-accent-dark: #a58216;
  --sw-surface: #f5f7f9;
  --sw-surface-alt: #eef2f6;
  --sw-text: #22303c;
  --sw-muted: #5a6b7a;
  --sw-border: #d7dfe6;
  --sw-danger: #b23a3a;
  --sw-success: #2e7a52;
  --sw-radius: 0.75rem;
  --sw-shadow: 0 2px 10px rgba(31, 77, 107, 0.08);
}

html { scroll-behavior: smooth; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--sw-text);
  background: var(--sw-surface);
  line-height: 1.55;
}

/* ---------- Überschriften ---------- */
h1, h2, h3, h4, h5, h6 { color: var(--sw-primary-dark); }
.section-title {
  font-size: 1.75rem; font-weight: 700;
  color: var(--sw-primary-dark);
  letter-spacing: -0.01em;
}

a { color: var(--sw-primary); text-decoration: none; }
a:hover { color: var(--sw-primary-dark); text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--sw-primary);
  box-shadow: var(--sw-shadow);
  position: relative; z-index: 10;
}
.site-brand { color: var(--sw-text); }
.site-brand-crest {
  /* SVG-Wappen: 719x817 → Seitenverhältnis ca. 0.88 (schmaler als hoch).
     Fixe Breite+Höhe in diesem Verhältnis; object-fit sichert, dass keine
     Verzerrung entsteht, falls der Browser anders rendert. */
  width: 44px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
  margin-right: 0.75rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.site-brand-text strong { font-size: 1.35rem; color: var(--sw-primary-dark); }
.site-brand-text small  { font-size: 0.78rem; }

.nav-main {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 0.25rem;
  border-top: 1px solid var(--sw-border);
  padding-top: 0.25rem;
}
.nav-main .nav-link {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--sw-text);
  border-radius: var(--sw-radius);
  transition: background-color 0.15s, color 0.15s;
}
.nav-main .nav-link:hover {
  background: var(--sw-surface-alt);
  color: var(--sw-primary-dark);
  text-decoration: none;
}
.nav-main .nav-link.active {
  background: var(--sw-primary);
  color: #fff;
}
.nav-main .nav-link .bi { margin-right: 0.25rem; }

/* ---------- Hero ---------- */
.site-hero {
  position: relative; isolation: isolate;
  min-height: 260px;
  background:
    linear-gradient(180deg, rgba(23,58,81,0.05), rgba(23,58,81,0.35)),
    var(--hero-img, linear-gradient(135deg, #1f4d6b 0%, #2b6ea0 100%))
    center / cover no-repeat;
  color: #fff;
  padding: 3rem 0 2.5rem;
  margin-bottom: 1.5rem;
}
.site-hero-tint {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.35));
  z-index: -1;
}
.site-hero-text {
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  position: relative;
}
.site-hero h1 { color: #fff; }

/* ---------- Tiles (Startseite) ---------- */
.tile {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius);
  color: var(--sw-text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  height: 100%;
  text-decoration: none;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sw-shadow);
  border-color: var(--sw-primary);
  text-decoration: none;
}
.tile i {
  font-size: 2rem;
  color: var(--sw-primary);
  flex-shrink: 0;
}
.tile strong { display: block; color: var(--sw-primary-dark); }
.tile small  { color: var(--sw-muted); }
.tile-primary { background: var(--sw-primary); color: #fff; border-color: var(--sw-primary-dark); }
.tile-primary i, .tile-primary strong, .tile-primary small { color: #fff; }
.tile-primary:hover { background: var(--sw-primary-dark); color: #fff; }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--sw-border);
  border-radius: var(--sw-radius);
}
.card-widget .card-title { color: var(--sw-primary-dark); }
.card-widget .card-title i { color: var(--sw-accent-dark); margin-right: 0.4rem; }

/* ---------- Artikel-Karten ---------- */
.article-card { overflow: hidden; transition: box-shadow 0.15s; }
.article-card:hover { box-shadow: var(--sw-shadow); }
.article-card .card-img-top {
  height: 200px;
  object-fit: cover;
  /* Bildausschnitt leicht nach oben verschieben (~30 % von oben), damit
     bei Gruppenfotos die Gesichter sichtbar bleiben. */
  object-position: center 30%;
  background: var(--sw-surface-alt);
}
/* Platzhalter-SVG hat sein Motiv zentral → zentriert belassen */
.article-card .card-img-top[data-placeholder] { object-position: center center; }

.article-row-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  min-height: 180px;
  background: var(--sw-surface-alt);
  border-top-left-radius: var(--sw-radius);
  border-bottom-left-radius: var(--sw-radius);
}
.article-row-img-placeholder { object-position: center center; }

@media (max-width: 767.98px) {
  .article-row-img {
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--sw-radius);
    max-height: 240px;
  }
}

/* ---------- Artikel-Detail: eingebettete Bilder ---------- */
.article-title {
  margin-bottom: 0.25rem;
}
.article-figure {
  margin: 1.25rem 0;
  /* Bild wird in nativer Breite gezeigt, maximal Content-Breite.
     object-fit nötig nur wenn CSS eine Höhe erzwingt — hier aber nicht. */
}
.article-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  /* Native Auflösung beibehalten, kein künstliches Stretching */
}
.article-figure figcaption {
  text-align: right;
  font-style: italic;
}

/* ---------- Redaktioneller Content ---------- */
.content-prose { font-size: 1.05rem; line-height: 1.65; }
.content-prose p, .content-prose ul, .content-prose ol { margin-bottom: 1rem; }
.content-prose img { max-width: 100%; height: auto; border-radius: var(--sw-radius); }
.content-prose blockquote {
  border-left: 3px solid var(--sw-accent);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--sw-muted);
  font-style: italic;
}

/* ---------- Abfallkalender ---------- */
.abfall-list .abfall-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--sw-border);
}
.abfall-list .abfall-item:last-child { border-bottom: 0; }
.abfall-icon {
  width: 36px; height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ---------- News-Liste ---------- */
.news-list .news-item {
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--sw-border);
}
.news-list .news-item:last-child { border-bottom: 0; }
.news-list .news-title { font-weight: 600; }

/* ---------- Link-Liste ---------- */
.link-list li { padding: 0.25rem 0; }
.link-list .bi { color: var(--sw-accent-dark); margin-right: 0.35rem; }

/* ---------- Webcam ---------- */
.webcam img {
  width: 100%; height: auto;
  max-height: 360px; object-fit: cover;
  background: var(--sw-surface-alt);
  border: 1px solid var(--sw-border);
}
.webcam img.webcam-error { opacity: 0.85; }

/* ---------- Wetter-Widget ---------- */
.wetter-widget { min-height: 6rem; }
.wetter-now {
  display: flex; align-items: center; gap: 0.75rem;
}
.wetter-icon {
  font-size: 2.6rem; color: var(--sw-accent-dark);
  flex-shrink: 0;
}
.wetter-temp { font-size: 2rem; font-weight: 600; }
.wetter-label { color: var(--sw-muted); font-size: 0.85rem; }
.wetter-forecast {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem; margin-top: 0.75rem;
}
.wetter-forecast-item {
  background: var(--sw-surface-alt);
  border-radius: var(--sw-radius);
  padding: 0.4rem 0.5rem;
  text-align: center;
  font-size: 0.85rem;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 2px solid var(--sw-border);
}
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 1rem;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sw-accent);
}
.timeline li strong { color: var(--sw-primary-dark); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sw-primary-dark);
  color: rgba(255, 255, 255, 0.92);
}
.site-footer h5 { color: #fff; }
.site-footer a { color: #ffecb3; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer hr { border-color: rgba(255, 255, 255, 0.2); opacity: 1; }

/* text-muted im Footer überschreiben, damit Text auf dunklem Grund lesbar bleibt */
.site-footer .text-muted { color: rgba(255, 255, 255, 0.78) !important; }
.site-footer .small,
.site-footer-copy {
  color: rgba(255, 255, 255, 0.85);
}
.site-footer-copy em {
  font-style: normal;
  font-weight: 600;
  color: #ffecb3;
}

/* ---------- Admin-Layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-shell .admin-nav {
  width: 240px;
  background: var(--sw-primary-dark);
  color: #fff;
  padding: 1rem 0.5rem;
  flex-shrink: 0;
}
.admin-shell .admin-nav a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: #fff;
  border-radius: var(--sw-radius);
}
.admin-shell .admin-nav a:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.admin-shell .admin-nav a.active { background: var(--sw-accent); color: var(--sw-primary-dark); }
.admin-shell .admin-main {
  flex-grow: 1;
  padding: 1.5rem 1.75rem;
  background: var(--sw-surface);
}
@media (max-width: 767.98px) {
  .admin-shell { flex-direction: column; }
  .admin-shell .admin-nav { width: 100%; padding: 0.5rem; display: flex; flex-wrap: wrap; }
  .admin-shell .admin-nav a { flex: 0 0 auto; }
}

/* Login-Box */
.login-box {
  max-width: 420px; margin: 4rem auto;
  background: #fff;
  padding: 2rem 2rem 1.5rem;
  border-radius: var(--sw-radius);
  box-shadow: var(--sw-shadow);
}

/* ---------- Kleinigkeiten ---------- */
address { font-style: normal; }
.text-reset:hover { color: var(--sw-primary-dark) !important; }
.alert { border-radius: var(--sw-radius); }
.btn { border-radius: var(--sw-radius); }

/* Visuelle Verbesserung: interne Fokus-Ringe */
:focus-visible {
  outline: 3px solid rgba(201, 162, 39, 0.55);
  outline-offset: 2px;
}

/* ---------- Click-to-Load-Consent für externe Embeds ---------- */
.embed-consent {
  background: var(--sw-surface-alt);
  border: 2px dashed var(--sw-primary);
  border-radius: var(--sw-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.embed-consent-inner > * {
  margin-bottom: 0.75rem;
}
.embed-consent-inner > *:last-child {
  margin-bottom: 0;
}
.embed-consent .btn { margin-right: 0.5rem; }
.embed-consent p strong { color: var(--sw-primary-dark); }
