/*
 * Gemeindekalender Hille – Modernes Event-App-Design
 * Ziel: deutlich frischer, mobilfreundlich, weniger Amtsblatt/klassisch.
 */
:root {
    --bg-0: #080f1f;
    --bg-1: #101b33;
    --bg-2: #f5f7fb;
    --surface: rgba(255,255,255,.92);
    --surface-strong: #ffffff;
    --surface-dark: rgba(9,16,31,.78);
    --text: #101727;
    --text-soft: #48556a;
    --text-muted: #6b7485;
    --white: #ffffff;
    --line: rgba(16,23,39,.12);
    --line-soft: rgba(255,255,255,.18);
    --primary: #08a878;
    --primary-2: #00d1a0;
    --primary-dark: #05785a;
    --blue: #3578ff;
    --violet: #7c3cff;
    --pink: #ff4f9a;
    --orange: #ffaf2f;
    --yellow: #f7d84b;
    --danger: #d94141;
    --ok: #0a8b64;
    --shadow-soft: 0 18px 45px rgba(0,0,0,.12);
    --shadow: 0 26px 80px rgba(3,9,24,.22);
    --shadow-color: 0 30px 90px rgba(0,209,160,.22), 0 22px 70px rgba(124,60,255,.14);
    --radius-sm: 14px;
    --radius: 26px;
    --radius-lg: 42px;
    --header-height: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(circle at 8% 10%, rgba(0,209,160,.42), transparent 0 18rem),
        radial-gradient(circle at 86% 8%, rgba(124,60,255,.35), transparent 0 24rem),
        radial-gradient(circle at 72% 34rem, rgba(255,79,154,.20), transparent 0 24rem),
        linear-gradient(180deg, #081124 0 22rem, #eef3f8 22rem 100%);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: .23;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, #000, transparent 72%);
    pointer-events: none;
}
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: #035540; }
img { max-width: 100%; height: auto; }

.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.narrow { width: min(1020px, calc(100% - 40px)); }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid rgba(255,255,255,.12);
    background: rgba(8,15,31,.74);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    box-shadow: 0 10px 34px rgba(0,0,0,.18);
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 13px 0;
}
.brand {
    display: inline-flex;
    gap: 13px;
    align-items: center;
    color: #fff;
    min-width: 0;
}
.brand:hover { color: #fff; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 18px;
    color: #071425;
    background: linear-gradient(135deg, var(--yellow), var(--primary-2));
    font-size: 1.5rem;
    font-weight: 950;
    box-shadow: 0 14px 36px rgba(0,209,160,.28);
}
.brand strong {
    display: block;
    color: #fff;
    font-size: 1.08rem;
    letter-spacing: -.02em;
    line-height: 1.08;
}
.brand small {
    display: block;
    color: rgba(255,255,255,.67);
    font-size: .84rem;
    margin-top: 4px;
    line-height: 1.25;
}
.top-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.top-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 39px;
    padding: 9px 14px;
    border-radius: 999px;
    color: rgba(255,255,255,.88);
    font-weight: 820;
    line-height: 1;
    white-space: nowrap;
}
.top-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.10);
}

/* Buttons */
.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    cursor: pointer;
    color: #071425;
    background: linear-gradient(135deg, var(--yellow), var(--primary-2));
    font: inherit;
    font-weight: 900;
    border-radius: 999px;
    padding: 12px 19px;
    min-height: 45px;
    box-shadow: 0 16px 36px rgba(0,209,160,.22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease, background .18s ease;
}
.button:hover,
button:hover {
    color: #071425;
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 22px 44px rgba(0,209,160,.30);
}
.button.ghost {
    color: #fff;
    background: rgba(255,255,255,.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.20);
}
.button.ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.button.small,
button.small { padding: 8px 13px; min-height: 34px; font-size: .9rem; }
.button.danger,
button.danger { background: linear-gradient(135deg, #ff6363, #d94141); color: #fff; }
.button.muted,
button.muted { background: #5b6475; color: #fff; }

/* Public Layout */
.wide-shell {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1120px) minmax(120px, 170px);
    gap: clamp(18px, 2.4vw, 34px);
    width: min(1580px, calc(100% - 28px));
    margin: 0 auto;
    align-items: start;
}
.main-content { padding: clamp(30px, 4.2vw, 54px) 0 58px; }
.public-layout .main-content { min-width: 0; }

/* Werbeflaechen */
.ad-rail {
    display: flex;
    justify-content: center;
    padding-top: clamp(58px, 6vw, 86px);
    min-width: 0;
}
.ad-card {
    position: sticky;
    top: calc(var(--header-height) + 34px);
    width: 100%;
    min-height: min(64vh, 560px);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 34px;
    background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.58));
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    color: #4f5b6d;
    padding: 18px;
    overflow: visible;
}
.ad-card::before {
    content: "Werbung";
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 13px 3px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--pink), var(--orange));
    color: #fff;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .16em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(255,79,154,.22);
}
.ad-card > span { display: none; }
.ad-card strong { font-size: 1.18rem; color: #1c2535; }
.ad-card small { max-width: 14ch; line-height: 1.35; }
.ad-card.ad-banner,
.ad-banner.ad-card {
    padding: 16px;
    text-decoration: none;
    background: linear-gradient(180deg, rgba(255,255,255,.90), rgba(255,255,255,.68));
}
.ad-card.ad-banner img,
.ad-banner.ad-card img,
.ad-card img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 390px;
    object-fit: contain;
    border-radius: 20px;
}

/* Hero */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .74fr);
    gap: clamp(18px, 2.5vw, 30px);
    align-items: stretch;
    margin-bottom: clamp(32px, 4vw, 48px);
}
.hero-card {
    position: relative;
    overflow: hidden;
    min-height: 356px;
    border-radius: clamp(30px, 3.6vw, 52px);
    padding: clamp(30px, 5.5vw, 64px);
    color: #fff;
    background:
        radial-gradient(circle at 90% 20%, rgba(255,216,75,.34), transparent 0 13rem),
        radial-gradient(circle at 78% 86%, rgba(255,79,154,.30), transparent 0 17rem),
        linear-gradient(135deg, #6b35ff 0%, #0e7dff 42%, #00c99a 100%);
    box-shadow: var(--shadow-color);
    isolation: isolate;
}
.hero-card::before {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -2;
    background:
        linear-gradient(115deg, transparent 0 56%, rgba(255,255,255,.14) 56% 100%),
        repeating-linear-gradient(-25deg, rgba(255,255,255,.10) 0 1px, transparent 1px 15px);
    opacity: .85;
}
.hero-card::after {
    content: "";
    position: absolute;
    right: -64px;
    bottom: -84px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    z-index: -1;
    box-shadow: -260px -210px 0 -86px rgba(255,255,255,.16);
}
.hero h1 {
    margin: 0 0 20px;
    max-width: 780px;
    font-size: clamp(3rem, 6.2vw, 6.2rem);
    line-height: .88;
    letter-spacing: -.075em;
    text-wrap: balance;
}
.hero-card h1::before {
    content: "Community · Events · Hille";
    display: block;
    width: fit-content;
    margin: 0 0 18px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #071425;
    background: rgba(255,216,75,.96);
    box-shadow: 0 10px 24px rgba(0,0,0,.12);
    font-size: clamp(.72rem, 1.1vw, .9rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.hero p {
    margin: 0 0 28px;
    max-width: 700px;
    color: rgba(255,255,255,.93);
    font-size: clamp(1.05rem, 1.45vw, 1.28rem);
    line-height: 1.62;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.hero .button { background: #fff; color: #081124; box-shadow: 0 18px 38px rgba(0,0,0,.18); }
.hero .button:hover { color: #081124; }
.hero .button.ghost {
    color: #fff;
    background: rgba(8,17,36,.36);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
}
.info-tile {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: clamp(28px, 3vw, 44px);
    background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.78));
    box-shadow: var(--shadow);
    padding: clamp(26px, 3vw, 38px);
}
.info-tile::before {
    content: "";
    position: absolute;
    top: -70px;
    right: -70px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,209,160,.22), transparent 65%);
}
.info-tile h2 {
    margin: 0 0 18px;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    letter-spacing: -.045em;
}
.info-tile ul {
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--text-soft);
    line-height: 1.68;
}
.info-tile li {
    position: relative;
    padding: 9px 0 9px 34px;
    border-bottom: 1px solid rgba(16,23,39,.08);
}
.info-tile li:last-child { border-bottom: 0; }
.info-tile li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 8px;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-2), var(--blue));
    color: #fff;
    font-size: .84rem;
    font-weight: 900;
}

/* Termine */
.month-section { margin: clamp(32px, 4vw, 48px) 0; }
.month-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 20px;
    color: #fff;
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    letter-spacing: -.06em;
    text-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.month-title::after {
    content: "";
    height: 2px;
    flex: 1;
    background: linear-gradient(90deg, rgba(255,255,255,.45), transparent);
}
.event-list { display: grid; gap: 20px; }
.event-card {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 32px;
    padding: clamp(18px, 2.4vw, 28px);
    box-shadow: 0 18px 50px rgba(0,0,0,.13);
    transition: transform .18s ease, box-shadow .18s ease;
}
.event-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, var(--pink), var(--orange), var(--primary-2));
}
.event-card::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -110px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(53,120,255,.14), transparent 68%);
    pointer-events: none;
}
.event-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 62px rgba(0,0,0,.18);
}
.date-badge {
    position: relative;
    z-index: 1;
    min-height: 106px;
    border-radius: 28px;
    display: grid;
    place-items: center;
    align-content: center;
    background: linear-gradient(135deg, #081124, #193f79 58%, #00a77c);
    color: #fff;
    text-align: center;
    box-shadow: 0 18px 36px rgba(0,0,0,.22);
}
.date-badge span { font-weight: 950; font-size: 2.5rem; line-height: .9; letter-spacing: -.05em; }
.date-badge small { margin-top: 8px; font-weight: 900; font-size: .84rem; color: var(--yellow); }
.event-body { position: relative; z-index: 1; min-width: 0; }
.event-meta {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    color: #071425;
    background: linear-gradient(135deg, rgba(255,216,75,.95), rgba(255,175,47,.84));
    border-radius: 999px;
    padding: 5px 11px;
    font-weight: 950;
    font-size: .94rem;
}
.event-body h3 {
    margin: 0 0 10px;
    font-size: clamp(1.35rem, 2.2vw, 1.78rem);
    letter-spacing: -.045em;
    line-height: 1.12;
}
.event-details {
    display: flex;
    gap: 9px 16px;
    flex-wrap: wrap;
    color: var(--text-soft);
    font-weight: 760;
    font-size: .97rem;
}
.event-body p {
    margin: 16px 0 0;
    color: #334056;
    line-height: 1.68;
    font-size: 1.02rem;
}
.flyer-area { margin-top: 18px; }
.flyer-area img {
    display: block;
    width: min(100%, 420px);
    max-height: 270px;
    object-fit: cover;
    border-radius: 24px;
    border: 1px solid rgba(16,23,39,.12);
    box-shadow: 0 18px 38px rgba(0,0,0,.16);
}
.empty-state {
    text-align: center;
    padding: clamp(44px, 7vw, 78px) 22px;
    border-radius: 36px;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.90);
    box-shadow: var(--shadow);
    color: var(--text-soft);
}
.empty-state h2 {
    margin: 0 0 12px;
    color: #111827;
    letter-spacing: -.04em;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
}
.empty-state p { margin-bottom: 0; }

/* Panels / Formulare / Admin */
.panel {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 30px;
    box-shadow: var(--shadow);
    padding: clamp(20px, 3vw, 34px);
    margin-bottom: 24px;
}
.panel h1,
.panel h2 { margin-top: 0; letter-spacing: -.05em; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.form-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-row.full { grid-column: 1 / -1; }
label { font-weight: 850; color: #1e2838; }
input,
textarea,
select {
    width: 100%;
    border: 1px solid rgba(16,23,39,.15);
    background: #f8fafc;
    color: var(--text);
    border-radius: 17px;
    padding: 12px 14px;
    font: inherit;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
textarea { min-height: 132px; resize: vertical; }
input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: rgba(0,209,160,.62);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,209,160,.14);
}
.help { color: var(--text-muted); font-size: .9rem; }
.notice {
    padding: 14px 16px;
    border-radius: 18px;
    margin: 0 0 18px;
    border: 1px solid rgba(255,216,75,.45);
    background: #fff8df;
    color: #604610;
}
.notice.error { background: #fff0f0; border-color: #f0b5b5; color: #8c2d2d; }
.notice.success { background: #eafff6; border-color: #a7ead2; color: #075d44; }
.notice.info { background: #ecf5ff; border-color: #bcd7f7; color: #214f7b; }
.table-wrap {
    overflow-x: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}
table { width: 100%; border-collapse: collapse; background: #fff; }
th,
td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th {
    background: #101827;
    color: rgba(255,255,255,.86);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}
tr:last-child td { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; }
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eef2f7;
    color: #445066;
    font-size: .85rem;
    font-weight: 850;
}
.badge.ok { background: #dff9ed; color: var(--ok); }
.badge.warn { background: #fff1c8; color: #7e5600; }
.badge.danger { background: #ffe0dd; color: var(--danger); }

/* Footer */
.site-footer {
    border-top: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.74);
    background: #081124;
}
.footer-inner {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: .92rem;
}
.footer-inner a { color: var(--primary-2); font-weight: 850; }

/* Tablet */
@media (max-width: 1250px) {
    .wide-shell {
        grid-template-columns: minmax(0, 1fr);
        width: min(1080px, calc(100% - 36px));
    }
    .public-layout .main-content { order: 1; }
    .ad-rail {
        order: 2;
        padding-top: 0;
    }
    .ad-rail.right { order: 3; }
    .ad-card,
    .ad-card.ad-banner,
    .ad-banner.ad-card {
        position: relative;
        top: auto;
        min-height: 138px;
        max-width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 18px;
        margin-bottom: 18px;
    }
    .ad-card small { max-width: 42ch; }
    .ad-card.ad-banner img,
    .ad-banner.ad-card img,
    .ad-card img { max-height: 96px; width: auto; max-width: min(100%, 360px); }
}

@media (max-width: 920px) {
    body {
        background:
            radial-gradient(circle at 2% 4%, rgba(0,209,160,.42), transparent 0 16rem),
            radial-gradient(circle at 96% 4%, rgba(124,60,255,.34), transparent 0 20rem),
            linear-gradient(180deg, #081124 0 24rem, #eef3f8 24rem 100%);
    }
    .container,
    .narrow { width: min(100% - 30px, 780px); }
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding: 12px 0;
    }
    .top-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }
    .top-nav a { flex: 0 0 auto; background: rgba(255,255,255,.08); }
    .hero { grid-template-columns: 1fr; }
    .hero-card { min-height: 0; }
    .info-tile { box-shadow: var(--shadow-soft); }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .container,
    .narrow,
    .wide-shell { width: min(100% - 24px, 640px); }
    .brand-mark { width: 44px; height: 44px; border-radius: 16px; }
    .brand small { display: none; }
    .top-nav a { min-height: 36px; padding: 8px 11px; font-size: .92rem; }
    .main-content { padding: 24px 0 40px; }
    .hero { gap: 16px; margin-bottom: 30px; }
    .hero-card { border-radius: 30px; padding: 28px 22px; }
    .hero h1 { font-size: clamp(2.6rem, 13vw, 4.1rem); }
    .hero p { font-size: 1rem; line-height: 1.55; }
    .hero-actions { display: grid; grid-template-columns: 1fr; }
    .hero-actions .button { width: 100%; }
    .info-tile { border-radius: 28px; padding: 22px; }
    .month-title { color: #111827; text-shadow: none; font-size: 1.65rem; }
    .month-title::after { background: linear-gradient(90deg, rgba(16,23,39,.18), transparent); }
    .event-card {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 14px;
        border-radius: 26px;
        padding: 16px;
    }
    .date-badge {
        min-height: 82px;
        border-radius: 21px;
    }
    .date-badge span { font-size: 1.76rem; }
    .date-badge small { font-size: .76rem; margin-top: 5px; }
    .event-meta { font-size: .84rem; padding: 4px 8px; }
    .event-body h3 { font-size: 1.22rem; }
    .event-details { font-size: .91rem; gap: 7px 10px; }
    .event-body p { margin-top: 12px; }
    .flyer-area img { width: 100%; max-height: none; aspect-ratio: 16 / 10; }
    .panel { border-radius: 24px; padding: 18px; }
    .footer-inner { align-items: flex-start; flex-direction: column; }
    .ad-card,
    .ad-card.ad-banner,
    .ad-banner.ad-card {
        min-height: 112px;
        border-radius: 24px;
        padding: 14px;
    }
    .ad-card.ad-banner img,
    .ad-banner.ad-card img,
    .ad-card img { max-height: 80px; }
}

@media (max-width: 470px) {
    .container,
    .narrow,
    .wide-shell { width: min(100% - 18px, 450px); }
    .site-header { position: sticky; }
    .brand strong { font-size: 1rem; }
    .hero-card { padding: 25px 18px; border-radius: 26px; }
    .hero-card h1::before { font-size: .67rem; }
    .event-card { grid-template-columns: 1fr; }
    .date-badge {
        width: 84px;
        min-height: 74px;
    }
    th,
    td { padding: 11px 12px; }
    .ad-rail { display: none; }
}


/* === Header-Logo Hille === */
.brand {
    gap: 0;
    min-width: 0;
    flex: 1 1 auto;
}
/* Text im DOM behalten, aber visuell ausblenden */
.brand-mark,
.brand > span:last-child {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.brand::before {
    content: "";
    display: block;
    width: min(100%, 470px);
    height: 86px;
    background: url('../img/logo-header-hille.png') left center / contain no-repeat;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .18));
}

@media (max-width: 920px) {
    .brand::before {
        width: min(100%, 410px);
        height: 76px;
    }
}

@media (max-width: 680px) {
    .brand::before {
        width: min(100%, 320px);
        height: 60px;
    }
}

@media (max-width: 470px) {
    .brand::before {
        width: min(100%, 260px);
        height: 52px;
    }
}


/* === Header-Optimierung: breites Logo, Menü darunter === */
.site-header {
    background: rgba(5, 12, 28, .92);
}

.header-inner {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 12px 0 16px;
}

.brand {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
}

.brand::before {
    width: min(100%, 820px);
    height: 132px;
    background-position: center center;
}

.top-nav {
    width: 100%;
    justify-content: center;
    gap: 10px;
}

.top-nav a {
    min-height: 42px;
    padding: 10px 16px;
}

@media (max-width: 920px) {
    .header-inner {
        gap: 10px;
        padding: 10px 0 14px;
    }
    .brand::before {
        width: min(100%, 680px);
        height: 108px;
    }
    .top-nav {
        justify-content: center;
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

@media (max-width: 680px) {
    .brand::before {
        width: min(100%, 500px);
        height: 82px;
    }
    .top-nav {
        gap: 8px;
    }
    .top-nav a {
        min-height: 38px;
        padding: 8px 12px;
    }
}

@media (max-width: 470px) {
    .brand::before {
        width: min(100%, 340px);
        height: 56px;
    }
    .top-nav {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 2px;
    }
}


/* === Feinschliff Header / Smartphone ===
   Größeres Logo, weniger verlorener Leerraum, Menü sauber darunter.
*/
.site-header {
    background: rgba(5, 12, 28, .96);
}

.header-inner {
    width: min(1180px, calc(100% - 24px));
    padding: 10px 0 14px;
}

.brand::before {
    width: min(100%, 900px);
    height: clamp(92px, 12vw, 154px);
    background-image: url('../img/logo-header-hille.png');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    border-radius: 0;
    filter: drop-shadow(0 16px 34px rgba(0, 0, 0, .26));
}

.top-nav {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.top-nav a {
    justify-content: center;
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

.top-nav a.button,
.top-nav a.button.ghost {
    background: rgba(255,255,255,.13);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

@media (max-width: 680px) {
    .site-header {
        position: sticky;
    }

    .header-inner {
        width: min(100% - 20px, 620px);
        gap: 10px;
        padding: 8px 0 12px;
    }

    .brand::before {
        width: min(100%, 450px);
        height: 104px;
    }

    .top-nav {
        width: 100%;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        overflow: visible;
    }

    .top-nav a {
        min-width: 0;
        width: 100%;
        min-height: 40px;
        padding: 9px 8px;
        font-size: clamp(.88rem, 3.6vw, 1rem);
        white-space: nowrap;
    }
}

@media (max-width: 430px) {
    .header-inner {
        width: min(100% - 16px, 410px);
        padding-top: 7px;
    }

    .brand::before {
        width: 100%;
        height: 98px;
    }

    .top-nav {
        gap: 6px;
    }

    .top-nav a {
        min-height: 38px;
        padding: 8px 6px;
        font-size: clamp(.78rem, 3.7vw, .94rem);
        letter-spacing: -.02em;
    }
}

@media (max-width: 360px) {
    .brand::before {
        height: 88px;
    }

    .top-nav {
        grid-template-columns: 1fr;
    }

    .top-nav a {
        font-size: .95rem;
    }
}


/* === Werbeflächen per Datei-Flag komplett ein-/ausschalten === */
.wide-shell.no-left-ad.no-right-ad {
    grid-template-columns: minmax(0, 1120px);
    justify-content: center;
}

.wide-shell.no-left-ad.has-right-ad {
    grid-template-columns: minmax(0, 1120px) minmax(120px, 170px);
}

.wide-shell.has-left-ad.no-right-ad {
    grid-template-columns: minmax(120px, 170px) minmax(0, 1120px);
}

.wide-shell.no-left-ad.no-right-ad .main-content,
.wide-shell.no-left-ad.has-right-ad .main-content,
.wide-shell.has-left-ad.no-right-ad .main-content {
    width: 100%;
}

.ad-card.ad-placeholder span {
    display: none;
}

.ad-card.ad-placeholder strong {
    font-size: 1.18rem;
    color: #1c2535;
}

.ad-card.ad-placeholder small {
    max-width: 14ch;
    line-height: 1.35;
}

@media (max-width: 1250px) {
    .wide-shell.no-left-ad.no-right-ad,
    .wide-shell.no-left-ad.has-right-ad,
    .wide-shell.has-left-ad.no-right-ad {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* === Fix: aktivierte Werbung auch auf iPhone hochkant anzeigen === */
@media (max-width: 470px) {
    .wide-shell.has-left-ad .ad-rail.left,
    .wide-shell.has-right-ad .ad-rail.right {
        display: flex;
        order: 2;
        width: 100%;
        padding-top: 4px;
    }

    .wide-shell.has-right-ad .ad-rail.right {
        order: 3;
    }

    .wide-shell.has-left-ad.has-right-ad .ad-rail.left {
        order: 2;
    }

    .wide-shell.has-left-ad.has-right-ad .ad-rail.right {
        order: 3;
    }

    .wide-shell.has-left-ad .main-content,
    .wide-shell.has-right-ad .main-content {
        order: 1;
    }

    .wide-shell.has-left-ad .ad-card,
    .wide-shell.has-right-ad .ad-card,
    .wide-shell.has-left-ad .ad-card.ad-banner,
    .wide-shell.has-right-ad .ad-card.ad-banner {
        position: relative;
        top: auto;
        width: 100%;
        min-height: 112px;
        max-width: 100%;
        margin: 0 0 16px;
        border-radius: 24px;
        padding: 14px;
        flex-direction: row;
    }

    .wide-shell.has-left-ad .ad-card.ad-banner img,
    .wide-shell.has-right-ad .ad-card.ad-banner img,
    .wide-shell.has-left-ad .ad-card img,
    .wide-shell.has-right-ad .ad-card img {
        max-height: 86px;
        width: auto;
        max-width: min(100%, 320px);
        object-fit: contain;
    }
}


/* === iPhone Hochformat: Registrieren-Button sauber darstellen === */
@media (max-width: 470px) and (orientation: portrait) {
    .top-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        overflow: visible;
    }

    .top-nav a {
        width: 100%;
        min-width: 0;
        justify-content: center;
        text-align: center;
    }

    .top-nav a:nth-child(1) {
        order: 1;
    }

    .top-nav a:nth-child(2) {
        order: 3;
        grid-column: 1 / -1;
    }

    .top-nav a:nth-child(3) {
        order: 2;
    }
}


/* === Automatische Links in Terminbeschreibungen === */
.event-body p a {
    font-weight: 850;
    color: #075fe8;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.event-body p a:hover {
    color: #053f99;
}


/* === Desktop-Layout-Optimierung: breitere, rechteckige Werbung; kompaktere Mittelspalte === */
@media (min-width: 1260px) {
    .wide-shell.has-left-ad.has-right-ad {
        grid-template-columns: minmax(210px, 250px) minmax(0, 920px) minmax(210px, 250px);
        gap: clamp(14px, 1.7vw, 24px);
        width: min(1700px, calc(100% - 34px));
    }

    .wide-shell.has-left-ad.no-right-ad {
        grid-template-columns: minmax(210px, 250px) minmax(0, 980px);
        gap: clamp(14px, 1.7vw, 24px);
        width: min(1360px, calc(100% - 34px));
    }

    .wide-shell.no-left-ad.has-right-ad {
        grid-template-columns: minmax(0, 980px) minmax(210px, 250px);
        gap: clamp(14px, 1.7vw, 24px);
        width: min(1360px, calc(100% - 34px));
    }

    .public-layout .main-content {
        padding-top: 18px;
    }

    .ad-rail {
        padding-top: 18px;
        align-items: flex-start;
    }

    .ad-card,
    .ad-card.ad-banner,
    .ad-banner.ad-card {
        top: calc(var(--header-height) + 18px);
        min-height: 250px;
        max-height: 280px;
        border-radius: 28px;
        padding: 16px;
    }

    .ad-card.ad-banner img,
    .ad-banner.ad-card img,
    .ad-card img {
        width: 100%;
        max-width: 100%;
        max-height: 150px;
        object-fit: contain;
    }

    .hero {
        grid-template-columns: minmax(0, 1.14fr) minmax(250px, .56fr);
        gap: 16px;
        align-items: stretch;
        margin-bottom: 26px;
    }

    .hero-card {
        min-height: 300px;
        padding: 34px 34px 30px;
        border-radius: 34px;
    }

    .hero h1 {
        font-size: clamp(2.85rem, 4.35vw, 4.95rem);
        max-width: 620px;
        margin-bottom: 16px;
    }

    .hero-card h1::before {
        margin-bottom: 14px;
    }

    .hero p {
        margin-bottom: 22px;
        max-width: 580px;
        font-size: 1rem;
        line-height: 1.5;
    }

    .hero-actions {
        gap: 10px;
    }

    .hero .button,
    .hero .button.ghost {
        min-height: 42px;
        padding: 11px 18px;
    }

    .info-tile {
        padding: 24px 22px;
        border-radius: 30px;
    }

    .info-tile h2 {
        margin-bottom: 14px;
        font-size: 1.85rem;
    }

    .info-tile li {
        padding: 8px 0 8px 32px;
    }
}


/* === Werbung: Logo beim Darüberfahren vergrößern === */
.ad-card.ad-banner,
.ad-banner.ad-card {
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.ad-card.ad-banner img,
.ad-banner.ad-card img,
.ad-card img {
    transition: transform .24s ease, filter .24s ease;
    transform-origin: center center;
}

@media (hover: hover) and (pointer: fine) {
    .ad-card.ad-banner:hover,
    .ad-banner.ad-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 26px 70px rgba(0, 0, 0, .20);
    }

    .ad-card.ad-banner:hover img,
    .ad-banner.ad-card:hover img {
        transform: scale(1.22);
        filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .22));
    }
}


/* === Werbung: stärkerer Hover-Zoom für bessere Lesbarkeit === */
@media (hover: hover) and (pointer: fine) {
    .ad-rail {
        position: relative;
        z-index: 1;
    }

    .ad-card.ad-banner,
    .ad-banner.ad-card {
        overflow: visible;
    }

    .ad-card.ad-banner:hover,
    .ad-banner.ad-card:hover {
        z-index: 5;
    }

    .ad-card.ad-banner:hover img,
    .ad-banner.ad-card:hover img {
        transform: scale(1.48);
        filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .24));
    }
}


/* === Werbung: Hover-Zoom extra groß === */
@media (hover: hover) and (pointer: fine) {
    .ad-card.ad-banner:hover img,
    .ad-banner.ad-card:hover img {
        transform: scale(2.0);
        filter: drop-shadow(0 22px 36px rgba(0, 0, 0, .28));
    }

    .ad-card.ad-banner:hover,
    .ad-banner.ad-card:hover {
        z-index: 12;
    }

    .ad-rail {
        z-index: 2;
    }
}


/* === Hero-Titel dezenter: "Was ist los in Hille?" kleiner === */
.hero h1 {
    font-size: clamp(2.25rem, 3.7vw, 4.1rem);
    line-height: .95;
    letter-spacing: -.055em;
    max-width: 560px;
}

.hero-card {
    min-height: 260px;
}

.hero p {
    max-width: 620px;
    font-size: clamp(.98rem, 1.15vw, 1.1rem);
}

@media (min-width: 1260px) {
    .hero h1 {
        font-size: clamp(2.2rem, 3.15vw, 3.75rem);
        max-width: 520px;
        margin-bottom: 14px;
    }

    .hero-card {
        min-height: 260px;
        padding-top: 30px;
        padding-bottom: 28px;
    }
}

@media (max-width: 680px) {
    .hero h1 {
        font-size: clamp(2.15rem, 9.5vw, 3.15rem);
        line-height: .96;
    }
}

@media (max-width: 470px) {
    .hero h1 {
        font-size: clamp(2rem, 10vw, 2.9rem);
    }
}


/* === Footer-Impressum === */
.footer-links {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.impressum-content {
    max-width: 840px;
}

.impressum-content h1 {
    margin-bottom: 18px;
}

.impressum-content h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.impressum-content p {
    line-height: 1.65;
    color: var(--text-soft);
}

.impressum-box {
    padding: 18px;
    border-radius: 20px;
    background: rgba(8, 17, 36, .045);
    border: 1px solid rgba(16, 23, 39, .10);
}


/* === Datenschutzerklärung === */
.privacy-content {
    max-width: 920px;
}

.privacy-content h1 {
    margin-bottom: 18px;
}

.privacy-content h2 {
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

.privacy-content h3 {
    margin-top: 22px;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.privacy-content p,
.privacy-content li {
    line-height: 1.68;
    color: var(--text-soft);
}

.privacy-content ul {
    padding-left: 1.25rem;
}

.privacy-box {
    padding: 18px;
    border-radius: 20px;
    background: rgba(8, 17, 36, .045);
    border: 1px solid rgba(16, 23, 39, .10);
}
