/* ── Header ─────────────────────────────────────── */

.site-header {
    background: var(--color-primary-dark) url('/assets/images/schmuckbild_aepfel.jpg') center / cover no-repeat;
    color: #fff;
    position: relative;
}

.site-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(30, 50, 25, 0.75);
}

.site-header > .container {
    position: relative;
}
.site-title-bar {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: #fff;
}

.logo-link:hover {
    color: #fff;
}

.logo-img {
    flex-shrink: 0;
    background: #fff;
    padding: 2px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.nav-bar {
    display: flex;
    justify-content: flex-start;
}

.main-nav ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.nav-link {
    display: block;
    padding: 0.6rem 1rem 0.6rem 0;
    margin-right: 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.5);
}

.nav-link.active {
    color: #fff;
    border-bottom-color: #fff;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin: 0.3rem auto;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 4px 0;
}

@media (max-width: 640px) {
    .logo-text {
        font-size: 1rem;
    }

    .logo-img {
        width: 45px !important;
        height: auto !important;
    }

    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        border-bottom: none;
    }

    .nav-link.active {
        border-bottom: none;
        text-decoration: underline;
    }

    .nav-link.has-dropdown::after {
        display: none;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        padding: 0;
        min-width: 0;
        text-align: center;
        transition: none;
    }

    .dropdown-menu::before {
        display: none;
    }

    .dropdown-link {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
        opacity: 0.85;
    }
}

/* ── Cards ──────────────────────────────────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.card-media-link {
    display: block;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.card-media-link:focus-visible {
    outline: 2px solid var(--color-primary-dark);
    outline-offset: -2px;
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.card-image-placeholder {
    width: 100%;
    height: 180px;
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-light);
    font-size: 2.5rem;
}

.card-body {
    padding: 1rem 1.2rem;
}

.card-date {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.3rem;
}

.card-body h3 {
    margin-bottom: 0.3rem;
}

.card-body h3 a {
    color: var(--color-primary-dark);
    text-decoration: none;
}

.card-body h3 a:hover {
    text-decoration: underline;
}

.card-body p {
    color: var(--color-text-light);
    font-size: 0.93rem;
    margin-bottom: 0.5rem;
}

.read-more {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Buttons ────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary-dark);
}

.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ── Tables ─────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--color-border);
}

.data-table thead {
    background: var(--color-primary-dark);
    color: #fff;
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.8rem;
    text-align: left;
    border: 1px solid var(--color-border);
}

.data-table th {
    font-weight: 600;
    font-size: 0.88rem;
}

.data-table tbody tr:nth-child(even) {
    background: var(--color-bg-alt);
}

@media (max-width: 640px) {
    .data-table {
        font-size: 0.88rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* ── Forms ──────────────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 1px solid var(--color-border);
    background: #fff;
}

.form-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: -1px;
}

.alert {
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    border: 1px solid;
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: #daa;
}

/* ── Login ──────────────────────────────────────── */

.login-wrapper {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 2rem;
    width: 100%;
    max-width: 380px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
}

/* ── Footer ─────────────────────────────────────── */

.site-footer {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: 1.5rem 0;
    margin-top: 2rem;
    font-size: 0.9rem;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    
}

.footer-col {
    min-width: 160px;
}

.site-footer h4 {
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.site-footer p {
    margin-bottom: 0.3rem;
}

.site-footer ul {
    list-style: none;
    padding: 0;
}

.site-footer li {
    margin-bottom: 0.2rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.copyright {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
}

/* ── Article Detail ─────────────────────────────── */

.article-detail {
    max-width: 720px;
    margin: 0 auto;
}

.article-detail img {
    margin-bottom: 1rem;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ── Admin Dashboard ────────────────────────────── */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.2rem;
}

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 1.2rem;
}

.dashboard-card h3 {
    margin-bottom: 0.3rem;
}

.dashboard-card p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ── Download Section ───────────────────────────── */

.download-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    max-width: 420px;
    margin-top: 1rem;
}

.download-box h3 {
    margin-bottom: 0.3rem;
}

.download-box p {
    margin-bottom: 0.8rem;
    color: var(--color-text-light);
    font-size: 0.93rem;
}

.download-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* ── Info Box (Geräte-Kontakt) ──────────────────── */

.info-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.5rem;
}

.info-box h2 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.info-box p {
    margin-bottom: 0.4rem;
    font-size: 0.93rem;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* ── Geräte Table ───────────────────────────────── */

.table-scroll {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.geraete-table th:first-child,
.geraete-table td:first-child {
    width: 45px;
    text-align: center;
}

.gebuehr-cell {
    white-space: nowrap;
}

.badge-free {
    font-weight: 600;
    color: var(--color-primary);
}

/* ── Extras / Tags ──────────────────────────────── */

.extras-section {
    margin-bottom: 1.5rem;
}

.extras-block {
    margin-bottom: 1.2rem;
}

.extras-block h3 {
    margin-bottom: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    font-size: 0.88rem;
}

.tag-accent {
    background: #e8f0d8;
    border-color: #b5cc8e;
}

/* ── Hinweise ───────────────────────────────────── */

.hinweise-box {
    background: #fdf8e8;
    border: 1px solid #d6c880;
    padding: 1.2rem 1.4rem;
    margin-top: 1rem;
}

.hinweise-box h3 {
    color: #6b5b00;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.hinweise-box ul {
    list-style: disc;
    padding-left: 1.4rem;
}

.hinweise-box li {
    font-size: 0.93rem;
    color: #555;
    margin-bottom: 0.2rem;
}

/* ── Admin ──────────────────────────────────────── */

.admin-actions {
    white-space: nowrap;
}

.admin-actions a {
    margin-right: 0.8rem;
    font-size: 0.9rem;
}

.inline-form {
    display: inline;
}

.link-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.link-btn-danger {
    color: var(--color-error);
}

.link-btn-danger:hover {
    color: #700;
}

.admin-form-wrap {
    max-width: 640px;
}

.admin-form-wrap.admin-form-wide {
    max-width: 980px;
}

.admin-form-wrap textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1.2rem;
    align-items: center;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.form-input-narrow {
    max-width: 220px;
}

.image-preview {
    margin-top: 0.6rem;
}

.image-preview img {
    max-width: 240px;
    max-height: 160px;
    border: 1px solid var(--color-border);
    margin-bottom: 0.4rem;
}

.image-preview label {
    display: block;
    font-size: 0.9rem;
    cursor: pointer;
}

.media-picker-current {
    margin-top: 0.4rem;
}

.media-picker-preview {
    display: inline-flex;
    flex-direction: column;
    gap: 0.35rem;
}

.media-picker-preview code {
    max-width: 360px;
    word-break: break-all;
    color: var(--color-text-light);
    font-size: 0.78rem;
}

.media-picker-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.media-picker-upload {
    cursor: pointer;
}

.media-picker-upload input {
    display: none;
}

.media-picker-status {
    margin-top: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.media-picker-status-error {
    color: #9b1c1c;
}

.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.media-picker-grid[hidden] {
    display: none;
}

.media-picker-tile {
    padding: 0;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.media-picker-tile:hover,
.media-picker-tile:focus-visible,
.media-picker-tile.is-selected {
    border-color: var(--color-primary);
    outline: none;
}

.media-picker-tile img {
    display: block;
    width: 100%;
    height: 105px;
    object-fit: cover;
}

.media-picker-tile span {
    display: block;
    padding: 0.35rem 0.45rem;
    color: var(--color-text-light);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Admin Layout Helpers ────────────────────────── */

.admin-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.admin-section-head-spacer {
    margin-top: 2.4rem;
}

.admin-section-head h2 {
    margin: 0;
}

.admin-table {
    margin-bottom: 1.5rem;
}

.logout-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.logout-link:hover {
    color: #fff;
}

.page-header strong {
    color: #fff;
}

.admin-section-intro {
    color: var(--color-text-light);
    margin-bottom: 1rem;
    max-width: 70ch;
}

.admin-meta {
    margin-top: 1.5rem;
    color: var(--color-text-light);
    font-size: 0.85rem;
}

.admin-empty-state {
    color: var(--color-text-light);
    background: var(--color-bg-alt);
    border: 1px dashed var(--color-border);
    border-radius: 4px;
    padding: 1.5rem;
    text-align: center;
}

/* Page-Edit Metadata Fieldset */
.page-edit-meta {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    background: var(--color-surface, #fff);
}

.page-edit-meta legend {
    padding: 0 0.5rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Dashboard Cards (clickable) ─────────────────── */

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 1.1rem 1.2rem;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.dashboard-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

a.dashboard-card:hover,
a.dashboard-card:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 4px 14px rgba(58, 106, 46, 0.12);
    transform: translateY(-1px);
    outline: none;
}

a.dashboard-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.dashboard-card h3 {
    margin-bottom: 0.3rem;
    color: var(--color-primary-dark);
}

.dashboard-card p {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ── Media Library ──────────────────────────────── */

.media-upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    background: var(--color-bg-alt);
    transition: border-color 0.15s, background 0.15s;
}

.media-upload-zone.drag-over {
    border-color: var(--color-primary);
    background: #eef5e6;
}

.media-upload-zone form {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.media-hint {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 0.6rem;
    margin-bottom: 0;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.media-tile {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.media-tile:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.media-tile img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.media-tile-info {
    padding: 0.55rem 0.75rem 0.7rem;
    font-size: 0.85rem;
}

.media-tile-info code {
    display: block;
    font-size: 0.72rem;
    word-break: break-all;
    color: var(--color-text-light);
    background: var(--color-bg-alt);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-bottom: 0.35rem;
}

.media-tile-meta {
    color: var(--color-text-light);
    font-size: 0.78rem;
    margin-bottom: 0.45rem;
}

.media-tile-actions {
    display: flex;
    gap: 0.6rem;
    justify-content: space-between;
    align-items: center;
}

/* ── Tabellen-Hint für leere Werte ───────────────── */

.text-muted {
    color: var(--color-text-light);
}

.text-muted-inline {
    color: var(--color-text-light);
    font-size: 0.95em;
}

.alert-success {
    background: #e8f5e0;
    color: #2a6e1a;
    border: 1px solid #a8d89a;
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
/* ── Header Grid (Logo + Text + Wappen) ─────────── */

.header-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8rem;
}

.header-cell {
    display: flex;
    align-items: center;
}

.header-logo a {
    display: flex;
    align-items: center;
}

.header-text {
    color: #fff;
}

.wappen-img {
    width: 50px;
    height: auto;
    background: #fff;
    padding: 2px;
    border-radius: 3px;
}

@media (max-width: 640px) {
    .header-grid {
        gap: 0.5rem;
    }

    .wappen-img {
        width: 35px;
    }
}

/* ── Dropdown Navigation ────────────────────────── */

.nav-dropdown {
    position: relative;
}

.nav-link.has-dropdown {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.nav-link.has-dropdown::after {
    content: '';
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-15%, -25%);
    transition: transform 0.2s ease;
}

.nav-dropdown:hover > .nav-link.has-dropdown::after,
.nav-dropdown:focus-within > .nav-link.has-dropdown::after {
    transform: rotate(-135deg) translate(-15%, -25%);
}

.main-nav .dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--color-primary-dark);
    list-style: none;
    padding: 0.4rem 0;
    margin: 0;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.main-nav .dropdown-menu li {
    display: block;
    width: 100%;
    margin: 0;
    list-style: none;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 0.5rem;
}

.nav-dropdown:hover > .dropdown-menu,
.nav-dropdown:focus-within > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.55rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.dropdown-link:hover,
.dropdown-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* ── Media Row (Flip-Flop Text/Bild) ────────────── */

.media-stack {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.media-row {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    align-items: stretch;
}

.media-row .media-image {
    flex: 1 1 0;
}

.media-row .media-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.media-row .media-text {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.media-row .media-text h2 {
    margin-bottom: 0.6rem;
}

@media (min-width: 768px) {
    .media-row {
        flex-direction: row;
        gap: 2.5rem;
        align-items: center;
    }

    /* Flip-Flop: jede zweite media-row im Container kehrt die Richtung um.
       :nth-of-type zählt nur <section.media-row>-Elemente, andere Blöcke
       (h2, p, table) werden ignoriert. */
    section.media-row:nth-of-type(even) {
        flex-direction: row-reverse;
    }
}

/* ── Timeline ───────────────────────────────────── */

.timeline {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    left: 0.55rem;
    width: 2px;
    background: var(--color-primary-light);
}

.timeline-item {
    position: relative;
    padding: 0 0 1.6rem 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--color-primary);
    border: 3px solid var(--color-bg-alt);
    box-shadow: 0 0 0 1px var(--color-primary);
}

.timeline-year {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary-dark);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.timeline-content h3 {
    margin-bottom: 0.2rem;
    font-size: 1.05rem;
}

.timeline-content p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .timeline::before {
        left: 5.5rem;
    }

    .timeline-item {
        padding-left: 7rem;
    }

    .timeline-item::before {
        left: 4.95rem;
    }

    .timeline-year {
        position: absolute;
        left: 0;
        top: 0.1rem;
        width: 4.5rem;
        text-align: right;
        font-size: 1.15rem;
        margin-bottom: 0;
    }
}

/* ── Memorial Box (Im Gedenken) ─────────────────── */

.memorial-box {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    padding: 2.2rem 1.6rem;
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.memorial-box h2 {
    margin-bottom: 0.8rem;
    font-size: 1.35rem;
}

.memorial-intro {
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 1.2rem;
    text-wrap: balance;
}

.memorial-list {
    display: grid;
    gap: 0.2rem 2rem;
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 560px;
    text-align: center;
    font-size: 0.98rem;
    line-height: 1.9;
}

.memorial-list li {
    padding: 0;
}

@media (min-width: 640px) {
    .memorial-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── Pillars-Grid (Vier Säulen) ─────────────────── */

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0 3rem 0;
}

.pillar-card {
    background-color: var(--color-primary, #3a6a2e);
    color: #fff;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pillar-card p {
    line-height: 1.6;
    margin: 0.5rem 0;
    font-size: 0.95rem;
    hyphens: auto;
    text-wrap: balance;
}

.pillar-card strong {
    font-weight: bold;
    font-size: 1rem;
}

.pillar-icon {
    width: 60px;
    height: 60px;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.pillar-icon img,
.pillar-icon svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

@media (max-width: 640px) {
    .pillars-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ── Geräte-Tabelle (Thumbnails + Lightbox-Trigger) ─ */

.geraete-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.geraete-thumb-cell {
    width: 70px;
}

.geraete-thumb-cell .lightbox-trigger {
    display: inline-block;
    cursor: zoom-in;
}

/* ── Vorstand-Rollen-Tabelle ───────────────────── */

.vorstand-roles-table {
    width: 100%;
    max-width: 500px;
    margin: 1rem 0;
    border-collapse: collapse;
}

.vorstand-roles-table .role-cell {
    padding: 0.5rem 1rem 0.5rem 0;
    font-weight: 600;
}

.vorstand-roles-table .role-cell.multi {
    vertical-align: top;
}

.vorstand-roles-table .names-cell {
    padding: 0.5rem 0;
}

.vorstand-roles-table .names-cell.multi {
    line-height: 1.8;
}

.vorstand-image-wrap {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.vorstand-image-wrap .image-block img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.vorstand-image-wrap .image-block figcaption {
    margin-top: 0.8rem;
    font-style: italic;
    color: var(--color-text-light, #6b7c69);
    text-align: center;
}

/* ── Lightbox ──────────────────────────────────── */

.lightbox-trigger {
    cursor: zoom-in;
    display: inline-block;
}

.lightbox-dialog {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-width: 100dvw;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
}

.lightbox-dialog[open] {
    display: grid;
    place-items: center;
}

.lightbox-dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 95vw;
    max-width: 95dvw;
    max-height: 95vh;
    max-height: 95dvh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
    background: rgba(0, 0, 0, 0.85);
    outline: none;
}

/* ── Toast Notifications (Admin) ────────────────── */

.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    max-width: 420px;
    min-width: 240px;
    padding: 0.9rem 1.2rem;
    background: var(--color-primary, #3a6a2e);
    color: #fff;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    font-size: 0.95rem;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.toast.toast-error {
    background: #b13030;
}

.toast.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

@media (max-width: 480px) {
    .toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

/* ── Publish-Status-Badges ──────────────────────── */

.badge {
    display: inline-block;
    padding: 0.18em 0.55em;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 3px;
    white-space: nowrap;
}

.badge-success {
    background: #d4edda;
    color: #1a6630;
    border: 1px solid #b8ddc5;
}

.badge-draft {
    background: #fff3cd;
    color: #7d5a00;
    border: 1px solid #ffe08a;
}

/* ── Checkbox-Gruppe im Formular ────────────────── */

.form-group-checkbox {
    margin-top: 0.25rem;
}

.form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.form-checkbox-label--disabled {
    opacity: 0.6;
    cursor: default;
}

.form-checkbox-label--disabled input[type="checkbox"] {
    cursor: not-allowed;
}

.form-hint {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-muted, #777);
}

/* ── 404-Fehlerseite ────────────────────────────── */

.not-found-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    padding: 3rem 0;
}

.not-found-inner {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

.not-found-code {
    font-family: var(--font-heading);
    font-size: clamp(5rem, 20vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: transparent;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    margin-bottom: 0.2rem;
    letter-spacing: -0.04em;
    user-select: none;
}

.not-found-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.not-found-heading {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary-dark);
}

.not-found-text {
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.not-found-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.not-found-links {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
}

.not-found-links-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.not-found-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    justify-content: center;
}

.not-found-links li a {
    font-size: 0.95rem;
    color: var(--color-primary);
    text-decoration: none;
}

.not-found-links li a:hover {
    text-decoration: underline;
    color: var(--color-primary-dark);
}

@media (max-width: 480px) {
    .not-found-wrap {
        min-height: 60vh;
        padding: 2rem 0;
    }

    .not-found-actions {
        flex-direction: column;
        align-items: center;
    }

    .not-found-actions .btn {
        width: 100%;
        max-width: 260px;
    }
}
