/*
 * AG EH MED Alumni Portal. Handgeschrieben, kein Build Schritt.
 * Farben stammen aus dem AG Logo: Dunkelgrün #1b462f und Kreuzgrün #098940.
 * Hell und dunkel folgen der Einstellung des Geräts (prefers-color-scheme).
 * Schriften liegen lokal in /fonts/portal (EB Garamond, Source Sans 3, beide SIL OFL).
 */

@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url("/fonts/portal/eb-garamond-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 800; font-display: swap;
    src: url("/fonts/portal/eb-garamond-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400 800; font-display: swap;
    src: url("/fonts/portal/eb-garamond-latin-wght-italic.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
    src: url("/fonts/portal/source-sans-3-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 200 900; font-display: swap;
    src: url("/fonts/portal/source-sans-3-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
    color-scheme: light dark;
    --bg: #ffffff;
    --surface: #f3f6f3;
    --fg: #15241b;
    --muted: #57675d;
    --line: #dde4de;
    --line-strong: #b7c4ba;
    --deep: #1b462f;
    --green: #098940;
    --link: #0a7236;
    --btn-bg: #1b462f;
    --btn-fg: #ffffff;
    --btn-hover: #143524;
    --bar-bg: #1b462f;
    --bar-fg: #ffffff;
    --danger: #a3271f;
    --land: #ffffff;
    --pin-ring: #ffffff;
    --shadow: 0 6px 24px rgba(21, 36, 27, .12);
    --serif: "EB Garamond", Garamond, "Adobe Garamond Pro", Georgia, serif;
    --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --radius: 3px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0e1a13;
        --surface: #15251c;
        --fg: #e8eee9;
        --muted: #9bafa2;
        --line: #25382d;
        --line-strong: #3b5546;
        --deep: #e3ece5;
        --green: #3dbb74;
        --link: #62d193;
        --btn-bg: #3dbb74;
        --btn-fg: #0b1810;
        --btn-hover: #56cb89;
        --bar-bg: #1d3b2a;
        --bar-fg: #e8eee9;
        --danger: #ff9389;
        --land: #1a2d22;
        --pin-ring: #0e1a13;
        --shadow: 0 6px 24px rgba(0, 0, 0, .5);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--sans); font-size: 1.0625rem; line-height: 1.55; color: var(--fg); background: var(--bg); }

/* Rahmen */
.site-header, main, .site-footer { width: 100%; max-width: 42rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem; }
main { flex: 1; padding-top: 2.5rem; padding-bottom: 4rem; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; }
.header-line { border-bottom: 1px solid var(--line); }
.footer-line { border-top: 1px solid var(--line); }
.wide .site-header, main.wide, .wide .site-footer { max-width: 72rem; }

.brand { display: flex; align-items: center; gap: .7rem; color: var(--deep); text-decoration: none; }
.brand img { height: 2.5rem; width: auto; display: block; }
.brand-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; letter-spacing: .03em; line-height: 1; white-space: nowrap; }
.brand-sub { display: block; margin-top: .3rem; font-family: var(--sans); font-size: .68rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--green); }
.site-nav { display: flex; align-items: center; gap: 1.4rem; font-size: .95rem; font-weight: 600; }
.site-nav a { color: var(--fg); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--green); }
.site-nav a.nav-cta { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: .4rem .85rem; }
.site-nav a.nav-cta:hover { border-color: var(--green); color: var(--link); }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; padding-top: 1.5rem; padding-bottom: 2rem; color: var(--muted); font-size: .9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--link); text-decoration: underline; }

/* Text */
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--deep); text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.5rem + 3vw, 3.25rem); line-height: 1.05; letter-spacing: -.01em; margin: 0 0 1rem; }
h2 { font-size: 1.6rem; line-height: 1.2; margin: 2.75rem 0 .5rem; }
h3 { font-size: 1.25rem; margin: 1.75rem 0 .4rem; }
p { margin: 0 0 1rem; }
h1 + p { font-size: 1.15rem; color: var(--muted); max-width: 44rem; }
a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small, label.small { font-size: .9rem; }
.error { color: var(--danger); font-size: .95rem; margin: .35rem 0 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* Formulare */
label { display: block; margin-top: 1.25rem; margin-bottom: .35rem; font-size: .95rem; font-weight: 600; }
input[type=email], input[type=text], input[type=number], input[type=url], input[type=tel], input[type=search], select, textarea {
    width: 100%; padding: .65rem .75rem; font: inherit; color: var(--fg); background: var(--bg);
    border: 1px solid var(--line-strong); border-radius: var(--radius); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
input:disabled { background: var(--surface); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 1.05rem; height: 1.05rem; margin: 0 .45rem 0 0; vertical-align: -.15em; accent-color: var(--green); }
textarea { resize: vertical; min-height: 5rem; }
fieldset { border: 0; padding: 0; margin: 1.5rem 0 0; }
legend { padding: 0; margin-bottom: .2rem; font-size: .95rem; font-weight: 600; }
label.check { font-weight: 400; margin-top: .55rem; margin-bottom: 0; font-size: 1rem; }
label.check.small { font-size: .9rem; }
label.check.radio { margin-top: .9rem; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0 1rem; }

button, a.button { display: inline-block; margin-top: 1.5rem; padding: .7rem 1.3rem; font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    color: var(--btn-fg); background: var(--btn-bg); border: 1px solid var(--btn-bg); border-radius: var(--radius); transition: background-color .15s, border-color .15s; }
button:hover, a.button:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
button.secondary, a.button.secondary { color: var(--fg); background: transparent; border-color: var(--line-strong); }
button.secondary:hover, a.button.secondary:hover { background: var(--surface); border-color: var(--muted); }

/* Bausteine */
.notice { margin: 0 0 1.25rem; padding: .85rem 1rem; background: var(--surface); border-left: 3px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; }
.box { margin-top: 1rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); }
.box h2 { margin-top: 0; font-size: 1.35rem; }
.box > :last-child { margin-bottom: 0; }
.box ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.box li { margin-bottom: .5rem; }
.box li::marker { color: var(--green); }
summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: .75rem; }
.tag { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--link); border: 1px solid currentColor; border-radius: 1rem; vertical-align: .08em; }
.tag.muted { color: var(--muted); }
.preview { padding: 1rem 1.25rem; background: var(--surface); border-radius: var(--radius); }
ul.results { list-style: none; padding: 0; }
ul.results li form { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
ul.results button { margin-top: 0; }
table.data { border-collapse: collapse; width: 100%; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: .5rem .5rem .5rem 0; border-bottom: 1px solid var(--line); }
table.data th { width: 40%; font-weight: 600; color: var(--muted); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Startseite und Karte */
.filters { margin-top: 1.75rem; }
.filters label { margin-top: 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.filters .row { gap: .75rem 1rem; }
.filters button { margin-top: 1rem; }
.map { height: min(72vh, 46rem); min-height: 22rem; margin-top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); z-index: 0; }
#map-summary { margin-top: .6rem; }
.land { fill: var(--land); stroke: var(--line-strong); stroke-width: 1; }
.pin { background: var(--green); border: 2px solid var(--pin-ring); border-radius: 50%; box-shadow: 0 0 0 1px var(--green); }
.cluster { display: flex; align-items: center; justify-content: center; font-family: var(--sans); font-weight: 700; font-size: .85rem; color: var(--btn-fg); background: var(--btn-bg); border: 2px solid var(--pin-ring); border-radius: 50%; box-shadow: 0 0 0 1px var(--btn-bg); }
.cluster div { line-height: 1; }
.popup strong { font-family: var(--serif); font-size: 1.2rem; font-weight: 500; color: var(--deep); line-height: 1.2; }
.popup ul { padding-left: 1rem; margin: .5rem 0 0; }
.popup li { margin-bottom: .5rem; }
.popup label.check { margin-top: .3rem; }

.selection { position: sticky; bottom: .75rem; z-index: 500; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: .75rem; padding: .7rem .8rem .7rem 1.1rem; color: var(--bar-fg); background: var(--bar-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.selection[hidden] { display: none; }
.selection [data-count] { flex: 1 1 auto; font-weight: 600; }
.selection button, .selection a.button { margin-top: 0; padding: .5rem 1rem; }
.selection a.button { color: #10271a; background: #ffffff; border-color: #ffffff; }
.selection a.button:hover { background: #e3ece5; border-color: #e3ece5; }
.selection button.secondary { color: var(--bar-fg); border-color: rgba(255, 255, 255, .4); }
.selection button.secondary:hover { background: rgba(255, 255, 255, .12); border-color: #ffffff; }

.join { display: grid; gap: 1rem 3rem; align-items: center; margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.join h2 { margin: 0 0 .4rem; font-size: 1.9rem; }
.join p { margin: 0; color: var(--muted); max-width: 36rem; }
.join-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.join-actions a.button { margin-top: 0; }
.join-actions a:not(.button) { font-weight: 600; }
@media (min-width: 52rem) { .join { grid-template-columns: 1fr auto; } }
.credits { margin-top: 2.5rem; }

/* Leaflet an das Farbschema anpassen */
.leaflet-container { font: inherit; font-size: .95rem; background: var(--surface); }
.leaflet-container a { color: var(--link); }
.leaflet-popup-content-wrapper { color: var(--fg); background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--bg); box-shadow: none; }
.leaflet-popup-content { margin: 1rem 1.1rem; line-height: 1.45; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-bar { border: 1px solid var(--line-strong) !important; border-radius: var(--radius); box-shadow: none; }
.leaflet-bar a, .leaflet-bar a:hover { color: var(--fg); background: var(--bg); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--surface); }
.leaflet-bar a.leaflet-disabled { color: var(--line-strong); background: var(--bg); }

/* Schmale Bildschirme */
@media (max-width: 34rem) {
    body { font-size: 1rem; }
    main { padding-top: 1.75rem; padding-bottom: 3rem; }
    .brand img { height: 2.1rem; }
    .brand-name { font-size: 1.2rem; }
    .brand-sub { font-size: .6rem; }
    .site-nav { gap: 1rem; font-size: .9rem; }
    .site-nav .nav-optional { display: none; }
    .map { height: 68vh; margin-left: -1.25rem; margin-right: -1.25rem; border-left: 0; border-right: 0; border-radius: 0; }
    .filters .row { grid-template-columns: 1fr 1fr; }
    .filters .row > div:first-child { grid-column: 1 / -1; }
    .selection { bottom: .5rem; }
    button, a.button { padding: .8rem 1.2rem; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
    .site-header, .site-footer, a, button { display: none; }
    body { color: #000; background: #fff; }
}
h2 .small { font-family: var(--sans); }
