/* Verzeichnis der Familienzentren
   Gestaltung und Farben übernommen vom Archiv bildungundfamilie.ch.
   Die Schriften stehen in fonts.css. */



:root {
  /* Logofarben */
  --blue: #004f9f;
  --red: #d51224;
  --yellow: #ffcc00;
  --orange: #f39200;
  --magenta: #c7007e;
  --teal: #009982;
  --green: #95c11f;
  --grey: #9c9c9c;
  /* Funktionsfarben (kontraststark) */
  --text: #1f1d1c;
  --muted: #5c5957;
  --accent: #b0006f;       /* Magenta, abgedunkelt für Text/Links (AA-Kontrast) */
  --accent-dark: #86005a;
  --link: #004f9f;
  --bg: #ffffff;
  --bg-soft: #f6f4f2;
  --border: #e3dfdb;
  --notice-bg: #fbeef6;
  --radius: 16px;
  --radius-small: 10px;
  --wide: 68rem;
  --narrow: 44rem;
  --font: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Quicksand', 'Fira Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--text); color: #fff; padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: var(--narrow); }

/* Kopfbereich */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); }
.brand img { width: 13.5rem; height: auto; display: block; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--accent); border-left: 2px solid var(--border); padding-left: 0.75rem; line-height: 1.2; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav a { display: block; padding: 0.35rem 0.8rem; border-radius: 999px; text-decoration: none; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { background: var(--bg-soft); color: var(--accent); }
.site-nav a[aria-current='page'] { background: var(--accent); color: #fff; }

/* Farbband aus den Logofarben */
.dots { height: 6px; background: linear-gradient(90deg, var(--blue) 0 14%, var(--red) 14% 28%, var(--yellow) 28% 42%, var(--orange) 42% 57%, var(--magenta) 57% 71%, var(--teal) 71% 85%, var(--green) 85% 100%); }

/* Hinweis zur Auflösung des Vereins */
.notice { background: var(--notice-bg); border-bottom: 1px solid #f1d3e5; }
.notice p { margin: 0; padding: 0.75rem 0; font-size: 0.95rem; }
.notice strong { color: var(--accent-dark); }

main { padding: 2rem 0 3rem; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 0.5rem; }
h4, h5, h6 { font-size: 1.05rem; margin: 1.5rem 0 0.4rem; }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* Suche */
.searchbox { display: flex; gap: 0.5rem; margin: 1.25rem 0; }
.searchbox input[type='search'] {
  flex: 1; min-width: 0; font: inherit; font-size: 1.1rem;
  padding: 0.75rem 1rem; border: 2px solid var(--border); border-radius: 999px; background: #fff; color: var(--text);
}
.searchbox input[type='search']:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(199, 0, 126, 0.18); }
.button, .searchbox button {
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 0.7rem 1.3rem;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block;
}
.button:hover, .searchbox button:hover { background: var(--accent-dark); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; margin: 0 0 1rem; font-size: 0.95rem; }
.filters select { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-small); background: #fff; }
.status { color: var(--muted); font-size: 0.95rem; min-height: 1.5em; }
mark { background: #fff1a8; padding: 0 0.1em; border-radius: 3px; }

/* Listen von Beiträgen und Dokumenten */
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.entry { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; background: #fff; }
.entry h3 { margin: 0.35rem 0 0.2rem; font-size: 1.1rem; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline; }
.entry p { margin: 0.25rem 0; }
.entry .meta { font-size: 0.9rem; color: var(--muted); }
.entry .snippet { font-size: 0.95rem; }
.entry details { margin-top: 0.4rem; font-size: 0.95rem; }
.entry summary { cursor: pointer; color: var(--link); }

.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; padding: 0.1rem 0.55rem; border-radius: 999px; border: 1px solid currentColor; }
.badge-article { color: var(--accent); }
.badge-file { color: var(--blue); }
.badge-reference { color: var(--muted); }
.badge-external { color: #7a4f00; background: #fff6d6; border-color: #e8c96a; text-transform: none; letter-spacing: 0; }
.badge-lang { color: var(--muted); text-transform: uppercase; }

.topic-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); text-decoration: none; }
.topic-chip::before { content: ''; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--c, var(--grey)); flex: none; }
a.topic-chip:hover { color: var(--accent); }

/* Themenübersicht */
.topics { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.topics a { display: flex; gap: 0.75rem; align-items: flex-start; height: 100%; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); background: #fff; }
.topics a:hover { border-color: var(--c); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); }
.topics a::before { content: ''; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c); flex: none; margin-top: 0.2rem; }
.topics strong { display: block; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.3; }
.topics span { font-size: 0.9rem; color: var(--muted); }

/* Beitrag */
.article-body { max-width: var(--narrow); }
.article-body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; display: block; overflow-x: auto; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; vertical-align: top; text-align: left; }
.article-body blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 4px solid var(--magenta); background: var(--bg-soft); border-radius: 0 var(--radius-small) var(--radius-small) 0; }
.article-body a[href$='.pdf']::after, a.file-link::after { content: ' (PDF)'; font-size: 0.8em; color: var(--muted); }
.article-meta { font-size: 0.95rem; color: var(--muted); margin-bottom: 1.5rem; }
.provenance { margin-top: 3rem; padding: 1rem 1.2rem; background: var(--bg-soft); border-radius: var(--radius); font-size: 0.9rem; color: var(--muted); max-width: var(--narrow); overflow-wrap: anywhere; }
.provenance h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.provenance ul { margin: 0; padding-left: 1.2rem; }

.back { margin: 0 0 1rem; font-size: 0.95rem; }
.back a { color: var(--muted); text-decoration: none; font-weight: 600; }
.back a:hover { color: var(--accent); text-decoration: underline; }

.columns { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 60rem) { .columns { grid-template-columns: 1fr 1fr; } }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 1.5rem 0; font-size: 0.9rem; color: var(--muted); }
.site-footer p { margin: 0.25rem 0; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.operator { display: flex; align-items: center; gap: 0.75rem; }
.footer-links { flex: none; }
.pill { display: inline-block; padding: 0.3rem 0.9rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); font-weight: 600; text-decoration: none; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.operator img { width: 32px; height: 32px; display: block; flex: none; }

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  .brand img { width: 11rem; }
  .brand span { display: none; }
  .searchbox { flex-direction: column; }
  .entry { padding: 0.9rem 1rem; }
  .footer-row { flex-direction: column; align-items: flex-start; }
  .site-footer .footer-links { margin: 0.5rem 0 0 calc(32px + 0.75rem); }
  .pill { padding: 0.55rem 1.1rem; }
}

@media print {
  .site-header nav, .notice, .searchbox, .site-footer, .dots { display: none; }
  a { color: inherit; }
}

/* ─── Verzeichnis: gemeinsame Ergänzungen ─────────────────────────────────── */

:root { --panel: 25rem; }
[hidden] { display: none !important; }
.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; }
h1, h2, h3, p, li { overflow-wrap: break-word; }
.nur-js { display: none !important; }
.js .nur-js { display: revert !important; }
.js .searchbox.nur-js, .js .dir-aktionen.nur-js { display: flex !important; }

.brand-text { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; line-height: 1.2; }
.brand-text:hover { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.sprachwahl { gap: 0; }
.site-nav .sprachwahl a { padding: 0.35rem 0.55rem; font-size: 0.85rem; }
.site-nav .sprachwahl a[aria-current] { background: var(--accent); color: #fff; }
.notice a { color: inherit; }
.site-footer a { color: inherit; }
.site-footer .pill { color: var(--text); }
.site-footer .pill:hover { color: var(--accent); }

.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0; }
.tag { display: inline-block; background: var(--notice-bg); color: var(--accent-dark); border-radius: 999px;
       padding: 0.1rem 0.6rem; font-size: 0.82rem; line-height: 1.5; }
.pill { font: inherit; font-size: 0.9rem; cursor: pointer; }
.pill[aria-pressed='true'] { background: var(--accent); border-color: var(--accent); color: #fff; }
.link-button { font: inherit; font-size: 0.9rem; font-weight: 600; background: none; border: 0; padding: 0;
               color: var(--link); text-decoration: underline; text-underline-offset: 0.15em; cursor: pointer; }
.link-button:hover { color: var(--accent); }

/* Startseite: Bedienfeld und Karte */
.dir { padding: 0; display: flex; flex-direction: column; }
.dir-panel { padding: 1rem; background: var(--bg); min-width: 0; }
.dir-filter summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.4rem; }
.dir-panel .searchbox { margin: 0 0 0.75rem; }
.dir-panel .searchbox input[type='search'] { font-size: 1rem; padding: 0.6rem 1rem; }
.dir-panel .filters { align-items: flex-end; gap: 0.5rem 0.75rem; margin-bottom: 0.5rem; }
.dir-panel .filters label { flex: 1 1 8rem; display: flex; flex-direction: column; font-size: 0.85rem; font-weight: 600; }
.dir-panel .filters select { width: 100%; font-weight: 400; font-size: 0.95rem; }
.dir-panel .status { margin: 0.5rem 0; }
.dir-aktionen { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.dir-ansicht { gap: 0.5rem; margin-bottom: 0.75rem; }
.dir-intro { font-size: 0.95rem; color: var(--muted); }
.dir-intro p { margin: 0 0 0.6rem; }
.dir-intro strong { color: var(--text); }
.js .dir-liste { display: none; }
.js .dir-liste.offen { display: grid; }
.dir-liste { margin-bottom: 1rem; grid-template-columns: minmax(0, 1fr); }
.dir-liste .entry { padding: 0.7rem 0.9rem; }
.dir-liste .entry h2 { font-size: 1rem; margin: 0 0 0.15rem; }
.dir-liste .entry h2 a { text-decoration: none; }
.dir-liste .entry h2 a:hover { text-decoration: underline; }
.dir-liste .entry .meta { margin: 0; }
.dir-liste .entry.aktiv { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dir-karte { height: 70vh; height: 70dvh; min-height: 22rem; background: var(--bg-soft); }

/* Leaflet im Stil der Seite */
.leaflet-container { font-family: var(--font); font-size: 0.95rem; }
.leaflet-container a { color: var(--link); }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(199, 0, 126, 0.25); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: var(--accent); }
.marker-cluster div span { color: #fff; font-weight: 600; font-family: var(--font); }
.fz-popup h3 { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--accent); }
.leaflet-popup-content p.adresse { margin: 0 0 0.4rem; font-weight: 600; }
.leaflet-popup-content p.tags { margin: 0.4rem 0; }
.leaflet-popup-content p { margin: 0.4rem 0 0; }

/* Schmale Bildschirme: Karte oder Liste, per Umschalter */
@media (max-width: 60rem) {
  .js .dir-ansicht.nur-js { display: flex !important; }
  .js .dir[data-ansicht='liste'] .dir-karte { display: none !important; }
  .js .dir[data-ansicht='karte'] .dir-liste,
  .js .dir[data-ansicht='karte'] .dir-intro,
  .js .dir[data-ansicht='karte'] .dir-kontakt { display: none; }
  .js .dir[data-ansicht='karte'] .dir-panel { padding-bottom: 0.25rem; }
  .dir-aktionen #fz-liste-toggle { display: none; }
  .dir-panel .status { margin: 0.25rem 0 0.5rem; }
  .notice p { font-size: 0.88rem; line-height: 1.45; padding: 0.5rem 0; }
  .dir-karte { height: 62vh; height: 62dvh; }
}
/* Breite Bildschirme: Bedienfeld neben der Karte, Seite füllt das Fenster */
@media (min-width: 60.01rem) {
  .js .dir-ansicht.nur-js { display: none !important; }
  .js .dir { flex-direction: row; }
  .dir-filter summary { display: none; }
  .js .dir-panel { width: var(--panel); flex: none; overflow-y: auto; border-right: 1px solid var(--border); }
  .js .dir-karte { flex: 1; height: auto; min-width: 0; }
  body.voll { display: flex; flex-direction: column; }
  .js body.voll { height: 100vh; height: 100dvh; min-height: 34rem; }
  .js body.voll .dir { flex: 1; min-height: 0; }
  body.voll .site-footer { padding: 0.5rem 0; }
  body.voll .site-footer p { margin: 0; }
  body.voll .wrap { max-width: none; }
}

/* Formulare und Detailseite */
.container { max-width: var(--narrow); margin: 0 auto; padding: 0 1rem; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.feld, .form-group { margin-bottom: 1rem; }
.feld label, .form-group label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.feld input, .feld textarea, .feld select, .form-group input {
  width: 100%; font: inherit; padding: 0.55rem 0.8rem; border: 2px solid var(--border);
  border-radius: var(--radius-small); background: #fff; color: var(--text);
}
.feld input:focus, .feld textarea:focus, .feld select:focus, .form-group input:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(199, 0, 126, 0.18);
}
.feld-gruppe { display: flex; flex-wrap: wrap; gap: 0 0.75rem; }
.feld-gruppe .feld { flex: 1 1 10rem; min-width: 0; }
.feld-gruppe .feld-klein { flex: 0 1 7rem; }
.checkbox-gruppe { display: flex; flex-direction: column; gap: 0.35rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.checkbox-label input { width: auto; accent-color: var(--accent); }
.hinweis { font-size: 0.9rem; color: var(--muted); margin: 0.25rem 0 0.75rem; }
.aktionen { margin-top: 0.5rem; }
.btn { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 0.7rem 1.3rem; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-primaer, .btn-primary { background: var(--accent); color: #fff; }
.btn-primaer:hover, .btn-primary:hover { background: var(--accent-dark); color: #fff; }
.alert { padding: 0.9rem 1.2rem; border-radius: var(--radius-small); margin-bottom: 1.25rem; }
.alert h2 { margin: 0 0 0.4rem; font-size: 1.2rem; color: inherit; }
.alert p:last-child { margin-bottom: 0; }
.alert ul { margin: 0.4rem 0 0 1.25rem; padding: 0; }
.alert-fehler { background: #fff3f3; border: 1px solid #f5c2c2; color: #8b0000; }
.alert-erfolg { background: var(--notice-bg); border: 1px solid #f1d3e5; color: var(--accent-dark); }
.detail-row { margin-bottom: 0.9rem; }
.detail-label { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.detail-row pre { white-space: pre-wrap; font: inherit; margin: 0; }
.webseite-link { overflow-wrap: anywhere; }
.feld-fax { display: none !important; }
.anfrage-box { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.25rem; }
