/**
 * JVD Frontend Styles
 * Version: 2.1.0
 *
 * Frontend-Look + Nuclear-Mobile-Override + Sidebar-Extras.
 *
 * Architektur:
 *   - Desktop (≥761px): Theme-Layout, Plugin schiebt Werbeplatz +
 *     Empfehlungs-Box in die Theme-Sidebar (via JS)
 *   - Mobile (≤760px): Theme-Header verschluckt, Plugin rendert
 *     eigenen Header + Off-Canvas-Drawer
 *
 * Changelog:
 *  2.1.0 — Sidebar-Extras: Werbeplatz + Empfehlung der Redaktion,
 *          konfigurierbar via Settings-Page (Einstellungen → JVD Frontend Styles)
 *  2.0.0 — Nuclear-Override: Theme-Header auf Mobile komplett ersetzt
 *  1.5.0 — Auto-Detection mit ::before-Bug-Fix (deprecated)
 *  1.0.0 — Initial Release
 */

:root {
    --jvd-fs-primary:      #0F6E56;
    --jvd-fs-primary-dark: #085041;
    --jvd-fs-primary-deep: #0f4c3a;
    --jvd-fs-soft:         #f5f8f6;
    --jvd-fs-line:         #e2eae6;
}

/* ─────────────────────────────────────────────────────────────────────────
   1. TABELLEN
   ───────────────────────────────────────────────────────────────────────── */

.entry-content table,
.post-content table,
article table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    margin: 1.5em 0;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

.entry-content table thead th,
.entry-content table thead td,
.entry-content table tr:first-child th,
.entry-content table tr:first-child td,
.post-content table thead th,
article table thead th {
    background-color: var(--jvd-fs-primary-deep) !important;
    color: #ffffff !important;
    font-weight: 700;
    text-align: left;
    padding: 12px 16px;
    border: 1px solid var(--jvd-fs-primary-deep);
    border-bottom: 2px solid #0a3528;
    vertical-align: middle;
    line-height: 1.3;
}

.entry-content table tbody td,
.entry-content table tbody th,
.post-content table tbody td,
article table tbody td {
    padding: 12px 16px;
    border: 1px solid #d4d4d4;
    color: #1a1a1a;
    background-color: #ffffff;
    vertical-align: top;
    line-height: 1.55;
}

.entry-content table tbody tr:nth-child(even) td,
.entry-content table tbody tr:nth-child(even) th,
.post-content table tbody tr:nth-child(even) td,
article table tbody tr:nth-child(even) td {
    background-color: var(--jvd-fs-soft);
}

@media (hover: hover) {
    .entry-content table tbody tr:hover td,
    .post-content table tbody tr:hover td,
    article table tbody tr:hover td {
        background-color: #e8f0ec;
        transition: background-color 0.15s ease;
    }
}

@media (max-width: 600px) {
    .entry-content table,
    .post-content table,
    article table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 14px;
    }
    .entry-content table thead th,
    .entry-content table tbody td,
    article table thead th,
    article table tbody td {
        padding: 10px 12px;
        min-width: 120px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   2. FOKUS-SICHTBARKEIT
   ───────────────────────────────────────────────────────────────────────── */

.entry-content a:focus-visible,
.post-content a:focus-visible,
article a:focus-visible {
    outline: 3px solid var(--jvd-fs-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────
   3. EXTERNE LINKS
   ───────────────────────────────────────────────────────────────────────── */

.entry-content a[target="_blank"]:not(.no-icon)::after,
.post-content a[target="_blank"]:not(.no-icon)::after,
article a[target="_blank"]:not(.no-icon)::after {
    content: " ↗";
    font-size: 0.85em;
    color: var(--jvd-fs-primary);
    text-decoration: none;
    white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────────
   4. QUICK-TAKE & VERBRAUCHER-CHECK
   ───────────────────────────────────────────────────────────────────────── */

.entry-content .quick-take,
.entry-content .verbraucher-check,
.post-content .quick-take,
.post-content .verbraucher-check {
    border-left: 4px solid var(--jvd-fs-primary);
    background-color: var(--jvd-fs-soft);
    padding: 1em 1.25em;
    margin: 1.5em 0;
    border-radius: 0 4px 4px 0;
    color: #1a1a1a;
}

/* ─────────────────────────────────────────────────────────────────────────
   5. HEADLINES
   ───────────────────────────────────────────────────────────────────────── */

.entry-content h2,
.post-content h2,
article h2 {
    color: var(--jvd-fs-primary);
    font-weight: 700;
    line-height: 1.25;
    margin-top: 2em;
    margin-bottom: 0.75em;
    border-bottom: 2px solid var(--jvd-fs-line);
    padding-bottom: 0.35em;
}

.entry-content h3,
.post-content h3,
article h3 {
    color: var(--jvd-fs-primary);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.entry-content h2 > span.emoji,
.post-content h2 > span.emoji {
    color: initial;
}

/* ─────────────────────────────────────────────────────────────────────────
   6. FAQ-AKKORDEON
   ───────────────────────────────────────────────────────────────────────── */

.jvd-faq-accordion {
    margin: 1.5em 0 2em;
    border-top: 1px solid var(--jvd-fs-line);
}

.jvd-faq-item {
    border-bottom: 1px solid var(--jvd-fs-line);
    background-color: #ffffff;
    transition: background-color 0.2s ease;
}

.jvd-faq-item[open] {
    background-color: #f7faf9;
}

.jvd-faq-item summary {
    cursor: pointer;
    padding: 1em 2.5em 1em 0.25em;
    font-weight: 600;
    color: var(--jvd-fs-primary);
    font-size: 17px;
    line-height: 1.4;
    list-style: none;
    position: relative;
    outline: none;
}

.jvd-faq-item summary::-webkit-details-marker { display: none; }

.jvd-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 400;
    color: var(--jvd-fs-primary);
    transition: transform 0.2s ease;
    line-height: 1;
}

.jvd-faq-item[open] summary::after { content: "−"; }

.jvd-faq-item summary:hover,
.jvd-faq-item summary:focus-visible {
    color: var(--jvd-fs-primary-dark);
    background-color: #f0f5f3;
    outline: 2px solid var(--jvd-fs-primary);
    outline-offset: -2px;
    border-radius: 2px;
}

.jvd-faq-answer {
    padding: 0 0.25em 1.25em;
    color: #1a1a1a;
    line-height: 1.65;
    font-size: 16px;
}

.jvd-faq-answer p { margin: 0 0 0.75em 0; }
.jvd-faq-answer p:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
    .jvd-faq-item summary { font-size: 16px; padding: 0.85em 2.25em 0.85em 0.25em; }
    .jvd-faq-item summary::after { font-size: 22px; right: 0.35em; }
    .jvd-faq-answer { font-size: 15px; }
}

/* ═════════════════════════════════════════════════════════════════════════
   7. NUCLEAR MOBILE OVERRIDE — v2.0
   ═════════════════════════════════════════════════════════════════════════
   Plugin verschluckt das Theme-Header auf Mobile komplett und rendert
   seinen eigenen Header + Off-Canvas-Drawer. Alle .jvd-nuclear-* Elemente
   kommen aus dem PHP-Template (jvd_fs_render_nuclear_mobile()).

   Strategie:
     - Desktop (≥761px): Plugin-Elemente unsichtbar, Theme macht alles
     - Mobile (≤760px):
        - Theme-Header HART VERSTECKT (display: none)
        - Plugin-Header sichtbar (sticky top)
        - Hamburger öffnet Drawer von rechts (transform: translateX)
        - Backdrop (semi-transparent overlay)
        - Body-Scroll-Lock wenn Drawer offen
   ═════════════════════════════════════════════════════════════════════════ */

/* Standard: Plugin-Elemente UNSICHTBAR auf Desktop */
.jvd-nuclear-header,
.jvd-nuclear-drawer,
.jvd-nuclear-backdrop {
    display: none;
}

/* ═══ MOBILE (≤760px) ═══════════════════════════════════════════════════ */
@media (max-width: 760px) {

    /* Theme-Header KOMPLETT VERSCHLUCKEN.
       Wir matchen so viele Theme-Header-Varianten wie möglich. */
    body > header:not(.jvd-nuclear-header),
    body > .site-header,
    body > .jvd-site-header,
    body > #masthead,
    body > #site-header,
    .site-header,
    .jvd-site-header,
    #masthead,
    header[role="banner"]:not(.jvd-nuclear-header),
    .site-branding-container,
    .main-navigation,
    nav.site-navigation {
        display: none !important;
    }

    /* ─── Plugin-Header (sticky top) ─── */
    .jvd-nuclear-header {
        display: flex !important;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 1000;
        background: #ffffff;
        padding: 10px 16px;
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
        height: 60px;
        box-sizing: border-box;
        border-bottom: 1px solid var(--jvd-fs-line);
    }

    .jvd-nuclear-logo {
        display: flex;
        align-items: center;
        text-decoration: none;
    }
    .jvd-nuclear-logo-img {
        max-height: 40px;
        width: auto;
        display: block;
    }
    .jvd-nuclear-sitetitle {
        font-weight: 700;
        font-size: 22px;
        color: var(--jvd-fs-primary);
        letter-spacing: -0.02em;
    }

    /* ─── Hamburger-Button mit 3 Strichen ─── */
    .jvd-nuclear-toggle {
        background: none !important;
        border: 0 !important;
        padding: 8px 10px !important;
        cursor: pointer;
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        outline: none;
        color: var(--jvd-fs-primary);
    }
    .jvd-nuclear-toggle:focus-visible {
        outline: 2px solid var(--jvd-fs-primary);
        outline-offset: 2px;
        border-radius: 4px;
    }
    .jvd-nuclear-toggle-icon {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 26px;
    }
    .jvd-nuclear-toggle-icon span {
        display: block;
        width: 100%;
        height: 2.5px;
        background: var(--jvd-fs-primary);
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease;
    }
    /* Animation Hamburger → X */
    .jvd-nuclear-toggle[aria-expanded="true"] .jvd-nuclear-toggle-icon span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    .jvd-nuclear-toggle[aria-expanded="true"] .jvd-nuclear-toggle-icon span:nth-child(2) {
        opacity: 0;
    }
    .jvd-nuclear-toggle[aria-expanded="true"] .jvd-nuclear-toggle-icon span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    /* ─── Backdrop (semi-transparent) ─── */
    .jvd-nuclear-backdrop {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 76, 58, 0.45);
        z-index: 1001;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .jvd-nuclear-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    /* ─── Drawer (Off-Canvas von rechts) ─── */
    .jvd-nuclear-drawer {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(85vw, 360px);
        background: #ffffff;
        z-index: 1002;
        transform: translateX(100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    }
    .jvd-nuclear-drawer.is-open {
        transform: translateX(0);
    }

    /* Drawer-Header (Titel + Close) */
    .jvd-nuclear-drawer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 18px;
        border-bottom: 1px solid var(--jvd-fs-line);
        background: var(--jvd-fs-soft);
        flex-shrink: 0;
    }
    .jvd-nuclear-drawer-title {
        font-weight: 700;
        font-size: 15px;
        color: var(--jvd-fs-primary-deep);
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
    .jvd-nuclear-close {
        background: none !important;
        border: 0 !important;
        padding: 8px !important;
        cursor: pointer;
        min-width: 40px;
        min-height: 40px;
        color: var(--jvd-fs-primary-deep);
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
    }
    .jvd-nuclear-close:hover,
    .jvd-nuclear-close:focus-visible {
        background: rgba(15, 110, 86, 0.08);
        outline: none;
    }

    /* Nav-Container (scrollbar) */
    .jvd-nuclear-nav {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 8px 0;
    }

    /* Top-Level-Menu */
    .jvd-nuclear-menu {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .jvd-nuclear-menu li {
        position: relative;
        margin: 0;
        padding: 0;
        list-style: none;
        border-bottom: 1px solid var(--jvd-fs-line);
    }
    .jvd-nuclear-menu > li:last-child {
        border-bottom: 0;
    }
    .jvd-nuclear-menu a {
        display: block !important;
        padding: 14px 50px 14px 18px !important;
        font-size: 16px !important;
        font-weight: 500 !important;
        color: var(--jvd-text, #1a1a1a) !important;
        text-decoration: none !important;
        min-height: 44px;
        line-height: 1.4;
        transition: background 0.12s, color 0.12s;
    }
    .jvd-nuclear-menu a:hover,
    .jvd-nuclear-menu a:focus-visible {
        background: var(--jvd-fs-soft) !important;
        color: var(--jvd-fs-primary) !important;
        outline: none;
    }
    .jvd-nuclear-menu a:active {
        background: #d4ebe3 !important;
    }

    /* Submenu-Expand-Button (rechts) */
    .jvd-nuclear-expand {
        position: absolute !important;
        right: 0;
        top: 0;
        background: none !important;
        border: 0 !important;
        padding: 14px 16px !important;
        cursor: pointer;
        color: var(--jvd-fs-primary);
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s ease;
    }
    .jvd-nuclear-expand[aria-expanded="true"] {
        transform: rotate(180deg);
    }
    .jvd-nuclear-expand:focus-visible {
        outline: 2px solid var(--jvd-fs-primary);
        outline-offset: -4px;
        border-radius: 4px;
    }

    /* Submenü versteckt → ausklappbar */
    .jvd-nuclear-submenu {
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-height: 0;
        overflow: hidden;
        background: #fafbfa;
        transition: max-height 0.28s ease;
    }
    .has-children.is-expanded > .jvd-nuclear-submenu {
        max-height: 800px;
    }
    .jvd-nuclear-submenu li {
        border-bottom: 1px solid #ebf1ee;
    }
    .jvd-nuclear-submenu li:last-child {
        border-bottom: 0;
    }
    .jvd-nuclear-submenu a {
        padding: 12px 50px 12px 36px !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        color: #2a2a2a !important;
    }

    .jvd-nuclear-empty {
        padding: 20px;
        color: var(--jvd-fs-primary);
        text-align: center;
        font-size: 14px;
    }

    /* Body-Scroll-Lock wenn Drawer offen */
    body.jvd-nuclear-locked {
        overflow: hidden !important;
        position: relative;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   8. MOBILE-OPTIMIERUNG Hero / Trust-Bar
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .jvd-hero { padding: 36px 20px !important; }
    .jvd-hero-title { font-size: 28px !important; line-height: 1.2 !important; }
    .jvd-hero-sub { font-size: 15px !important; }

    .jvd-hero-cta {
        flex-direction: column;
        gap: 10px !important;
    }
    .jvd-hero-cta .jvd-btn {
        width: 100%;
        justify-content: center;
    }

    .jvd-trust-bar {
        gap: 20px !important;
    }
}

/* ═════════════════════════════════════════════════════════════════════════
   9. SIDEBAR-EXTRAS — v2.1 (Werbeplatz + Empfehlung der Redaktion)
   ═════════════════════════════════════════════════════════════════════════ */

.jvd-fs-sidebar-card {
    background: #ffffff;
    border: 1px solid var(--jvd-fs-line);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 2px rgba(15, 76, 58, 0.04);
}

.jvd-fs-sidebar-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--jvd-fs-primary-deep);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--jvd-fs-soft);
    letter-spacing: -0.005em;
}

.jvd-fs-sidebar-card-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--jvd-fs-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    opacity: 0.75;
}

/* Werbeplatz */
.jvd-fs-sidebar-ad {
    background: #f8faf9;
    border-style: dashed;
    border-color: #cbd5d0;
}
.jvd-fs-sidebar-ad-content {
    text-align: center;
    min-height: 60px;
}
.jvd-fs-sidebar-ad-content img,
.jvd-fs-sidebar-ad-content iframe {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.jvd-fs-sidebar-ad-content a {
    text-decoration: none;
    color: inherit;
}

/* Empfehlung der Redaktion */
.jvd-fs-sidebar-related-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.jvd-fs-sidebar-related-list li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--jvd-fs-line);
}
.jvd-fs-sidebar-related-list li:last-child {
    border-bottom: 0;
}
.jvd-fs-sidebar-related-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    text-decoration: none !important;
    color: var(--jvd-text, #1a1a1a);
    transition: color 0.15s, background 0.15s;
    border-radius: 4px;
}
.jvd-fs-sidebar-related-list a:hover,
.jvd-fs-sidebar-related-list a:focus-visible {
    color: var(--jvd-fs-primary) !important;
    background: var(--jvd-fs-soft);
    padding-left: 6px;
    padding-right: 6px;
}
.jvd-fs-sidebar-related-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--jvd-fs-soft);
}
.jvd-fs-sidebar-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.jvd-fs-sidebar-related-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    flex: 1;
}

/* Auf Mobile (≤760px) Sidebar-Extras nicht zeigen — nuklear gehandhabt */
@media (max-width: 760px) {
    .jvd-fs-sidebar-card { display: none !important; }
}

/* ═════════════════════════════════════════════════════════════════════════
   10. FAQ-AKKORDEON FORCE-FIX — v2.1.2
   ═════════════════════════════════════════════════════════════════════════
   Bug: Theme oder anderes Plugin versteckt `<details>` Inhalt mit display:none.
   Lösung: Mit !important alle Theme-Overrides killen.
   Quelle: Live-Audit "erstes-girokonto-finden-2026" — FAQ-Akkordeon zeigt
           Frage + +/-Symbol, aber Antwort komplett unsichtbar. */

/* Reset jeglicher hide-Logik bei unseren FAQ-Akkordeons */
.jvd-faq-accordion details {
    display: block !important;
    visibility: visible !important;
}

.jvd-faq-accordion details > summary {
    display: list-item !important;
    cursor: pointer;
    padding: 14px 16px;
    background: var(--jvd-fs-soft, #e8f5ee);
    border: 1px solid var(--jvd-fs-line, #d6e4dd);
    border-radius: 6px;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--jvd-fs-primary-deep, #0f4c3a);
    list-style: none;
    position: relative;
    padding-right: 40px;
    transition: background 0.15s;
}

.jvd-faq-accordion details > summary:hover {
    background: var(--jvd-fs-soft-hover, #d6e9dd);
}

/* +/- Indicator rechts, manuell weil list-item-Default unsichtbar im Theme */
.jvd-faq-accordion details > summary::-webkit-details-marker { display: none; }
.jvd-faq-accordion details > summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    font-weight: 400;
    color: var(--jvd-fs-primary, #0f6e56);
    transition: transform 0.2s;
}
.jvd-faq-accordion details[open] > summary::after {
    content: "−";
}

/* DAS IST DER FIX: Alle Kinder von details (außer summary) MÜSSEN sichtbar sein */
.jvd-faq-accordion details > *:not(summary) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Wenn details geschlossen, Inhalt verstecken — aber nur unsere FAQ */
.jvd-faq-accordion details:not([open]) > *:not(summary) {
    display: none !important;
}

/* Antwort-Container styling */
.jvd-faq-accordion .jvd-faq-answer {
    padding: 14px 16px;
    border: 1px solid var(--jvd-fs-line, #d6e4dd);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: #ffffff;
    margin-bottom: 8px;
}

.jvd-faq-accordion .jvd-faq-answer p {
    margin: 0 0 10px;
    color: #1a1a1a;
}
.jvd-faq-accordion .jvd-faq-answer p:last-child {
    margin-bottom: 0;
}

/* Komplette Box-Spacing zwischen Items */
.jvd-faq-accordion details {
    margin-bottom: 8px;
}

/* ═════════════════════════════════════════════════════════════════════════
   11. SIDEBAR-LAYOUT FIX — v2.1.2
   ═════════════════════════════════════════════════════════════════════════
   Bug: Sidebar wird unter dem Content gerendert wenn Article-Content zu lang.
   Klassen aus Live-Audit: .jvd-content-grid, .jvd-article-sidebar
   Fix: Grid-Layout robuster machen + min-height-Regeln. */

@media (min-width: 961px) {
    .jvd-content-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 320px !important;
        gap: 32px !important;
        align-items: start !important;
    }

    .jvd-article-sidebar,
    aside.jvd-article-sidebar {
        position: sticky !important;
        top: 80px !important;
        align-self: start !important;
        width: 100% !important;
        max-width: 320px !important;
    }

    /* Article darf nicht über sein Grid-Cell hinausfließen → kappt Float-Overflow */
    .jvd-article-content {
        min-width: 0 !important;
        overflow-wrap: break-word !important;
    }

    /* Tabellen im Content responsive halten — sonst sprengen sie das Grid */
    .jvd-article-content table {
        max-width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
    }
}

/* ═════════════════════════════════════════════════════════════════════════
   12. FOOTER-WIDGETS 4-SPALTEN-LAYOUT — v2.1.3
   ═════════════════════════════════════════════════════════════════════════
   Bug aus Live-Audit: Theme rendert "Themen entdecken / Meistgelesen / Newsletter / 
   Über uns" sequenziell untereinander statt in einer schicken 4-Spalten-Sidebar-Region.
   Fix: Alle Widget-Container der Footer-Sidebar als CSS-Grid mit 4 Spalten layouten.
   
   Strategie: Mehrere Selektor-Kandidaten parallel — wir wissen nicht 100% welche
   Klasse das Theme nutzt, decken alle gängigen WordPress-Sidebar-Patterns ab. */

/* Container-Wrapper mit Hintergrund + Padding */
.widget-area:not(.jvd-article-sidebar),
aside.jvd-related-widgets,
section.jvd-related-widgets,
.jvd-footer-widgets,
.jvd-after-article-widgets,
#jvd-secondary-sidebar,
aside#secondary,
.jvd-content-after .widget-area {
    display: block;
    width: 100%;
    background: #fafbfa;
    padding: 40px 24px;
    margin-top: 48px;
    border-top: 1px solid #e0e8e3;
    border-bottom: 1px solid #e0e8e3;
}

/* Innen: 4-Spalten-Grid auf Desktop, gestapelt auf Mobile */
@media (min-width: 961px) {
    .widget-area:not(.jvd-article-sidebar) > *,
    aside.jvd-related-widgets,
    section.jvd-related-widgets,
    .jvd-footer-widgets,
    .jvd-after-article-widgets {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 32px !important;
        max-width: 1280px;
        margin: 0 auto;
    }

    /* Wenn Container schon Grid ist, einzelne Widget-Items als Grid-Item nutzen */
    .widget-area:not(.jvd-article-sidebar) .widget,
    .widget-area:not(.jvd-article-sidebar) section,
    aside.jvd-related-widgets > section,
    section.jvd-related-widgets > section,
    .jvd-footer-widgets > section,
    .jvd-footer-widgets > div {
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
}

/* Mobile: einspaltig gestapelt mit ordentlichen Abständen */
@media (max-width: 960px) {
    .widget-area:not(.jvd-article-sidebar) .widget,
    .widget-area:not(.jvd-article-sidebar) section,
    aside.jvd-related-widgets > section,
    section.jvd-related-widgets > section,
    .jvd-footer-widgets > section,
    .jvd-footer-widgets > div {
        margin-bottom: 32px !important;
    }
    .widget-area:not(.jvd-article-sidebar) .widget:last-child,
    .widget-area:not(.jvd-article-sidebar) section:last-child {
        margin-bottom: 0 !important;
    }
}

/* H3-Überschriften der einzelnen Widgets ("THEMEN ENTDECKEN" etc.) */
.widget-area:not(.jvd-article-sidebar) h2,
.widget-area:not(.jvd-article-sidebar) h3,
.widget-area:not(.jvd-article-sidebar) .widget-title,
.jvd-footer-widgets h2,
.jvd-footer-widgets h3,
.jvd-footer-widgets .widget-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--jvd-fs-primary-deep, #0f4c3a) !important;
    margin: 0 0 14px !important;
    padding: 0 0 8px !important;
    border-bottom: 2px solid var(--jvd-fs-primary, #0f6e56) !important;
    background: transparent !important;
}

/* Listen-Items (Kategorien, Meistgelesen) */
.widget-area:not(.jvd-article-sidebar) ul,
.widget-area:not(.jvd-article-sidebar) ol,
.jvd-footer-widgets ul,
.jvd-footer-widgets ol {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget-area:not(.jvd-article-sidebar) li,
.jvd-footer-widgets li {
    padding: 8px 0 !important;
    border-bottom: 1px solid #e8efea;
    font-size: 13.5px;
    line-height: 1.45;
}

.widget-area:not(.jvd-article-sidebar) li:last-child,
.jvd-footer-widgets li:last-child {
    border-bottom: 0 !important;
}

.widget-area:not(.jvd-article-sidebar) li a,
.jvd-footer-widgets li a {
    color: #1a3a2c !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.widget-area:not(.jvd-article-sidebar) li a:hover,
.jvd-footer-widgets li a:hover {
    color: var(--jvd-fs-primary, #0f6e56) !important;
}

/* JS-erzeugter Footer-Widget-Grid-Container (v2.1.3 fallback) */
.jvd-fs-footer-grid {
    display: block;
    width: 100%;
    background: #fafbfa;
    padding: 40px 24px;
    margin-top: 48px;
    border-top: 1px solid #e0e8e3;
    border-bottom: 1px solid #e0e8e3;
}

@media (min-width: 961px) {
    .jvd-fs-footer-grid {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 32px !important;
        max-width: 1280px;
        margin: 48px auto 0 !important;
    }
}

@media (max-width: 960px) {
    .jvd-fs-footer-grid > * {
        margin-bottom: 32px !important;
    }
    .jvd-fs-footer-grid > *:last-child {
        margin-bottom: 0 !important;
    }
}

/* Reset von Theme-Hintergründen innerhalb des Grids */
.jvd-fs-footer-grid > * {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}
