/* Genossenschaft Wasserversorgung Adligenswil
   Farben aus dem Logo. Schrift: Systemschriften, bis die Web-Lizenz für Koblenz Serial vorliegt. */
:root {
  --blau: #24346a;
  --blau-dunkel: #18244c;
  --welle: #0e599c;
  --hell: #f2f5fa;
  --linie: #d9e0ec;
  --text: #1c2233;
  --text-2: #4d566b;
  --weiss: #fff;
  --notfall: #c8102e;
  --radius: 16px;
  --titel: "Avenir Next", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --lauf: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--weiss); color: var(--text); font: 400 1.0625rem/1.65 var(--lauf); }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--welle); }
a:hover { color: var(--blau); }
:focus-visible { outline: 3px solid var(--welle); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--titel); color: var(--blau); line-height: 1.2; font-weight: 600; margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--blau); color: var(--weiss); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 8px; color: var(--weiss); }

/* Notruf-Leiste und Kopfzeile */
.topbar { background: var(--blau-dunkel); color: var(--weiss); font-size: .9rem; padding: 6px 0; text-align: right; }
.topbar a { color: var(--weiss); font-weight: 700; white-space: nowrap; }
.header { position: sticky; top: 0; z-index: 20; background: var(--weiss); border-bottom: 1px solid var(--linie); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.logo img { width: clamp(200px, 22vw, 270px); height: auto; }
.nav { display: flex; gap: clamp(14px, 2vw, 30px); }
.nav a { font-family: var(--titel); font-weight: 600; color: var(--blau); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { border-bottom-color: var(--welle); color: var(--blau); }
.nav .nav-notfall { color: var(--notfall); }
.nav .nav-notfall:hover, .nav .nav-notfall[aria-current] { color: var(--notfall); border-bottom-color: var(--notfall); }
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nav-label { display: none; }

/* Titelbild */
.hero-section { padding: clamp(16px, 2.5vw, 32px) 0 0; }
.hero { position: relative; overflow: hidden; border-radius: var(--radius); height: clamp(460px, 56vw, 720px); background: var(--blau); }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(24, 36, 76, .78) 0%, rgba(24, 36, 76, .45) 32%, rgba(24, 36, 76, 0) 58%); }
.hero-text { position: absolute; z-index: 1; left: clamp(20px, 4.5vw, 64px); top: clamp(24px, 5vw, 72px); max-width: min(46%, 560px); }
.hero h1 { color: var(--weiss); font-size: clamp(2.1rem, 4.6vw, 4rem); line-height: 1.08; }
.hero h1 small { display: block; font-size: .45em; font-weight: 500; letter-spacing: .01em; margin-bottom: .45em; }

/* Kacheln */
.section { padding: clamp(44px, 6vw, 84px) 0; }
.section-soft { background: var(--hell); }
.tiles-section { padding-top: clamp(16px, 2.5vw, 32px); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.5vw, 32px); }
.tile { position: relative; display: block; overflow: hidden; aspect-ratio: 10 / 7; border-radius: var(--radius); background: var(--blau); color: var(--weiss); text-decoration: none; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(24, 36, 76, .88) 0%, rgba(24, 36, 76, .35) 38%, rgba(24, 36, 76, 0) 62%); }
.tile:hover { color: var(--weiss); }
.tile:hover img { transform: scale(1.04); }
.tile-text { position: absolute; z-index: 1; left: clamp(18px, 3vw, 36px); right: clamp(18px, 3vw, 36px); bottom: clamp(16px, 2.6vw, 32px); }
.tile-text strong { display: block; font: 600 clamp(1.7rem, 3.2vw, 2.6rem)/1.1 var(--titel); margin-bottom: .2em; }
.tile-text strong::after { content: " →"; font-weight: 400; }
.tile-text span { display: block; font-size: clamp(.98rem, 1.4vw, 1.12rem); }
.tile-notfall::after { background: linear-gradient(to top, rgba(24, 36, 76, .85) 0%, rgba(24, 36, 76, .25) 26%, rgba(24, 36, 76, 0) 42%); }
.tile-notfall img { object-position: 50% 20%; }
.tile-notfall strong { display: inline-block; background: var(--notfall); padding: .12em .45em .16em; border-radius: 10px; margin-bottom: .3em; }

/* Aktuelles */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.more { font-family: var(--titel); font-weight: 600; text-decoration: none; }
.more::after { content: " →"; }
.back::before { content: "← "; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.2vw, 28px); }
.card { display: flex; flex-direction: column; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none; transition: box-shadow .2s, transform .2s; }
.card:hover { color: var(--text); box-shadow: 0 10px 30px rgba(24, 36, 76, .14); transform: translateY(-2px); }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card > div { padding: 20px 22px 24px; }
.card time { font-size: .9rem; color: var(--text-2); }
.card h3 { margin: 4px 0 8px; }
.card p { margin: 0; color: var(--text-2); }

/* Kontakt */
.anchor { scroll-margin-top: 84px; }
.contact { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 44px); margin-top: 28px; }
.contact h3 { margin-bottom: 10px; }
.contact p { margin: 0 0 12px; }
.contact-notruf { border-left: 4px solid var(--notfall); padding-left: 22px; }
.contact-notruf h3 { color: var(--notfall); }
.big { font: 700 clamp(1.7rem, 2.6vw, 2.1rem)/1.2 var(--titel); }
.big a { color: var(--notfall); text-decoration: none; white-space: nowrap; }

/* Unterseiten */
.page-head { background: var(--blau); color: var(--weiss); padding: clamp(40px, 6vw, 80px) 0; }
.page-head h1 { color: var(--weiss); font-size: clamp(2.2rem, 5vw, 3.6rem); max-width: 22ch; }
.page-head .lead { margin: 14px 0 0; max-width: 62ch; font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
.prose > * { max-width: 820px; }
.prose h2 { margin: 1.6em 0 .5em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.4em 0 .3em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.side-img { margin: 0; position: sticky; top: 108px; }
.side-img img { border-radius: var(--radius); width: 100%; }
.callout { background: var(--notfall); color: var(--weiss); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 8px; }
.callout span { display: block; font-weight: 600; }
.callout a { display: inline-block; color: var(--weiss); font: 700 clamp(2rem, 4vw, 2.8rem)/1.2 var(--titel); text-decoration: none; white-space: nowrap; margin: 2px 0 6px; }
.callout p { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(16px, 2.2vw, 28px); list-style: none; padding: 0; margin: 0; }
.facts li { border-top: 3px solid var(--welle); padding-top: 14px; }
.facts strong { display: block; font: 600 clamp(2.2rem, 4vw, 3.2rem)/1.1 var(--titel); color: var(--blau); margin-bottom: 6px; }
.facts span { color: var(--text-2); }
.prose .docs { list-style: none; padding: 0; margin: 0 0 1.2em; }
.doc { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px; text-decoration: none; font-weight: 600; }
.doc small { font-weight: 400; color: var(--text-2); }
.doc:hover { border-color: var(--welle); }
.todo { background: #fff6da; border-left: 4px solid #d8a400; padding: 10px 14px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.6vw, 20px); }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
#organisation { margin-bottom: 8px; }
.wrap > h3 { margin: 32px 0 16px; }
.intro { max-width: 70ch; margin: -6px 0 18px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px 20px; list-style: none; padding: 0; margin: 0; }
.person img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.person strong { display: block; font-family: var(--titel); color: var(--blau); font-size: 1.08rem; }
.person span { color: var(--text-2); font-size: .96rem; display: block; line-height: 1.4; }
.prose .timeline { list-style: none; padding: 0; margin: 1.2em 0 1.4em; border-left: 3px solid var(--linie); }
.timeline li { padding: 0 0 14px 20px; display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.timeline strong { font-family: var(--titel); color: var(--blau); }

/* Notfallmeldung auf der Startseite: erscheint nur bei einem aktiven Notfall */
.alert { background: var(--notfall); color: var(--weiss); padding: clamp(20px, 3vw, 34px) 0; }
.alert strong { display: block; font: 700 clamp(1.5rem, 3vw, 2.3rem)/1.2 var(--titel); margin-bottom: .35em; }
.alert p { margin: 0 0 .6em; max-width: 75ch; font-size: clamp(1.02rem, 1.5vw, 1.2rem); }
.alert .alert-meta { margin: 0; font-size: .95rem; }
.alert a { color: var(--weiss); font-weight: 700; }

/* Geschützte Eingabe der Notfallmeldung */
.admin-wrap { max-width: 760px; }
.admin h2 { margin: 1.6em 0 .5em; }
.admin-form { display: grid; gap: 16px; }
.admin-form label { display: grid; gap: 6px; font-weight: 600; color: var(--blau); }
.admin-form input, .admin-form textarea { font: inherit; width: 100%; padding: 12px 14px; border: 1px solid #8592ab; border-radius: 8px; color: var(--text); }
.admin button { font: 600 1rem var(--titel); padding: 13px 22px; border: 0; border-radius: 8px; background: var(--blau); color: var(--weiss); cursor: pointer; justify-self: start; }
.admin button.danger { background: var(--notfall); }
.admin button.plain { background: var(--hell); color: var(--blau); border: 1px solid var(--linie); }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.admin-actions .check { flex-basis: 100%; }
.admin-preview { border-radius: 10px; overflow: hidden; }
.admin-ok { background: #e6f4ea; border-left: 4px solid #1e7a3c; padding: 10px 14px; }
.admin-err { background: #fde8ea; border-left: 4px solid var(--notfall); padding: 10px 14px; }
.admin-log { list-style: none; padding: 0; color: var(--text-2); font-size: .92rem; }

/* Fusszeile */
.footer { background: var(--blau); color: var(--weiss); padding: 40px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 36px; }
.footer img { width: 250px; height: auto; background: var(--weiss); padding: 12px 16px; border-radius: 10px; }
.footer p { margin: 0; }
.footer nav { display: flex; gap: 22px; }
.footer a { color: var(--weiss); }

/* Tablet und Smartphone */
@media (max-width: 960px) {
  .nav-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font: 600 1rem var(--titel); color: var(--blau); padding: 8px 0; }
  .nav-label i, .nav-label i::before, .nav-label i::after { display: block; width: 24px; height: 2px; background: var(--blau); }
  .nav-label i { position: relative; }
  .nav-label i::before, .nav-label i::after { content: ""; position: absolute; left: 0; }
  .nav-label i::before { top: -7px; }
  .nav-label i::after { top: 7px; }
  .nav-toggle:focus-visible + .nav-label { outline: 3px solid var(--welle); outline-offset: 3px; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; gap: 0; background: var(--weiss); border-bottom: 1px solid var(--linie); padding: 6px clamp(16px, 3vw, 32px) 14px; box-shadow: 0 12px 24px rgba(24, 36, 76, .12); }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--linie); }
  .nav a:last-child { border-bottom: 0; }
  .nav-toggle:checked ~ .nav { display: flex; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .contact { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  body { font-size: 1rem; }
  .topbar { text-align: left; font-size: .85rem; }
  .header-inner { min-height: 68px; }
  .hero { height: min(125vw, 620px); }
  .hero img { object-position: 50% 50%; }
  .hero::after { background: linear-gradient(to bottom, rgba(24, 36, 76, .72) 0%, rgba(24, 36, 76, .25) 36%, rgba(24, 36, 76, 0) 52%); }
  .hero-text { max-width: none; right: 20px; top: 24px; }
  .hero h1 { font-size: clamp(1.9rem, 8.6vw, 2.6rem); }
  .tiles, .cards, .contact, .split { grid-template-columns: 1fr; }
  .tile { aspect-ratio: 4 / 3; }
  .side-img { position: static; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .people { grid-template-columns: repeat(2, 1fr); }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
