/* BSVZ Prototyp v2 – modernes dunkles/helles Design nach Vorlage, barrierearm */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-alt: #eef1f6;
  --text: #182233;
  --text-muted: #4b5768;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-contrast: #ffffff;
  --border: #dde3ec;
  --focus: #d97706;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
  --max-width: 1180px;
  --hero-overlay: linear-gradient(
    180deg,
    rgba(30, 41, 59, 0.25) 0%,
    rgba(20, 28, 45, 0.5) 55%,
    rgba(12, 17, 28, 0.78) 100%
  );
}

:root[data-theme="dark"] {
  --bg: #0b101a;
  --surface: #121927;
  --surface-alt: #1a2333;
  --text: #eef2f7;
  --text-muted: #a4afc1;
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --accent-contrast: #06101f;
  --border: #232c3d;
  --focus: #f59e0b;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --hero-overlay: linear-gradient(
    180deg,
    rgba(8, 13, 23, 0.55) 0%,
    rgba(8, 13, 23, 0.75) 55%,
    rgba(8, 13, 23, 0.95) 100%
  );
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b101a;
    --surface: #121927;
    --surface-alt: #1a2333;
    --text: #eef2f7;
    --text-muted: #a4afc1;
    --accent: #3b82f6;
    --accent-strong: #60a5fa;
    --accent-contrast: #06101f;
    --border: #232c3d;
    --focus: #f59e0b;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --hero-overlay: linear-gradient(
      180deg,
      rgba(8, 13, 23, 0.55) 0%,
      rgba(8, 13, 23, 0.75) 55%,
      rgba(8, 13, 23, 0.95) 100%
    );
  }
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, Verdana, Arial, sans-serif;
  line-height: 1.65;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

a {
  color: var(--accent);
}

a:focus,
button:focus,
input:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Header */

header.site-header {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-emblem {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.brand-text strong {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.desktop-nav {
  display: flex;
  flex: 1;
  justify-content: center;
}

.desktop-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.desktop-nav a {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.98rem;
}

.desktop-nav a:hover,
.desktop-nav a:focus {
  background: var(--surface-alt);
  color: var(--text);
}

/* Nav dropdowns (Verband, Ressorts, Dienste, Archiv sub-menus) */

.nav-dropdown {
  position: relative;
}

.desktop-nav .nav-dropdown > a::after {
  content: " \25BE";
  font-size: 0.7em;
}

.nav-dropdown-menu {
  list-style: none;
}

.desktop-nav .nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  margin: 0;
  padding: 0.9rem 0.5rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}

.desktop-nav .nav-dropdown:hover .nav-dropdown-menu,
.desktop-nav .nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

.desktop-nav .nav-dropdown-menu a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text);
}

.desktop-nav .nav-dropdown-menu a:hover,
.desktop-nav .nav-dropdown-menu a:focus {
  background: var(--surface-alt);
  color: var(--accent);
}

.mobile-nav .nav-dropdown-menu {
  display: block;
  margin: 0;
  padding: 0 0 0.4rem 1rem;
}

.mobile-nav .nav-dropdown-menu a {
  display: block;
  padding: 0.6rem 0.5rem;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  border-bottom: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.ghost {
  background: transparent;
}

.btn.on-hero {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn.on-hero:hover {
  background: rgba(255, 255, 255, 0.16);
}

.theme-toggle {
  min-width: 3rem;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0.6rem;
}

.nav-toggle {
  display: none;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
}

.mobile-nav a {
  display: block;
  padding: 0.85rem 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.mobile-nav-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Hero */

.hero {
  position: relative;
  color: #fff;
  padding: 5rem 1.25rem 6rem;
  background:
    var(--hero-overlay),
    linear-gradient(160deg, #2a3c56 0%, #0f1522 60%, #05070c 100%);
  overflow: hidden;
}

.hero.home-hero {
  background:
    var(--hero-overlay),
    url("../img/zuerich-limmat-sunset.jpg");
  background-size: cover;
  background-position: center 65%;
}

.hero-inner {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #cfe0ff;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.badge .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #60a5fa;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  line-height: 1.15;
}

.hero h1 .accent-line {
  display: block;
  color: #7db4ff;
}

.hero p {
  font-size: 1.15rem;
  max-width: 56ch;
  color: #dbe4f3;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.hero.page-hero {
  padding: 3rem 1.25rem;
}

.hero.page-hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
}

.hero.page-hero p {
  margin-bottom: 0;
}

.card > p:last-child {
  margin-bottom: 0;
}

/* Sections */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}

section + section {
  margin-top: 3.5rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.section-title h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.hub-tile {
  text-align: center;
  padding: 2rem 1.5rem;
}

.hub-tile .tile-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.75rem;
}

.hub-tile h3 {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.card:hover,
a.card:focus {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.vorstand-card {
  text-align: center;
}

.vorstand-photo {
  width: 96px;
  height: 122px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--surface-alt);
  margin: 0 auto 1rem;
  display: block;
  border: 3px solid var(--border);
}

.card .meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 480px;
}

.results-table caption {
  text-align: left;
  padding: 1rem 1.25rem;
  font-weight: 700;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}

.results-table th,
.results-table td {
  text-align: left;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.results-table th {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.results-table tr:last-child td {
  border-bottom: none;
}

/* CTA */

.cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta h2 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin: 0 0 0.75rem;
}

.cta h2 .accent-line {
  color: var(--accent);
  display: block;
}

.cta p {
  color: var(--text-muted);
  max-width: 55ch;
  margin: 0 auto 1.75rem;
  font-size: 1.05rem;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* Footer */

footer.site-footer {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  padding: 3rem 1.25rem 1.5rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-inner h4 {
  color: var(--text);
  margin: 0 0 0.9rem;
  font-size: 1rem;
}

.footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-inner a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-inner a:hover {
  color: var(--text);
}

.footer-brand p {
  font-size: 0.95rem;
  margin: 0.75rem 0 1rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.image-credit {
  max-width: var(--max-width);
  margin: 0.75rem auto 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.image-credit a {
  color: inherit;
}

/* Document / archive listings (Ressorts, Archiv, Pflichtenhefte) */

.discipline-block {
  margin-bottom: 2.75rem;
}

.discipline-block:last-child {
  margin-bottom: 0;
}

.discipline-block h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.discipline-block > .meta {
  margin-top: -0.4rem;
  margin-bottom: 1rem;
}

.doc-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.card h4 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.doc-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.6rem;
}

.doc-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.doc-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.doc-list a:hover,
.doc-list a:focus {
  text-decoration: underline;
}

.doc-ext {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
}

.empty-note,
.external-note {
  color: var(--text-muted);
  font-style: italic;
}

.jumplist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0;
  margin: 0 0 2.5rem;
  list-style: none;
}

.jumplist a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.jumplist a:hover,
.jumplist a:focus {
  color: var(--accent);
  border-color: var(--accent);
}

.jumplist a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Calendar */

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calendar-nav h3 {
  margin: 0;
  font-size: 1.3rem;
  text-align: center;
  min-width: 12ch;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.calendar-weekday {
  background: var(--surface-alt);
  padding: 0.6rem 0.25rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calendar-cell {
  background: var(--surface);
  min-height: 92px;
  min-width: 0;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.calendar-cell.other-month {
  background: var(--bg);
}

.calendar-cell.other-month .calendar-daynum {
  color: var(--text-muted);
}

.calendar-daynum {
  font-weight: 700;
  font-size: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.calendar-cell.today .calendar-daynum {
  background: var(--accent);
  color: #fff;
}

.calendar-event-pill {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.3;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .calendar-cell {
    min-height: 64px;
    padding: 0.25rem;
  }

  .calendar-weekday {
    font-size: 0.75rem;
    padding: 0.4rem 0.15rem;
  }

  .calendar-event-pill {
    font-size: 0.62rem;
  }
}

/* Forms */

.form-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-field {
  margin-bottom: 1.25rem;
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.form-field input,
.form-field select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.form-field .hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 560px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-message {
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  display: none;
}

.form-message.error {
  display: block;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #dc2626;
}

.form-message.success {
  display: block;
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.35);
  color: #16a34a;
}

.form-footer-note {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
}

.results-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.icon-btn {
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
}

.icon-btn:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .desktop-nav {
    display: none;
  }

  .desktop-only {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    padding: 3.5rem 1.25rem 4rem;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}
