:root {
    --paper: #FBF8F0;
    --paper-dim: #F3EFE2;
    --ink: #24301F;
    --muted: #6C6455;
    --meadow: #4B6B3E;
    --meadow-dark: #2E4527;
    --meadow-deep: #1F3119;
    --gold: #E4B75A;
    --barn: #8B4A34;
    --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

a { color: inherit; }

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

section { padding: 64px 0; }

/* ---- Navigation ---- */
.site-nav {
    position: sticky; top: 0; z-index: 20;
    background: rgba(251, 248, 240, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(36,48,31,0.08);
}
.site-nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}
.wordmark {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
    color: var(--meadow-dark);
}
.site-nav nav { display: flex; gap: 22px; align-items: center; }
.site-nav nav a {
    text-decoration: none;
    font-size: 0.92rem;
    color: var(--ink);
    font-weight: 500;
    transition: color 0.15s ease;
}
.site-nav nav a:hover { color: var(--meadow); }
.site-nav nav a.active {
    color: var(--meadow-dark);
    font-weight: 700;
}
.site-nav nav a.button {
    background: var(--meadow);
    color: #fff;
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.15s ease, transform 0.15s ease;
}
.site-nav nav a.button:hover {
    background: var(--meadow-dark);
    transform: translateY(-1px);
}

/* ---- Hero ---- */
.hero {
    background: linear-gradient(160deg, var(--meadow-deep), var(--meadow-dark) 65%, var(--meadow));
    color: #F3EEDC;
    padding: 88px 0 0;
    position: relative;
    overflow: hidden;
}
.hero.hero-subpage {
    padding: 44px 0 0;
}
.hero .wrap { position: relative; z-index: 2; padding-bottom: 90px; }
.hero.hero-subpage .wrap { padding-bottom: 56px; }
.hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); color: #fff; max-width: 16ch; }
.hero.hero-subpage h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.hero p.lede { font-size: 1.1rem; max-width: 52ch; margin: 18px 0 30px; color: #E7E2CE; }
.hero.hero-subpage p.lede { margin: 10px 0 0; font-size: 1rem; color: #E7E2CE; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 8px; }
.hero-facts div { display: flex; flex-direction: column; }
.hero-facts .num { font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 600; color: var(--gold); }
.hero-facts .lbl { font-size: 0.8rem; color: #C9C3AE; text-transform: uppercase; letter-spacing: 0.04em; }
.hero-cta { margin-top: 34px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border-radius: 999px; text-decoration: none;
    font-weight: 600; font-size: 0.92rem; transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--gold); color: var(--meadow-deep); }
.btn-primary:hover { background: #EBBF63; }
.btn-ghost { border: 1px solid rgba(255,255,255,0.4); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); }

.horizon { position: absolute; left: 0; right: 0; bottom: -2px; line-height: 0; z-index: 1; }
.horizon svg { width: 100%; height: auto; display: block; }

/* ---- Main Content Wrapper ---- */
.main-content {
    padding-top: 36px;
    padding-bottom: 64px;
}

/* ---- Toolbar (Subpages) ---- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
    background: var(--paper-dim);
    border: 1px solid rgba(36,48,31,0.1);
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(36,48,31,0.03);
}
.toolbar label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}
.field { display: flex; flex-direction: column; }
.toolbar select {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid rgba(36,48,31,0.18);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-family: inherit;
    min-height: 38px;
    cursor: pointer;
}
.toolbar select:focus {
    outline: 2px solid var(--meadow);
    outline-offset: 1px;
}
.nav-tabs, .tabs {
    display: flex;
    gap: 4px;
    background: var(--paper);
    border: 1px solid rgba(36,48,31,0.12);
    border-radius: 12px;
    padding: 4px;
}
.nav-tabs a, .tabs a {
    text-decoration: none;
    color: var(--muted);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: all 0.15s ease;
}
.nav-tabs a:hover, .tabs a:hover {
    color: var(--ink);
}
.nav-tabs a.active, .tabs a.active {
    background: var(--meadow-dark);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(36,48,31,0.15);
}
.tabs { margin-left: auto; }

/* ---- Facts strip ---- */
.facts-strip {
    background: var(--paper-dim);
    border-bottom: 1px solid rgba(36,48,31,0.08);
}
.facts-strip .wrap {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
    padding: 28px 24px;
}
.fact-item { text-align: center; }
.fact-item .icon { font-size: 1.5rem; margin-bottom: 6px; }
.fact-item .fact-label { font-size: 0.82rem; color: var(--muted); }

/* ---- About Section ---- */
.about { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.about h2 { font-size: 1.9rem; margin-bottom: 18px; color: var(--meadow-dark); }
.about p { color: #40392E; margin: 0 0 14px; }
.about-art { display: flex; align-items: center; justify-content: center; }
.about-art svg { width: 100%; max-width: 360px; height: auto; }

/* ---- Location Section ---- */
.location { background: var(--paper-dim); }
.location-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: stretch; }
.address-card {
    background: var(--paper); border: 1px solid rgba(36,48,31,0.1); border-radius: var(--radius);
    padding: 28px; display: flex; flex-direction: column; justify-content: space-between;
}
.address-card h3 { font-size: 1.3rem; color: var(--meadow-dark); margin-bottom: 10px; }
.address-card address { font-style: normal; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.map-frame {
    border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(36,48,31,0.1);
    min-height: 320px;
}
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }

/* ---- Weather Section & Cards ---- */
.weather h2 { font-size: 1.9rem; color: var(--meadow-dark); margin-bottom: 10px; }
.weather > .wrap > p { color: var(--muted); max-width: 60ch; margin: 0 0 30px; }
.weather-cards, .cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px;
    margin-bottom: 28px;
}
.wcard, .card {
    background: var(--paper);
    border: 1px solid rgba(36,48,31,0.1);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(36,48,31,0.03);
}
.wcard .icon, .card .icon { font-size: 1.6rem; }
.wcard .val, .wcard .value, .card .val, .card .value {
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--meadow-dark);
    margin-top: 4px;
}
.wcard .lbl, .wcard .label, .card .lbl, .card .label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.weather-updated { font-size: 0.82rem; color: var(--muted); margin-bottom: 22px; }
.weather-empty, .panel-empty {
    background: var(--paper); border: 1px dashed rgba(36,48,31,0.25); border-radius: var(--radius);
    padding: 22px; color: var(--muted); margin-bottom: 22px; text-align: center;
}

/* ---- Panels (Diagramme, Tabellen) ---- */
.panel {
    background: var(--paper);
    border: 1px solid rgba(36,48,31,0.1);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(36,48,31,0.03);
}
.panel h2 {
    margin: 0 0 16px;
    font-family: 'Fraunces', serif;
    font-size: 1.2rem;
    color: var(--meadow-dark);
    font-weight: 600;
    line-height: 1.4;
}

.chart-container { position: relative; width: 100%; height: 300px; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid rgba(36,48,31,0.08); white-space: nowrap; }
th {
    color: var(--meadow-dark);
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    position: sticky; top: 0;
    background: var(--paper-dim);
}
tbody tr:hover { background: rgba(75, 107, 62, 0.05); }
.table-wrap {
    max-height: 480px;
    overflow: auto;
    border-radius: 10px;
    border: 1px solid rgba(36,48,31,0.08);
}
#overviewTable th { cursor: pointer; user-select: none; }
#overviewTable th:hover { color: var(--meadow); }
#overviewTable th .arrow { display: inline-block; width: 0.9em; opacity: 0.5; color: var(--gold); }
#overviewTable th.sorted .arrow { opacity: 1; color: var(--meadow-dark); font-weight: bold; }

/* ---- Footer ---- */
footer { background: var(--meadow-deep); color: #DCD7C3; padding: 44px 0; margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
footer .wordmark { color: #fff; }
footer .foot-address { font-size: 0.88rem; color: #B9B49F; line-height: 1.6; }
footer .foot-links { display: flex; gap: 18px; font-size: 0.85rem; }
footer .foot-links a { text-decoration: none; color: #DCD7C3; transition: color 0.15s ease; }
footer .foot-links a:hover { color: #fff; }

/* ---- Responsive Breakpoints ---- */
@media (max-width: 820px) {
    .about, .location-grid { grid-template-columns: 1fr; }
    .about-art { order: -1; }
    .facts-strip .wrap { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    section { padding: 44px 0; }
    .hero { padding-top: 24px; }
    .hero .wrap { padding-bottom: 64px; }
    .site-nav nav { gap: 12px; }
    .site-nav nav a:not(.button):not(.nav-mobile-keep) { display: none; }
    .hero-facts { gap: 18px; }
    .toolbar { flex-direction: column; align-items: stretch; padding: 10px; }
    .nav-tabs, .tabs { width: 100%; }
    .nav-tabs a, .tabs a { flex: 1; justify-content: center; padding: 9px 8px; }
    .tabs { margin-left: 0; }
    .field, .field select { width: 100%; }
    .cards, .weather-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card, .wcard { padding: 12px; }
    .card .value, .wcard .val { font-size: 1.25rem; }
    .panel { padding: 14px; border-radius: 12px; }
    .panel h2 { font-size: 0.95rem; }
    .chart-container { height: 230px; }
    table { font-size: 0.8rem; }
    th, td { padding: 8px 8px; }
}
@media (max-width: 380px) {
    .cards, .weather-cards { grid-template-columns: 1fr 1fr; }
    .card .value, .wcard .val { font-size: 1.1rem; }
}
