/* ============================================================
   frame.css — gemeinsamer Seitenrahmen der Hauptseite im Kommunen-Look
   (Phase 2 des Umzugs, 16.09.2026). Die Kommunen-Seiten laden seit heute
   inc/header.php + inc/footer.php der Hauptseite (Theme „kommunen"); dieses
   Stylesheet gibt dem geteilten Markup (.navbar, .navbar-menu, .breadcrumbs,
   .footer, .skip-to-main) die Kommunen-Farbwelt – bei EXAKT der Geometrie
   der Hauptseite (fixe Leiste, Logo 80×80, Menüabstand 2rem, dieselben
   Umbruchstufen 1720/1500/1280/1100 px). Farben/Variablen aus style.css.
   ============================================================ */

/* Platz für die fixe Leiste (1rem + 1rem + 80px Logo + 1rem + 1rem = 144 px, seit 26.09. wie www) und die Brotkrumen-Leiste (38 px) */
.theme-kommunen main { padding-top: 146px; }
.theme-kommunen.has-crumbs main { padding-top: 184px; }
.theme-kommunen main:focus, .theme-kommunen main:focus-visible { outline: none; }

/* ---------- Kopfleiste ---------- */
.theme-kommunen .navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0; /* 26.09.2026: wie www (.navbar 1rem + .navbar-main 1rem) -> Leiste 182 px mit Brotkrumen */
}
.theme-kommunen .navbar-main { padding: .5rem 0; } /* 26.09.: .5rem statt 1rem, damit Logo 80 px + Badge (96 px) dieselbe Leistenhöhe ergeben wie www (112 px) */
.theme-kommunen .navbar .container,
.theme-kommunen .footer .container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.theme-kommunen .navbar .container { display: flex; justify-content: space-between; align-items: center; }
/* 26.09.2026 (Wunsch Martin, Welle 6): Marke optisch wie die Hauptseite — Block 80 x 80 px, Logo 62 px,
   Badge „FÜR KOMMUNEN" darunter in Logobreite (Hausstil wie in den Kommunen-Dokumenten) */
.theme-kommunen .navbar-brand {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  flex-shrink: 0; width: 80px; height: 96px; color: var(--ink); text-decoration: none; /* Logo 80 px wie www + Badge 12 px */
}
.theme-kommunen .navbar-brand:hover { text-decoration: none; }
.theme-kommunen .navbar-brand img { width: 80px; height: 80px; aspect-ratio: 1 / 1; }
.theme-kommunen .navbar-badge {
  font-size: .47rem; line-height: 1.2; font-weight: 700; color: var(--primary);
  border: 1px solid var(--primary-border); background: var(--primary-tint);
  padding: .05rem .3rem; border-radius: 999px; letter-spacing: .03em; max-width: 80px; overflow: hidden;
  white-space: nowrap; text-transform: uppercase;
}

/* Menü */
.theme-kommunen .navbar-menu { display: flex; list-style: none; gap: 2rem; align-items: center; margin: 0; padding: 0; }
.theme-kommunen .navbar-menu li { margin: 0; }
.theme-kommunen .navbar-menu a {
  color: var(--body); font-weight: 500; position: relative; text-decoration: none;
  white-space: nowrap; transition: color .3s;
}
.theme-kommunen .navbar-menu a:hover,
.theme-kommunen .navbar-menu a[aria-current="page"],
.theme-kommunen .navbar-menu .nav-parent-active > a { color: var(--primary); }
.theme-kommunen .navbar-menu > li > a::after {
  content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px;
  background: var(--primary); transition: width .3s ease;
}
.theme-kommunen .navbar-menu > li > a:hover::after,
.theme-kommunen .navbar-menu > li > a[aria-current="page"]::after { width: 100%; }
.theme-kommunen .navbar-menu a.btn-primary {
  display: inline-block; padding: .75rem 1.5rem; border-radius: .5rem; line-height: 1.6; /* 26.09.: 50 px hoch wie www */
  background: var(--primary); color: #fff; font-weight: 600; border: 0;
}
.theme-kommunen .navbar-menu a.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.theme-kommunen .navbar-menu > li > a.btn-primary::after { display: none; }

/* Klappe „Leistungen" (Markup wie bisher: .nav-item-sub > a + ul.nav-sub) */
.theme-kommunen .navbar-menu .nav-item-sub { position: relative; }
.theme-kommunen .navbar-menu .nav-item-sub > a .caret {
  font-size: .7em; margin-left: .3rem; display: inline-block; transition: transform .2s;
}
.theme-kommunen .navbar-menu .nav-sub {
  list-style: none; margin: 0; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-md);
  padding: .45rem; min-width: 260px; display: none; z-index: 1001;
}
.theme-kommunen .navbar-menu .nav-sub::before { content: ''; position: absolute; top: -12px; left: 0; right: 0; height: 12px; }
.theme-kommunen .navbar-menu .nav-item-sub:hover > .nav-sub,
.theme-kommunen .navbar-menu .nav-item-sub:focus-within > .nav-sub { display: block; }
.theme-kommunen .navbar-menu .nav-item-sub:hover > a .caret,
.theme-kommunen .navbar-menu .nav-item-sub:focus-within > a .caret { transform: rotate(180deg); }
.theme-kommunen .navbar-menu .nav-sub a {
  display: block; padding: .6rem .85rem; border-radius: 8px; font-size: .95rem; white-space: nowrap;
}
.theme-kommunen .navbar-menu .nav-sub a::after { display: none; }
.theme-kommunen .navbar-menu .nav-sub a:hover { background: var(--primary-tint); color: var(--primary-dark); }
.theme-kommunen .navbar-menu .nav-sub a[aria-current="page"] { color: var(--primary); font-weight: 600; }

/* Hamburger (44×44-Zielfläche wie Hauptseite) */
.theme-kommunen .navbar-toggle {
  display: none; flex-direction: column; gap: 4px; cursor: pointer;
  background: none; border: 0; padding: 13px 9px; min-width: 44px; min-height: 44px;
  align-items: center; justify-content: center;
}
.theme-kommunen .navbar-toggle span {
  display: block; width: 25px; height: 3px; background: var(--ink);
  transition: transform .3s ease, opacity .3s ease, background-color .3s ease;
}
.theme-kommunen .navbar-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.theme-kommunen .navbar-toggle.active span:nth-child(2) { opacity: 0; }
.theme-kommunen .navbar-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

/* Brotkrumen (in der fixen Leiste, wie Hauptseite) */
.theme-kommunen .navbar-breadcrumbs { background: var(--bg-soft); padding: .5rem 0; border-top: 1px solid var(--line-2); }
.theme-kommunen .breadcrumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .8125rem; color: var(--muted);
}
.theme-kommunen .breadcrumbs a { color: var(--muted); text-decoration: none; transition: color .3s; }
.theme-kommunen .breadcrumbs a:hover { color: var(--primary); }
.theme-kommunen .breadcrumbs span { color: var(--primary); font-weight: 500; }
.theme-kommunen .breadcrumbs i.fa-chevron-right { font-size: .65rem; color: var(--line); }

/* Stufen der Hauptseite (Nav-Entzerrung 19.08.2026), unverändert übernommen */
/* 26.09.2026: Abstand 2rem wie die Hauptseite auf allen Desktop-Breiten (gemessen www 1280–1920 px = 32 px); nur die Schrift stuft wie dort */
@media (min-width: 769px) and (max-width: 1500px) {
  .theme-kommunen .navbar-menu a { font-size: .92rem; }
}
@media (min-width: 769px) and (max-width: 1280px) {
  .theme-kommunen .navbar-menu a { font-size: .85rem; }
}
@media (max-width: 1100px) {
  .theme-kommunen .navbar-menu {
    position: fixed; top: 144px; left: -100%; width: 80%; max-width: 300px;
    height: calc(100vh - 144px); overflow-y: auto;
    background: var(--bg); border-right: 1px solid var(--line);
    flex-direction: column; padding: 2rem; gap: 1rem; align-items: flex-start;
    visibility: hidden; transition: left .3s, visibility 0s .3s;
  }
  .theme-kommunen .navbar-menu.active { left: 0; visibility: visible; transition: left .3s, visibility 0s; }
  .theme-kommunen .navbar-toggle { display: flex; }
  .theme-kommunen .navbar-menu .nav-sub {
    position: static; transform: none; display: block; box-shadow: none; border: 0;
    padding: .2rem 0 0 1rem; min-width: 0;
  }
  .theme-kommunen .navbar-menu .nav-item-sub > a .caret { display: none; }
  .theme-kommunen .navbar-menu .nav-sub a { white-space: normal; }
  .theme-kommunen .navbar-badge { display: none; }
  .theme-kommunen .navbar-brand { height: 80px; }
  .theme-kommunen .navbar-main { padding: 1rem 0; } /* ohne Badge wieder 1rem wie www */
}
@media (max-width: 480px) {
  .theme-kommunen .navbar-brand img { width: 64px; height: 64px; }
  .theme-kommunen .navbar-brand { height: 64px; } /* 26.09.: Markenblock mit dem Logo schrumpfen -> Leiste 128 px */
  .theme-kommunen main { padding-top: 128px; }
  .theme-kommunen.has-crumbs main { padding-top: 168px; }
  .theme-kommunen .navbar-menu { top: 128px; height: calc(100vh - 128px); }
}

/* Coming-Soon-Adminbalken der Hauptseite verschiebt die Leiste um 40 px */
.theme-kommunen.wartung-admin main { padding-top: 154px; }
.theme-kommunen.wartung-admin.has-crumbs main { padding-top: 192px; }

/* ---------- Skip-Link + Screenreader ---------- */
.theme-kommunen .skip-to-main { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; z-index: 10000; }
.theme-kommunen .skip-to-main:focus {
  left: 1rem; top: 1rem; width: auto; height: auto; overflow: visible;
  padding: .75rem 1.25rem; background: var(--primary); color: #fff;
  border: 3px solid #fff; border-radius: .5rem; font-weight: 600;
  box-shadow: 0 0 0 6px rgba(168,77,14,.55);
}
.theme-kommunen .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Fußzeile (Aufbau der Hauptseite, Kommunen-Farben) ---------- */
.theme-kommunen .footer {
  background: var(--bg-soft); border-top: 1px solid var(--line);
  padding: 4rem 0 2rem; color: var(--body);
}
.theme-kommunen .footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem; margin-bottom: 3rem;
}
.theme-kommunen .footer-heading { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; color: var(--ink); line-height: 1.2; }
.theme-kommunen .footer p { color: var(--body); }
.theme-kommunen .footer ul { list-style: none; margin: 0; padding: 0; }
.theme-kommunen .footer ul li { margin-bottom: .5rem; }
.theme-kommunen .footer a { color: var(--body); transition: color .2s; }
.theme-kommunen .footer a:hover { color: var(--primary); }
.theme-kommunen .footer .brand { display: inline; margin: 0; color: var(--primary); }
.theme-kommunen .footer .reg { font-size: .6em; vertical-align: super; }
.theme-kommunen .footer-bottom {
  text-align: center; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted);
}
.theme-kommunen .footer-bottom p { color: var(--muted); margin: 0; }
.theme-kommunen .footer-social { color: var(--muted); font-size: 1.25rem; transition: color .2s; display: inline-flex; }
.theme-kommunen .footer-social:hover, .theme-kommunen .footer-social:focus-visible { color: var(--primary); }
.theme-kommunen .footer-siegel img { opacity: .9; transition: opacity .2s; }
.theme-kommunen .footer-siegel:hover img { opacity: 1; }
.theme-kommunen .text-primary { color: var(--primary); }
.theme-kommunen .footer i.fas { width: 1.2em; text-align: center; margin-right: .25rem; }
@media (max-width: 768px) { .theme-kommunen .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 520px) { .theme-kommunen .footer-grid { grid-template-columns: 1fr; } }
/* 26.09.2026 (ACQ-01, Welle 6): Kundenlogin als kleiner Servicelink rechts neben der Hauptaktion */
.theme-kommunen .navbar-menu .nav-service a { font-size: .9rem; opacity: .85; }
