/* =========================================
   1. GRUNDLAGEN & RESET
   ========================================= */
:root {
    /* Farbpalette - Würdevol & Modern */
    --primary: #2d3b47;
    /* Dunkles Schiefergrau für Header/Footer */
    --accent: #c5a065;
    /* Gold/Beige für Akzente */
    --text-dark: #1e293b;
    /* Fast Schwarz für Lesetext */
    --text-light: #475569;
    /* Dunkleres Grau für besseren Kontrast (WCAG AA) */
    --bg-body: #f8fafc;
    /* Heller Hintergrund */
    --bg-card: #ffffff;
    /* Weiß für Karten */
    /* Abstände & Rahmen */
    --radius: 12px;
    /* Moderne Ecken */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    /* Typografie */
    --font-serif: 'Libre Caslon Text', 'Georgia', serif;
    --font-sans: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent);
}

/* =========================================
   2. HEADER
   ========================================= */
.header-modern {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 10;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* =========================================
   3. LAYOUT
   ========================================= */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    align-items: start;
}

main {
    min-width: 0;
}

@media (max-width: 950px) {
    .layout-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        gap: 2rem;
    }

    aside {
        margin-top: 1rem;
        border-top: 1px solid #e2e8f0;
        padding-top: 2rem;
    }
}

/* =========================================
   4. ANZEIGEN (Karten auf Startseite)
   ========================================= */
.anzeigen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
}

.anzeige-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.anzeige {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
    /* ENTSCHEIDUNG: Goldener Rahmen ist IMMER da */
    border: 1px solid var(--accent);
    position: relative;
}

/* Hover: Karte hebt sich leicht an */
.anzeige-link:hover .anzeige {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.bild-wrapper {
    width: 112px;
    height: 112px;
    margin-bottom: 1rem;
    border-radius: 12px;
    /* Eckig mit weichen Kanten */
    overflow: hidden;
    border: 3px solid #f1f5f9;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anzeige-info {
    width: 100%;
    flex-grow: 1;
}

.anzeige-titel {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin: 0 0 0.5rem 0;
    color: var(--primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.anzeige-datum {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0 0 0.25rem 0;
    font-weight: 500;
}

.anzeige-ort {
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Button: Standardmäßig unsichtbar */
.anzeige-btn {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    background-color: var(--primary);
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 180px;
    pointer-events: none;
}

/* Hover: Button erscheint und wird Gold */
.anzeige-link:hover .anzeige-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    background-color: var(--accent);
    color: var(--primary);
    /* NEU: Dunkle Schrift auf Gold für besseren Kontrast */
}

/* Mobile Ausnahme (kein Hover möglich) */
@media (hover: none) {
    .anzeige-btn {
        opacity: 1;
        transform: translateY(0);
        background-color: transparent;
        color: var(--primary);
        /* NEU: Dunkle Schrift statt Gold (Kontrast!) */
        margin-top: 0.5rem;
        padding: 0;
        pointer-events: auto;
        text-decoration: underline;
        /* Unterstrichen, damit man sieht, dass es ein Link ist */
    }
}

/* =========================================
   5. SIDEBAR (Dezent Grau mit Gold-Akzent)
   ========================================= */
.sidebar .box {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    /* Grau, damit sie nicht mit den Anzeigen konkurrieren */
    border: 1px solid #e2e8f0;
}

.box-title,
.sidebar h3,
.sidebar strong {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary);
    /* Goldene Linie als edler Akzent */
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.input-suche {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.input-suche:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.sidebar-nav,
.sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li,
.sidebar-links li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a,
.sidebar-links a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-dark);
    transition: background 0.2s;
}

.sidebar-nav a:hover,
.sidebar-links a:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.login-button,
.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.login-button:hover,
.btn-primary:hover {
    background-color: #1e293b;
}

.ads-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.ad-item {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ad-item img {
    width: 100%;
    height: auto;
    display: block;
}

.sidebar .custom-html-box {
    width: 100%;
    box-sizing: border-box;
    margin: 8px 0;
    max-height: 220px;
    overflow: auto;
}

/* =========================================
   6. PAGINATION
   ========================================= */
.pagination-nav {
    margin-top: 3rem;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 0.5rem;
    background: #fff;
    padding: 0.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
}

.pagination a,
.pagination strong {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    font-weight: 600;
}

.pagination a {
    color: var(--text-dark);
}

.pagination a:hover {
    background-color: #f1f5f9;
}

.pagination strong {
    background-color: var(--primary);
    color: #fff;
}

/* =========================================
   7. FOOTER
   ========================================= */
.site-footer {
    background-color: var(--primary);
    color: #cbd5e1;
    /* Helleres Grau/Weiß für besseren Kontrast auf dunklem Grund */
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 4rem;
    font-size: 0.9rem;
}

.cookie-hinweis {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-left: 5px solid var(--accent);
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.cookie-ok-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* =========================================
   8. EXTRAS
   ========================================= */
.suchergebnis {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    margin-bottom: 2rem;
    color: var(--text-dark);
}

/* =========================================
   9. INTRO OVERLAY (Gedenken des Tages)
   ========================================= */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 1;
    transition: opacity 1s ease;
}

#intro-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.intro-content {
    text-align: center;
    animation: zoomIn 1.5s ease-out;
    max-width: 90%;
    position: relative;
}

.intro-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.intro-name {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 2rem;
    transition: opacity 0.5s ease;
    /* Soft transition */
}

.intro-img {
    max-height: 60vh;
    max-width: 100%;
    border: 4px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 50px rgba(197, 160, 101, 0.3);
    transition: opacity 0.5s ease;
    /* Soft transition */
}

.intro-skip {
    margin-top: 30px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ccc;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.intro-skip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}