:root {
    --farbe-primaer: #1b6ec2;
    --farbe-primaer-dunkel: #14538f;
    --farbe-akzent: #f0a500;
    --farbe-dunkel: #1f2937;
    --farbe-grau: #6b7280;
    --farbe-hellgrau: #f4f6f8;
    --farbe-rahmen: #e2e8f0;
    --schatten: 0 2px 8px rgba(0, 0, 0, 0.08);
    --schatten-stark: 0 6px 20px rgba(0, 0, 0, 0.12);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--farbe-dunkel);
    line-height: 1.6;
    background: #fff;
    overflow-x: clip;
}

a {
    color: var(--farbe-primaer);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 3rem 0;
}

.section-alt {
    background: var(--farbe-hellgrau);
}

.section-title {
    font-size: 1.9rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--farbe-grau); }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    justify-content: center;
    padding: .55rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn-lg { padding: .75rem 1.6rem; font-size: 1.1rem; }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }

.btn-primary { background: var(--farbe-primaer); color: #fff; border-color: var(--farbe-primaer); }
.btn-primary:hover { background: var(--farbe-primaer-dunkel); color: #fff; }
.btn-outline-primary { background: transparent; color: var(--farbe-primaer); border-color: var(--farbe-primaer); }
.btn-outline-primary:hover { background: var(--farbe-primaer); color: #fff; }
.btn-secondary { background: #6b7280; color: #fff; }
.btn-outline-secondary { background: transparent; color: #4b5563; border-color: #cbd5e1; }
.btn-outline-secondary:hover { background: #eef2f7; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline-success { background: transparent; color: #16a34a; border-color: #16a34a; }
.btn-outline-success:hover { background: #16a34a; color: #fff; }
.btn-outline-warning { background: transparent; color: #d97706; border-color: #d97706; }
.btn-outline-warning:hover { background: #d97706; color: #fff; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn-outline-light:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-light { background: #fff; color: var(--farbe-primaer); }
.btn:disabled { opacity: .65; cursor: not-allowed; }

/* ---------- Öffentliche Navigation ---------- */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    box-shadow: var(--schatten);
}

.navbar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: .8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--farbe-dunkel);
}
.navbar-brand:hover { text-decoration: none; }
.brand-logo { max-height: 42px; }

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--farbe-dunkel);
    font-weight: 500;
    padding: .3rem 0;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--farbe-primaer); text-decoration: none; }
.nav-link.active { color: var(--farbe-primaer); border-bottom-color: var(--farbe-primaer); }

.nav-toggle { display: none; }
.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: .55rem;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
}
.nav-toggle-label span { width: 26px; height: 3px; background: var(--farbe-dunkel); border-radius: 2px; }

@media (max-width: 800px) {
    .nav-toggle-label { display: flex; }
    .nav-links {
        flex-basis: 100%;
        flex-direction: column;
        gap: .4rem;
        max-height: 0;
        overflow: hidden;
        transition: max-height .25s ease;
    }
    .nav-toggle:checked ~ .nav-links { max-height: 400px; margin-top: .6rem; }
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--farbe-primaer), var(--farbe-primaer-dunkel));
    background-size: cover;
    background-position: center;
    color: #fff;
}
.hero-overlay { padding: 5rem 0; }
.hero-content { text-align: center; }
.hero-content h1 { font-size: 2.8rem; margin: 0 0 1rem; }
.hero-subtitle { font-size: 1.3rem; margin-bottom: 1.8rem; opacity: .95; }

/* ---------- Cards ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.card-item {
    background: #fff;
    border: 1px solid var(--farbe-rahmen);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--schatten);
    transition: transform .15s ease, box-shadow .15s ease;
    display: flex;
    flex-direction: column;
}
.card-item:hover { transform: translateY(-3px); box-shadow: var(--schatten-stark); }
.card-img { width: 100%; height: 190px; object-fit: cover; }
.card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin: 0 0 .6rem; font-size: 1.25rem; }
.card-date { display: block; font-size: .85rem; color: var(--farbe-grau); margin-bottom: .3rem; }
.card-link { margin-top: auto; font-weight: 600; }

.intro-text { max-width: 800px; margin: 0 auto; text-align: center; font-size: 1.15rem; }

/* ---------- CTA ---------- */
.cta-band { background: var(--farbe-dunkel); color: #fff; padding: 3rem 0; }
.cta-inner { text-align: center; }
.cta-inner h2 { margin-top: 0; }

/* ---------- Inhaltsseiten ---------- */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 2.3rem; margin: 0 0 .5rem; }
.lead { font-size: 1.2rem; color: var(--farbe-grau); }
.content-page { max-width: 860px; }
.content-image { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin: 1rem 0 1.5rem; }
.content-body { font-size: 1.05rem; }
.breadcrumb-nav { font-size: .9rem; color: var(--farbe-grau); margin-bottom: 1rem; }

/* ---------- Kontakt ---------- */
.kontakt-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2.5rem; }
.kontakt-liste { list-style: none; padding: 0; }
.kontakt-liste li { padding: .3rem 0; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 768px) { .kontakt-grid { grid-template-columns: 1fr; } }

/* ---------- Formulare ---------- */
.form-label { display: block; font-weight: 600; margin-bottom: .35rem; }
.form-control, .form-select {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
}
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--farbe-primaer);
    box-shadow: 0 0 0 3px rgba(27, 110, 194, .15);
}
.form-control-sm { padding: .3rem .5rem; font-size: .85rem; }
.form-select-sm { padding: .3rem 1.5rem .3rem .5rem; font-size: .85rem; }
.form-text { font-size: .85rem; color: var(--farbe-grau); margin-top: .25rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-2 { margin-bottom: .5rem; }
textarea.form-control { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-check { display: flex; align-items: flex-start; gap: .5rem; }
.form-check-input { width: 1.1rem; height: 1.1rem; margin-top: .3rem; }
.form-check-label { font-weight: 400; }
.form-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.input-group { display: flex; gap: .5rem; }
.input-group .form-select { flex: 1; }

.text-danger { color: #dc2626; font-size: .9rem; }

/* ---------- Alerts ---------- */
.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .25em .6em; font-size: .78rem; border-radius: 999px; color: #fff; }
.bg-success { background: #16a34a; }
.bg-secondary { background: #6b7280; }
.bg-primary { background: var(--farbe-primaer); }

/* ---------- Footer ---------- */
.site-footer { background: var(--farbe-dunkel); color: #d1d5db; margin-top: auto; }
.footer-grid {
    max-width: 1140px;
    margin: 0 auto;
    padding: 3rem 1rem 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.site-footer h3 { color: #fff; font-size: 1.1rem; margin-bottom: .8rem; }
.site-footer a { color: #d1d5db; }
.site-footer a:hover { color: #fff; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { padding: .2rem 0; }
.footer-social { display: flex; gap: 1rem; margin-top: .8rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); text-align: center; padding: 1rem; font-size: .9rem; }

/* ---------- Auth-Karte ---------- */
.auth-card {
    max-width: 420px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border: 1px solid var(--farbe-rahmen);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
}

/* ---------- Spinner ---------- */
.spinner-border {
    display: inline-block;
    width: 1.2rem;
    height: 1.2rem;
    border: .2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: text-bottom;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .15em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ ADMIN ============ */
.admin-wrapper { display: flex; min-height: 100vh; background: var(--farbe-hellgrau); }
.admin-nav-toggle { display: none; }

.admin-sidebar {
    width: 260px;
    background: var(--farbe-dunkel);
    color: #cbd5e1;
    flex-shrink: 0;
}
.admin-nav { display: flex; flex-direction: column; height: 100%; padding: 1rem 0; position: sticky; top: 0; }
.admin-brand { padding: .5rem 1.5rem 1.2rem; font-size: 1.3rem; font-weight: 700; }
.admin-brand a { color: #fff; }
.admin-nav ul { list-style: none; padding: 0; margin: 0; flex: 1; }
.admin-link {
    display: block;
    padding: .7rem 1.5rem;
    color: #cbd5e1;
    border-left: 3px solid transparent;
}
.admin-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.admin-link.active { background: rgba(27,110,194,.25); color: #fff; border-left-color: var(--farbe-primaer); }
.admin-nav-footer { padding: 1rem 1.5rem 0; border-top: 1px solid rgba(255,255,255,.1); }

.admin-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    background: var(--farbe-primaer-dunkel);
    color: #fff;
    padding: .8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.admin-topbar-title { font-weight: 600; }
.admin-user { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.admin-username { font-size: .9rem; }
.logout-form { margin: 0; }
.admin-burger { display: none; flex-direction: column; gap: 4px; cursor: pointer; }
.admin-burger span { width: 22px; height: 3px; background: #fff; border-radius: 2px; }

.admin-main { padding: 2rem; flex: 1; }
.admin-page-header { margin-bottom: 1.5rem; }
.admin-page-header h1 { font-size: 1.8rem; margin: 0; }
.admin-header-flex { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.back-link { display: inline-block; margin-bottom: .5rem; font-size: .9rem; }

.admin-card {
    background: #fff;
    border: 1px solid var(--farbe-rahmen);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--schatten);
    margin-bottom: 1.5rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--farbe-rahmen);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--schatten);
}
.stat-number { display: block; font-size: 2.2rem; font-weight: 700; color: var(--farbe-primaer); }
.stat-label { color: var(--farbe-grau); font-size: .95rem; }

.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .admin-columns { grid-template-columns: 1fr; } }
.recent-list { list-style: none; padding: 0; margin: 0; }
.recent-list li { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--farbe-rahmen); gap: 1rem; }
.recent-meta { color: var(--farbe-grau); font-size: .85rem; white-space: nowrap; }
.quick-links { display: flex; flex-wrap: wrap; gap: .6rem; }

/* Tabellen */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { padding: .7rem .75rem; border-bottom: 1px solid var(--farbe-rahmen); text-align: left; vertical-align: middle; }
.admin-table thead th { background: var(--farbe-hellgrau); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--farbe-grau); }
.table-actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
code { background: #f1f5f9; padding: .1rem .35rem; border-radius: 4px; font-size: .85em; }

.filter-bar { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-bar .form-control { max-width: 320px; }
.filter-bar .form-select { max-width: 220px; }

/* Medien – Drag & Drop Upload */
.upload-dropzone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 1.75rem 1.25rem;
    border: 2px dashed var(--farbe-rahmen);
    border-radius: var(--radius);
    background: var(--farbe-hellgrau);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.upload-dropzone.is-dragover {
    border-color: var(--farbe-primaer);
    background: #eff6ff;
    box-shadow: inset 0 0 0 1px var(--farbe-primaer);
}
.upload-dropzone.is-busy {
    opacity: .75;
    pointer-events: none;
}
.upload-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}
.upload-dropzone-content {
    text-align: center;
    pointer-events: none;
    z-index: 1;
}
.upload-dropzone-title {
    margin: .5rem 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--farbe-dunkel);
}
.upload-dropzone-hint {
    margin: .25rem 0 0;
    color: var(--farbe-grau);
    font-size: .95rem;
}
.theme-warm .upload-dropzone.is-dragover {
    background: #f3e6d4;
}

/* Medien */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.media-item { background: #fff; border: 1px solid var(--farbe-rahmen); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.media-item img { width: 100%; height: 160px; object-fit: cover; background: #f1f5f9; }
.media-meta { padding: .8rem; }
.media-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-details { font-size: .8rem; color: var(--farbe-grau); margin-bottom: .6rem; }
.small { font-size: .8rem; }

/* Bildauswahl */
.bildauswahl-preview { margin-top: .6rem; max-height: 120px; border-radius: 6px; border: 1px solid var(--farbe-rahmen); }

/* Vorschau */
.vorschau-box { background: #fff; border: 1px dashed var(--farbe-primaer); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; }

/* Kontaktanfragen Master-Detail */
.master-detail { display: grid; grid-template-columns: 360px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .master-detail { grid-template-columns: 1fr; } }
.anfrage-liste { list-style: none; padding: 0; margin: 0; background: #fff; border: 1px solid var(--farbe-rahmen); border-radius: var(--radius); overflow: hidden; }
.anfrage-liste li button { display: flex; flex-direction: column; gap: .15rem; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--farbe-rahmen); padding: .8rem 1rem; cursor: pointer; }
.anfrage-liste li.aktiv button { background: #eff6ff; }
.anfrage-liste li.ungelesen .anfrage-betreff { font-weight: 700; }
.anfrage-betreff { font-size: 1rem; }
.anfrage-von, .anfrage-datum { font-size: .8rem; color: var(--farbe-grau); }
.anfrage-detail { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.anfrage-detail dt { font-weight: 600; color: var(--farbe-grau); }
.anfrage-detail dd { margin: 0; }
.anfrage-nachricht { background: var(--farbe-hellgrau); padding: 1rem; border-radius: var(--radius); }
.detail-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 1.8rem; max-width: 460px; width: 100%; box-shadow: var(--schatten-stark); }
.modal-box h3 { margin-top: 0; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }

/* Layout & Farben Modal */
.layout-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    border: 1px solid var(--farbe-rahmen);
    border-radius: var(--radius);
    background: var(--farbe-hellgrau);
}
.layout-summary-swatches { display: flex; gap: .35rem; }
.layout-summary-swatches span {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.12);
}
.layout-summary > div { flex: 1; min-width: 180px; }
.layout-modal { max-width: 720px; position: relative; }
.layout-modal-close {
    position: absolute;
    top: .8rem;
    right: .9rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--farbe-grau);
}
.layout-modal-subtitle {
    margin: 1.2rem 0 .7rem;
    font-size: 1rem;
}
.layout-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}
.layout-choice {
    text-align: left;
    border: 1px solid var(--farbe-rahmen);
    border-radius: var(--radius);
    background: #fff;
    padding: .9rem;
    cursor: pointer;
    display: grid;
    gap: .35rem;
}
.layout-choice.is-selected {
    border-color: var(--farbe-primaer);
    box-shadow: 0 0 0 2px rgba(27, 110, 194, .15);
}
.layout-choice strong { color: var(--farbe-dunkel); }
.layout-choice small { color: var(--farbe-grau); }
.layout-choice-preview {
    display: block;
    height: 72px;
    border-radius: 8px;
    border: 1px solid var(--farbe-rahmen);
    background: var(--preview-bg, #fff);
}
.classic-preview {
    background:
        linear-gradient(var(--preview-accent, #1b6ec2), var(--preview-accent, #1b6ec2)) top/100% 28% no-repeat,
        var(--preview-bg, #fff);
}
.warm-preview {
    background:
        radial-gradient(circle at 50% 40%, var(--preview-accent, #d49519) 0 18%, transparent 19%),
        linear-gradient(180deg, #00000022, #00000033),
        var(--preview-bg, #fffaf1);
}
.color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem 1rem;
}
.color-field {
    display: grid;
    gap: .35rem;
    font-weight: 600;
    font-size: .9rem;
}
.color-inputs {
    display: flex;
    gap: .5rem;
    align-items: center;
}
.color-inputs input[type="color"] {
    width: 42px;
    height: 38px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
.layout-modal-preview {
    margin-top: 1.2rem;
    padding: 1rem;
    border-radius: 12px;
    background: var(--preview-bg);
    border: 1px solid var(--preview-border);
}
.layout-modal-preview-card {
    background: var(--preview-surface);
    border: 1px solid var(--preview-border);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    box-shadow: 0 8px 18px rgba(0,0,0,.06);
}
.layout-modal-preview-brand {
    display: block;
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--preview-muted);
    margin-bottom: .4rem;
}
.layout-modal-preview-card strong { color: var(--preview-text); display: block; margin-bottom: .35rem; }
.layout-modal-preview-card p { color: var(--preview-muted); margin: 0 0 .8rem; }
.layout-modal-preview-btn {
    display: inline-block;
    background: var(--preview-accent);
    color: #fff;
    padding: .4rem .9rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
}
@media (max-width: 640px) {
    .layout-choice-grid,
    .color-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .admin-sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 500;
    }
    .admin-nav-toggle:checked ~ .admin-sidebar { transform: translateX(0); }
    .admin-burger { display: flex; }
    .admin-main { padding: 1rem; }
}

/* Validierung (Blazor) */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; font-size: .9rem; }

/* ============================================================
   LAYOUT "warm" – zentrierte Landingpage mit Kacheln
   ============================================================ */
.theme-warm {
    --bg: #fffaf1;
    --surface: #ffffff;
    --text: #2e2416;
    --muted: #6f5f44;
    --accent: #d49519;
    --border: #f0dfbf;
    --farbe-primaer: #d49519;
    --farbe-primaer-dunkel: #b6780f;
    --farbe-akzent: #d49519;
    --farbe-dunkel: #2e2416;
    --farbe-grau: #6f5f44;
    --farbe-hellgrau: #fffaf1;
    --farbe-rahmen: #f0dfbf;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
}

.theme-warm a { color: inherit; text-decoration: none; }
.theme-warm h1,
.theme-warm h2 { margin: 0 0 0.6rem 0; font-weight: 600; }
.theme-warm p { margin: 0 0 0.8rem 0; color: var(--muted); }

.misteli-main { flex: 1; }

/* Programmatic focus after navigation (FocusOnNavigate) — no visible ring on landmarks/hero */
.misteli-main:focus,
.site-main:focus,
.misteli-hero-overlay h1:focus,
.hero-content h1:focus {
    outline: none;
}

.misteli-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.6rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.misteli-header {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-bottom: 1.8rem;
    border-bottom: 1px solid var(--border);
}

.misteli-top-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.misteli-brand {
    font-weight: 600;
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--text);
}
.misteli-brand:hover { color: var(--accent); }

.misteli-nav-toggle { display: none; }
.misteli-nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 0.55rem;
    margin: 0;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    min-width: 44px;
    min-height: 44px;
}
.misteli-nav-toggle-label span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.misteli-nav-toggle:checked + .misteli-nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.misteli-nav-toggle:checked + .misteli-nav-toggle-label span:nth-child(2) {
    opacity: 0;
}
.misteli-nav-toggle:checked + .misteli-nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.misteli-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    color: var(--muted);
}
.misteli-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.2rem 0;
}
.misteli-nav a:hover { color: var(--accent); }

.misteli-hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    height: 260px;
    box-shadow: 0 14px 28px rgba(46, 36, 22, 0.18);
}
.misteli-hero img,
.misteli-hero-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.misteli-hero-fallback {
    background: linear-gradient(135deg, var(--accent), var(--farbe-primaer-dunkel));
}
.misteli-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: #f7f1e3;
}
.misteli-hero-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.42));
    z-index: 0;
}
.misteli-hero-overlay > * { position: relative; z-index: 1; }
.misteli-hero-overlay h1 {
    color: #f7f1e3;
    font-size: 1.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16rem;
    margin: 0;
}
/* Beat .theme-warm p { color: var(--muted) } so hero text stays light and readable */
.theme-warm .misteli-hero-overlay p,
.misteli-site-name,
.misteli-subtitle {
    color: #f7f1e3;
}
.misteli-site-name {
    margin: 0 0 0.4rem 0;
    font-size: 0.7rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    font-weight: 600;
}
.misteli-subtitle {
    margin: 0.3rem 0 0;
    font-size: 1rem;
}

.misteli-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem 1.7rem;
    box-shadow: 0 10px 24px rgba(46, 36, 22, 0.08);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 1.6rem;
    align-items: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.misteli-section h2 { font-size: 1.2rem; color: var(--text); }
.home-page .misteli-section:nth-of-type(even) { background: #fff5df; }
.misteli-section-single { grid-template-columns: 1fr; }
.misteli-body { color: var(--muted); font-size: 1.02rem; line-height: 1.65; }
.misteli-body p { color: var(--muted); }

.misteli-media {
    width: 220px;
    height: 165px;
    margin-left: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(46, 36, 22, 0.12);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}
.misteli-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.misteli-media-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff5df;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
    border-radius: 8px;
}

.home-page .misteli-section > *:not(.misteli-tile-link) {
    position: relative;
    z-index: 1;
    pointer-events: none;
}
.misteli-tile-link {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    z-index: 2;
    cursor: pointer;
    display: block;
}
.misteli-tile-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.home-page .misteli-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(46, 36, 22, 0.16);
}

.misteli-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    width: 100%;
}
.misteli-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(46, 36, 22, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.misteli-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(46, 36, 22, 0.14);
    text-decoration: none;
}
.misteli-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
}
.misteli-card-body { padding: 1rem 1.2rem 1.2rem; }
.misteli-card-body h2 { font-size: 1.05rem; margin-bottom: 0.6rem; color: var(--text); }
.misteli-card-body time { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.35rem; }
.misteli-card-body p { margin: 0; }

.misteli-intern-link { text-align: center; font-weight: 600; margin: 1rem 0 0; }
.misteli-intern-link a { color: var(--accent); }
.misteli-intern-link a:hover { color: #b6780f; text-decoration: underline; }

.misteli-footer {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.2rem 1.6rem 2.5rem;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 0.04rem;
    color: var(--muted);
}
.misteli-footer p { margin: 0.6rem 0 0; color: var(--muted); }
.misteli-footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.misteli-footer-nav a:hover { color: var(--accent); }

.theme-warm .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.theme-warm .btn-primary:hover {
    background: #b6780f;
    border-color: #b6780f;
    color: #fff;
}

@media (max-width: 768px) {
    .misteli-page {
        padding: 1.25rem 1rem 1.5rem;
        gap: 1.4rem;
    }
    .misteli-footer { padding: 1rem 1rem 2rem; }
    .misteli-header { gap: 1rem; padding-bottom: 1rem; }

    .misteli-top-bar {
        justify-content: space-between;
        text-align: left;
        gap: 0.5rem;
        position: sticky;
        top: 0;
        z-index: 200;
        background: var(--bg);
        padding: 0.65rem 0;
        margin: -0.25rem 0 0;
    }
    .misteli-brand {
        font-size: 0.8rem;
        flex: 1;
        min-width: 0;
        padding-right: 0.5rem;
    }
    .misteli-nav-toggle-label { display: flex; }

    .misteli-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-top: 0.5rem;
        padding: 0.4rem 0;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-shadow: 0 10px 24px rgba(46, 36, 22, 0.1);
    }
    .misteli-nav a {
        min-height: 48px;
        padding: 0.85rem 1.1rem;
        border-bottom: 1px solid var(--border);
        letter-spacing: 0.06rem;
    }
    .misteli-nav a:last-child { border-bottom: none; }
    .misteli-nav-toggle:checked ~ .misteli-nav { display: flex; }

    .misteli-hero {
        height: auto;
        min-height: 200px;
        aspect-ratio: 16 / 10;
        border-radius: 12px;
    }
    .misteli-hero-overlay { padding: 1rem 0.85rem; }
    .misteli-hero-overlay h1 {
        font-size: 1.25rem;
        letter-spacing: 0.1rem;
        line-height: 1.25;
        word-break: break-word;
    }
    .misteli-site-name { font-size: 0.65rem; }
    .misteli-subtitle { font-size: 0.9rem; }

    .misteli-section {
        grid-template-columns: 1fr;
        padding: 1.15rem 1.1rem;
        gap: 1.1rem;
    }
    .misteli-section h2 { font-size: 1.1rem; }
    .misteli-media {
        width: 100%;
        max-width: 280px;
        height: 180px;
        margin: 0 auto;
    }
    .misteli-card-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }
    .misteli-card img { height: 180px; }
    .home-page .misteli-section:hover {
        transform: none;
    }
}

@media (max-width: 400px) {
    .misteli-hero-overlay h1 { font-size: 1.05rem; letter-spacing: 0.06rem; }
    .misteli-brand { font-size: 0.72rem; }
}

/* ---------- Classic theme mobile ---------- */
@media (max-width: 768px) {
    .hero-overlay { padding: 3rem 0; }
    .hero-content h1 { font-size: 1.85rem; line-height: 1.25; }
    .hero-subtitle { font-size: 1.05rem; margin-bottom: 1.2rem; }
    .section { padding: 2rem 0; }
    .section-title { font-size: 1.45rem; }
    .page-header h1 { font-size: 1.7rem; }
    .lead { font-size: 1.05rem; }
    .intro-text { font-size: 1.05rem; }
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.1rem;
    }
    .cta-band { padding: 2rem 0; }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1rem 1rem;
    }
    .nav-link {
        display: block;
        padding: 0.75rem 0;
        min-height: 44px;
    }
    .brand-logo { max-height: 36px; }
    .content-image { max-height: 260px; }
}

/* Blazor Fehleranzeige */
#blazor-error-ui {
    background: #ffebee;
    color: #b71c1c;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1050;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten."; }
