/*
   Funktionsübersicht — /funktionen

   Eigene Datei statt <style> in der Seite: dieselben Farbmarken wie die
   Modulseiten, damit alles wie ein Haus wirkt. Der Aufbau
   folgt einem gedruckten Register: nummerierte Bereiche, zweispaltige Liste mit
   Haarlinien, ein Verweis je Eintrag.
*/

.fnk-seite {
    --ink: #0F1B2E;
    --blue: #1D5FD4;
    --blue-dark: #164BB0;
    --blue-50: #EEF3FD;
    --blue-100: #DDE8FB;
    --paper: #FBFCFE;
    --body: #4A586E;
    --muted: #64748B;
    --line: #E4E9F2;
    --line-2: #D7DFEC;

    background: var(--paper);
    font-family: Inter, system-ui, sans-serif;
    color: var(--body);
    -webkit-font-smoothing: antialiased;
    min-height: 60vh;
}

.fnk-seite a { color: var(--blue); text-decoration: none; }
.fnk-seite a:hover { color: var(--blue-dark); }

.fnk-ms {
    font-family: 'Material Symbols Outlined';
    font-weight: 400; font-style: normal; line-height: 1;
    letter-spacing: normal; text-transform: none;
    display: inline-block; vertical-align: middle;
}

@keyframes fnk-fade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.ist-versteckt { display: none !important; }

/* ── Kopf ───────────────────────────────────────────────────────────────── */

.fnk-kopf {
    position: relative; isolation: isolate;
    max-width: 1240px; margin: 0 auto; padding: 64px 24px 40px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; align-items: end;
}
/* Feines Punktraster hinter dem Kopf — ein Hauch Registerpapier, kein Bild. */
.fnk-kopf::before {
    content: ""; position: absolute; inset: 0 -24px auto -24px; height: 100%; z-index: -1;
    background-image: radial-gradient(var(--line-2) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, rgb(0 0 0 / .55), transparent 85%);
    mask-image: linear-gradient(180deg, rgb(0 0 0 / .55), transparent 85%);
}
.fnk-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; color: var(--blue);
    font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
    font-size: 12px; margin-bottom: 14px;
}
.fnk-eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--blue); border-radius: 1px; }
.fnk-kopf h1 {
    font-family: Manrope, Inter, sans-serif; color: var(--ink); font-weight: 800;
    letter-spacing: -.03em; font-size: 46px; line-height: 1.06; margin: 0 0 16px; text-wrap: balance;
}
.fnk-kopf h1 span { display: block; }
.fnk-kopf h1 span + span { color: var(--muted); font-weight: 700; }
.fnk-kopf-text > p { font-size: 17px; line-height: 1.55; color: #23324A; max-width: 58ch; margin: 0 0 20px; text-wrap: pretty; }

.fnk-haken { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 9px; }
.fnk-haken li { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--ink); line-height: 1.45; }
.fnk-haken li::before {
    content: ""; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 10px;
    background: var(--blue-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%231D5FD4' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m5.5 10.5 3 3 6-7'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* Die Knopf- und Kachelfarben stehen mit .fnk-seite davor, sonst gewinnt die
   allgemeine Verweisfarbe (.fnk-seite a) und der blaue Knopf traegt blaue Schrift. */
.fnk-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.fnk-seite .fnk-knopf {
    display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px;
    border: 1px solid var(--line-2); border-radius: 10px; background: #fff;
    color: var(--ink); font-weight: 600; font-size: 14.5px; transition: all .15s;
}
.fnk-seite .fnk-knopf:hover { border-color: var(--blue-100); background: var(--blue-50); color: var(--ink); }
.fnk-seite .fnk-knopf--stark { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 10px 24px -14px rgb(29 95 212 / .8); }
.fnk-seite .fnk-knopf--stark:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.fnk-seite .fnk-knopf--hell { background: transparent; border-color: rgb(255 255 255 / .35); color: #fff; }
.fnk-seite .fnk-knopf--hell:hover { background: rgb(255 255 255 / .1); border-color: #fff; color: #fff; }

.fnk-zahlen {
    display: grid; gap: 18px; padding: 22px 26px; min-width: 190px;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    box-shadow: 0 18px 40px -30px rgb(15 27 46 / .35);
}
.fnk-zahlen > div { display: flex; align-items: baseline; gap: 10px; }
.fnk-zahlen b { font-family: Manrope, Inter, sans-serif; font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1; min-width: 2.2ch; }
.fnk-zahlen small { font-size: 13px; color: var(--muted); }

/* ── Module ─────────────────────────────────────────────────────────────── */

.fnk-module { max-width: 1240px; margin: 0 auto; padding: 8px 24px 44px; }
.fnk-abschnitt-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.fnk-abschnitt-kopf h2 { font-family: Manrope, Inter, sans-serif; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 23px; margin: 0 0 4px; }
.fnk-abschnitt-kopf p { margin: 0; font-size: 14.5px; color: var(--muted); }
.fnk-seite .fnk-admin {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; white-space: nowrap;
    border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 600; font-size: 13.5px;
}
.fnk-seite .fnk-admin:hover { border-color: var(--blue-100); background: var(--blue-50); color: var(--ink); }
.fnk-admin .fnk-ms { font-size: 18px; }

.fnk-kacheln { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.fnk-seite .fnk-kachel {
    display: flex; flex-direction: column; gap: 10px; padding: 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 14px; color: var(--ink);
    transition: transform .18s, box-shadow .18s, border-color .18s; animation: fnk-fade .35s both;
}
.fnk-seite .fnk-kachel:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgb(15 27 46 / .10); border-color: #C9D6EE; color: var(--ink); }
.fnk-kachel-ico {
    width: 40px; height: 40px; border-radius: 11px; font-size: 22px;
    background: var(--blue-50); color: var(--blue); display: grid; place-items: center;
}
.fnk-kachel-titel { font-weight: 700; font-size: 14.5px; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.fnk-kachel-gruppe { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-top: auto; }

/* ── Leiste ─────────────────────────────────────────────────────────────── */

/* Die Kopfleiste der Website klebt selbst (64px) und laege sonst ueber den Chips. */
.fnk-leiste {
    position: sticky; top: 64px; z-index: 5;
    background: rgb(251 252 254 / .92); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
/* Zwoelf Chips plus Suchfeld: die Chips bleiben kompakt und umbrechen auf zwei Zeilen,
   damit die klebende Leiste nicht ein Drittel des Fensters einnimmt. */
.fnk-leiste-inner {
    max-width: 1240px; margin: 0 auto; padding: 8px 24px;
    display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap;
}
.fnk-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 560px; min-width: 0; }
.fnk-chip {
    height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 15px;
    background: #fff; color: #23324A; font-size: 12.5px; font-weight: 500; cursor: pointer;
    display: flex; align-items: center; gap: 6px; transition: all .15s; font-family: inherit;
    white-space: nowrap; flex: none;
}
.fnk-chip span { font-size: 11px; opacity: .7; }
.fnk-chip:hover { border-color: var(--blue); }
.fnk-chip.ist-aktiv { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.fnk-suche {
    margin-left: auto; display: flex; align-items: center; gap: 8px; height: 34px;
    padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 230px;
}
.fnk-suche:focus-within { border-color: var(--blue); }
.fnk-suche input { flex: 1; border: none; background: none; font-size: 13.5px; color: var(--ink); min-width: 0; outline: none; font-family: inherit; }
.fnk-suche svg { width: 15px; height: 15px; color: #94A3B8; flex: none; }

/* ── Katalog ────────────────────────────────────────────────────────────── */

.fnk-katalog { max-width: 1240px; margin: 0 auto; padding: 8px 24px 72px; }

.fnk-leer { padding: 48px 0; text-align: center; color: var(--muted); font-size: 15px; margin: 0; }
.fnk-leer a { font-weight: 600; margin-left: 6px; }

.fnk-bereich { scroll-margin-top: 170px; padding: 44px 0 10px; border-top: 1px solid var(--line); }
.fnk-bereich:first-of-type { border-top: none; padding-top: 28px; }

.fnk-bereich-kopf {
    display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 18px; align-items: center; margin-bottom: 14px;
}
.fnk-nr {
    font-family: Manrope, Inter, sans-serif; font-weight: 800; font-size: 58px; line-height: 1;
    color: var(--blue-100); letter-spacing: -.05em; font-variant-numeric: tabular-nums;
}
.fnk-bereich-ico {
    width: 44px; height: 44px; border-radius: 12px; font-size: 22px;
    background: var(--ink); color: #fff; display: grid; place-items: center;
}
.fnk-bereich-titel h2 {
    font-family: Manrope, Inter, sans-serif; color: var(--ink); font-weight: 800;
    letter-spacing: -.025em; font-size: 27px; line-height: 1.15; margin: 0 0 4px; text-wrap: balance;
}
.fnk-bereich-titel p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.fnk-bereich-zahl { font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-top: 4px; }

.fnk-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; }
.fnk-eintrag {
    display: flex; flex-direction: column; gap: 6px; padding: 16px 0 18px;
    border-top: 1px solid var(--line); animation: fnk-fade .35s both;
}
.fnk-eintrag h3 { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; line-height: 1.35; }
.fnk-eintrag h3 a { color: inherit; }
.fnk-eintrag h3 a:hover { color: var(--blue); }
.fnk-eintrag p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--body); text-wrap: pretty; }
.fnk-mehr {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 2px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.fnk-mehr .fnk-ms { font-size: 15px; transition: transform .15s; }
.fnk-mehr:hover .fnk-ms { transform: translateX(3px); }

/* Der erste Eintrag jeder Spalte trägt keine Haarlinie — die Kopfzeile darüber reicht. */
.fnk-liste > .fnk-eintrag:nth-child(-n+2) { border-top-color: transparent; }

/* ── Abschluss ──────────────────────────────────────────────────────────── */

.fnk-abschluss { background: var(--ink); color: #fff; }
.fnk-abschluss-inner { max-width: 820px; margin: 0 auto; padding: 64px 24px; text-align: center; }
.fnk-abschluss h2 {
    font-family: Manrope, Inter, sans-serif; font-weight: 800; letter-spacing: -.025em;
    font-size: 30px; line-height: 1.15; margin: 0 0 12px; color: #fff; text-wrap: balance;
}
.fnk-abschluss p { color: rgb(255 255 255 / .72); font-size: 16px; line-height: 1.6; margin: 0 0 24px; text-wrap: pretty; }
.fnk-abschluss .fnk-knoepfe { justify-content: center; }

/* ── Schmale Fenster ────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .fnk-kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .fnk-kopf { grid-template-columns: 1fr; gap: 24px; padding-top: 44px; }
    .fnk-kopf h1 { font-size: 34px; }
    .fnk-zahlen { grid-auto-flow: column; justify-content: start; gap: 28px; }
    .fnk-zahlen > div { flex-direction: column; align-items: flex-start; gap: 4px; }
    .fnk-liste { grid-template-columns: 1fr; }
    .fnk-liste > .fnk-eintrag:nth-child(2) { border-top-color: var(--line); }
    .fnk-bereich-kopf { grid-template-columns: auto minmax(0, 1fr); }
    .fnk-nr { display: none; }
    .fnk-bereich-zahl { grid-column: 2; padding-top: 0; }
    .fnk-abschnitt-kopf { flex-direction: column; align-items: flex-start; }
    /* Auf schmalen Fenstern: eine seitlich wischbare Chip-Zeile, Suchfeld darunter. */
    .fnk-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
    .fnk-chips::-webkit-scrollbar { display: none; }
    .fnk-suche { width: 100%; margin-left: 0; }
}

@media (max-width: 640px) {
    .fnk-kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fnk-suche { width: 100%; margin-left: 0; }
    .fnk-bereich-titel h2 { font-size: 23px; }
    .fnk-abschluss h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .fnk-kachel, .fnk-eintrag { animation: none; }
}
