/* ================= RESET ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================= BODY ================= */
body {
  font-family: system-ui, -apple-system, Arial, sans-serif;
  background: #f4f6f8;
  color: #333;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Footer bleibt auch bei kurzen Seiten unten */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ================= HERO ================= */
.hero {
  background: linear-gradient(135deg, #003b7a, #005fb8);
  color: #fff;
  text-align: center;
  padding: 30px 20px 80px;
}

/* ================= HEADER ================= */
.header {
  position: relative;
  padding: 15px;
}

.logo {
  font-weight: 600;
  line-height: 1.5;
  font-size: 0.95rem;
}

/* ================= NAV ================= */
.nav {
  display: flex;
  flex-wrap: wrap;            /* NEU: bricht bei mittleren Breiten sauber um */
  justify-content: center;
  gap: 10px 25px;
  margin-top: 15px;
}

.nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

/* Hover Linie */
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: #fff;
  transition: 0.3s;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {   /* NEU: aktuelle Seite markiert */
  width: 100%;
}

/* ================= HAMBURGER ================= */
.hamburger {
  display: none;
  position: absolute;
  right: 15px;
  top: 15px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: #fff;
  margin: 6px 0;
  border-radius: 3px;
  transition: 0.3s;
}

/* Animation */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ================= HERO CONTENT ================= */
.hero img {
  max-width: 160px;
  margin: 25px auto;
  display: block;
}

.hero h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero p {
  opacity: 0.9;
}

/* ================= MAIN ================= */
main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 18px;
}

h2 {
  margin-bottom: 20px;
  font-size: 1.6rem;
}

/* ================= NEWS ================= */

.news-grid {
  display: grid;
  gap: 30px;
}

/* CARD */
.news-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e6e6e6;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
  transition: 0.3s ease;
}

/* Hover nur auf Geräten mit Maus (am Handy bleibt sonst der Effekt "hängen") */
@media (hover: hover) {
  .news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.15);
  }
}

/* Farbiger Kopf ohne Bild (z.B. Ruhestand ≠ Stillstand) */
.news-head {
  padding: 24px;
  background: #003b7a;
  color: #fff;
}

.news-head h3 {
  margin: 0;
  color: #fff;
  font-size: 1.65rem;
  line-height: 1.25;
}

/* ================= IMAGE SYSTEM ================= */

.news-image {
  width: 100%;
  background: #f2f2f2;
  border-bottom: 1px solid #eee;
  overflow: hidden;
}

/* Bilder behalten ihr echtes Format */
.news-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

/* Zoom nur bei verlinkten Bildern */
.news-image a:hover img {
  transform: scale(1.02);
}

/* Vom Script gesetzt: Hochformat und kleine Bilder nicht riesig aufblasen */
.news-image.portrait img,
.news-image.special img {
  width: auto;
  max-width: 100%;
  max-height: 520px;
  margin: 0 auto;
}

/* CONTENT */
.news-content {
  padding: 22px 20px 24px;
}

.news-content time {
  font-size: 0.85rem;
  color: #666;
  display: block;
  margin-bottom: 6px;
}

.news-content h3 {
  margin-bottom: 14px;
  font-size: 1.25rem;
  color: #003b7a;
  line-height: 1.3;
}

.news-content p,
.news-content ul {
  color: #444;
  margin-bottom: 16px;
}

.news-content ul {
  list-style: none;
}

.news-content > :last-child {
  margin-bottom: 0;
}

/* LINKS */
.news-content a,
.news-archive a {
  color: #005fb8;
  text-decoration: none;
  font-weight: 500;
}

.news-content a:hover,
.news-archive a:hover {
  text-decoration: underline;
}

/* BUTTON (höhere Spezifität, sonst wird die Schrift blau auf blau) */
.news-content a.read-more {
  display: inline-block;
  padding: 10px 18px;
  background: #003b7a;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.3s ease;
}

.news-content a.read-more:hover {
  background: #0055a5;
  text-decoration: none;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

/* ================= ARCHIV (aufklappbar) ================= */

.news-archive {
  border-top: 1px solid #eee;
  padding: 0 20px;
}

.news-archive summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 600;
  color: #003b7a;
}

.news-archive[open] {
  padding-bottom: 20px;
}

.news-archive h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.news-archive p {
  margin-bottom: 14px;
  color: #444;
}

.news-archive hr {
  border: none;
  height: 1px;
  background: #ddd;
  margin: 20px 0;
}

.news-note {
  font-size: 0.85rem;
  color: #666;
}

/* ================= GALERIE ================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.gallery-grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.gallery-grid img:hover {
  transform: scale(1.05);
}

/* ================= LIGHTBOX ================= */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}

.lightbox.active {
  display: flex;
}

/* ================= SCROLL ================= */

.fade-in {
  opacity: 0;
  transform: translateY(25px);
  transition: 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================= FOOTER ================= */

.footer {
  background: #1f1f1f;
  color: #fff;
  text-align: center;
  padding: 25px;
  margin-top: 50px;
  font-size: 0.9rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-bottom: 10px;
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {

  /* NEU: Hamburger bleibt beim Scrollen oben rechts sichtbar */
  .hamburger {
    display: block;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    padding: 4px 8px;
    background: rgba(0, 59, 122, 0.92);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  /* Platz für den Button, damit der Logo-Text nicht darunter liegt */
  .header {
    padding: 15px 56px;
  }

  /* NEU: Seite dahinter sperren, solange das Menü offen ist */
  html.menu-open,
  html.menu-open body {
    overflow: hidden;
  }

  .nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: #003366;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding-top: 90px;
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 999;              /* NEU: Menü liegt über dem Text im Kopfbereich */
    transform: translateX(100%);
    visibility: hidden;         /* NEU: verstecktes Menü nicht per Tastatur erreichbar */
    transition: transform 0.3s ease, visibility 0.3s;
  }

  .nav.active {
    transform: translateX(0);
    visibility: visible;
  }

  .nav a {
    padding: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }

  .nav a::after {
    display: none;
  }

  .news-head h3 {
    font-size: 1.4rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================= EVENT-KARTE ================= */

.news-card.event h4 {
  margin-top: 5px;
  color: #003a8f;
  font-weight: normal;
}

/* ================= UNTERSEITEN (v7) ================= */

/* Kleinerer Kopfbereich auf Unterseiten */
.hero-small {
  padding-bottom: 50px;
}

.hero-small h1 {
  margin-top: 25px;
}

/* Einleitungstext unter einer Überschrift */
.page-intro {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 30px;
  color: #555;
}

main > h2 {
  text-align: center;
}

/* Allgemeiner Button (außerhalb von News-Karten) */
.button {
  display: inline-block;
  padding: 10px 18px;
  background: #003b7a;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.3s ease;
}

.button:hover {
  background: #0055a5;
}

.back-link {
  text-align: center;
  margin: 30px 0;
}

/* Textseiten: Impressum, Datenschutz, Kontakt, Geschichte */
.text-page {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

.text-page + .text-page {
  margin-top: 24px;
}

.text-page section + section {
  margin-top: 28px;
}

.text-page h2 {
  font-size: 1.25rem;
  color: #003b7a;
  margin-bottom: 10px;
}

.text-page p,
.text-page ul {
  margin-bottom: 12px;
}

.text-page ul {
  padding-left: 20px;
}

.text-page a {
  color: #005fb8;
}

.text-page .button {
  color: #fff;
}

.text-page img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  margin-top: 16px;
}

/* Kontakt: zwei Kästen nebeneinander (Desktop) */
.contact-grid {
  display: grid;
  gap: 24px;
}

.contact-grid .text-page + .text-page {
  margin-top: 0;
}

@media (min-width: 769px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Geschichte: Zeitleiste */
.timeline {
  list-style: none;
  border-left: 3px solid #003b7a;
  margin: 10px 0 10px 8px;
  padding-left: 24px;
}

.timeline li {
  position: relative;
  margin-bottom: 18px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #003b7a;
}

.timeline .year {
  display: block;
  font-weight: 700;
  color: #003b7a;
}

.timeline li.highlight {
  background: #eaf2fb;
  padding: 12px 14px;
  border-radius: 10px;
}

.timeline li.highlight::before {
  top: 18px;
  left: -33px;
}

/* Galerieseiten */
.gallery-section {
  margin-top: 10px;
}

/* Name nicht am Bindestrich umbrechen */
.nowrap {
  white-space: nowrap;
}

/* Kleinere Hauptüberschrift auf schmalen Handys */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.55rem;
  }
}

/* ================= BARRIEREFREIHEIT ================= */

/* Skip-Link: unsichtbar, bis er per Tab-Taste Fokus bekommt */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #003b7a;
  color: #fff;
  padding: 10px 16px;
  z-index: 3000;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

/* Sichtbarer Fokus-Ring für Tastatur-Nutzer
   (Maus-Nutzer sehen ihn nicht – nur wer mit Tab navigiert) */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #ffcc00;
  outline-offset: 3px;
}

/* Sprungziel des Skip-Links: kein Rahmen um den ganzen Inhalt */
main:focus {
  outline: none;
}
