/* ============================================================
   CUSTOM MOBILE CSS (<=768px)
   ============================================================ */
@media (max-width:768px) {

    /* Desktopheader verbergen op mobiel (voorkomt dubbele header) */
    header.site-header.desktop-header,
    .site-header:not(.mobile-header) .main-navigation,
    .inside-header .main-navigation,
    #site-navigation {
        display: none !important;
    }

    /* Fixed mobiele header in 2 rijen */
    .mobile-header {
        position: fixed;
        z-index: 9999;
        top: 0;
        left: 0;
        right: 0;
        background: #0A1A3C;
        color: #FFD700;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    body {
        padding-top: 86px;
    }

    /* JS past dit nog dynamisch aan */

    .header-inner-mobile {
        display: grid;
        grid-template-columns: auto 1fr auto;
        /* logo | titel | hamburger */
        grid-template-rows: auto auto;
        /* R1 + R2 */
        align-items: center;
        gap: 10px;
        padding: 10px 14px 8px;
    }

    /* R1 plaatsing (logo/titel/hamburger) */
    .mobile-left {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
    }

    .mobile-title-wrap {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .menu-toggle {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
    }

    /* R2 plaatsing (zoek + toggle) */
    .mobile-search {
        grid-column: 1 / 3;
        grid-row: 2;
    }

    .mobile-theme-toggle {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
    }

    /* Logo & titel */
    .header-logo {
        width: 50px;
        height: auto;
        display: block;
    }

    .header-title {
        font-family: 'Oswald', sans-serif;
        font-variant: small-caps;
        font-weight: 800;
        font-size: 29px;
        line-height: 1.05;
        letter-spacing: .06em;
        color: #FFD700;
        text-align: center;
        white-space: nowrap;
    }

    .header-title-link {
        text-decoration: none;
    }

    /* Hamburgerknop */
    .menu-toggle {
        height: 46px;
        min-width: 46px;
        padding: 0 12px;
        border-radius: 23px;
        border: 2px solid #FFD700;
        background: #0A1A3C;
        color: #FFD700;
        font-size: 26px;
        line-height: 1;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        z-index: 10002;
    }

    /* Zoekveld */
    .mobile-header .search-form {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-header .search-field,
    .mobile-header input[type="search"] {
        flex: 1 1 auto;
        min-width: 0;
        background: #0A1A3C;
        color: #FFD700;
        -webkit-text-fill-color: #FFD700;
        caret-color: #FFD700;
        border: 2px solid #FFD700;
        border-radius: 20px;
        padding: 6px 12px;
        font-size: 14px;
        outline: none;
    }

    .mobile-header .search-field::placeholder {
        color: #FFD700;
        opacity: .7;
    }

    .mobile-header .search-submit {
        background: transparent !important;
        border: 2px solid #FFD700 !important;
        color: #FFD700 !important;
        border-radius: 18px !important;
        height: 36px !important;
        min-width: 36px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        padding: 0 10px !important;
    }
/* Dark/Light button (zorg dat hij altijd klikbaar is) */
#dark-light-toggle-mobile {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    border: 2px solid #FFD700;
    background: #0A1A3C;
    color: #FFD700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 10002;
    pointer-events: auto;
    touch-action: manipulation;
}

#dark-light-toggle-mobile::before {
    content: "â˜€";
    font-size: 18px;
    line-height: 1;
}

html[data-theme="dark"] #dark-light-toggle-mobile::before {
    content: "ðŸŒ™";
}

    /* Paneelmenu (rechts, Ã‚Â±50% breed, verticaal, scrollbaar) */
    #mobile-menu {
        display: none !important;
    }

    #mobile-menu.active {
        display: block !important;
    }

    .main-navigation-mobile.nav-menu {
        position: fixed;
        right: 10px;
        left: auto;
        width: min(50vw, 420px);
        top: calc(86px + 10px);
        max-height: calc(100dvh - 110px);
        overflow: auto;
        background: #0A1A3C;
        border: 1px solid rgba(255, 255, 255, .15);
        border-radius: 12px;
        padding: 10px;
        z-index: 10001;
        box-shadow: 0 14px 50px rgba(0, 0, 0, .5);
    }

    .main-navigation-mobile.nav-menu,
    .main-navigation-mobile.nav-menu ul {
        display: block !important;
    }

    .main-navigation-mobile.nav-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .main-navigation-mobile.nav-menu li {
        display: block !important;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .main-navigation-mobile.nav-menu li:last-child {
        border-bottom: none;
    }

    .main-navigation-mobile.nav-menu a {
        display: block !important;
        padding: 12px 10px;
        color: #FFD700;
        text-decoration: none;
        font-weight: 700;
        font-size: 18px;
        white-space: normal;
    }

    .main-navigation-mobile.nav-menu a:hover {
        color: #fff;
    }

    /* Grid/marges mobiel compacter */
    .news-grid {
        gap: 6px;
        max-width: 100% !important;
        margin: 12px auto !important;
        padding: 0 8px !important;
    }

    .news-grid h3 {
        margin: 4px 0 2px;
        font-size: 16px;
        font-weight: 700;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-grid p {
        margin: 2px 0 0;
        display: -webkit-box;
        -webkit-line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Pagination altijd ÃƒÂ©ÃƒÂ©n regel */
    .pagination,
    .nav-links {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        gap: 6px;
        align-items: center;
        justify-content: center;
        padding: 8px 10px;
    }

    .pagination a,
    .pagination span,
    .nav-links a,
    .nav-links span {
        padding: 6px 10px;
        border-radius: 14px;
    }

    /* PageÃ¢â‚¬â€˜view zonder zijmarges (zoals single) */
    .page .site-main,
    .page .content-area,
    .page .page-content,
    .page .inside-article {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box;
    }

    /* Dark mode: BODYÃ¢â‚¬â€˜TEKST ÃƒÂ©n TITEL in single/page wit (leesbaar) */
    html[data-theme="dark"] .single .entry-title,
    html[data-theme="dark"] .page .entry-title,
    html[data-theme="dark"] .page-title,
    html[data-theme="dark"] .category-title {
        color: #FFFFFF !important;
        font-weight: 700 !important;
    }

    html[data-theme="dark"] .single .inside-article,
    html[data-theme="dark"] .single .entry-content,
    html[data-theme="dark"] .page .inside-article,
    html[data-theme="dark"] .page .entry-content {
        color: #FFFFFF !important;
        -webkit-text-fill-color: #FFFFFF !important;
    }

    html[data-theme="dark"] .single .entry-content p,
    html[data-theme="dark"] .single .entry-content li,
    html[data-theme="dark"] .single .entry-content span,
    html[data-theme="dark"] .page .entry-content p,
    html[data-theme="dark"] .page .entry-content li,
    html[data-theme="dark"] .page .entry-content span {
        color: inherit !important;
        -webkit-text-fill-color: inherit !important;
    }
}

/* ============================================================
   [FOOTER MOBILE] Nieuwe social-balk styling (SVG)
   ============================================================ */
@media (max-width:768px) {
    #mj-social-mobile {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 14px;
        margin: 12px 0 16px;
    }

    #mj-social-mobile .mj-soc {
        display: inline-flex;
        width: 36px;
        height: 36px;
        border: 2px solid #FFD700;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        color: #FFD700;
        text-decoration: none;
        transition: transform .2s ease, background-color .2s ease, color .2s ease;
    }

    #mj-social-mobile .mj-soc svg {
        display: block;
        width: 20px;
        height: 20px;
    }

    #mj-social-mobile .mj-soc:hover {
        background-color: rgba(255, 215, 0, .12);
        transform: translateY(-1px);
    }

    html[data-theme="dark"] #mj-social-mobile .mj-soc {
        border-color: #FFD700;
        color: #FFD700;
    }

    html[data-theme="dark"] #mj-social-mobile .mj-soc:hover {
        background-color: rgba(255, 215, 0, .20);
    }
}

/* ============================================================
   [MOBILE FOOTER Ã¢â‚¬Â¢ STYLE] Bluesky icoon consistent met overige
   Functie: waarborgen dat Bluesky dezelfde maat/uitlijning heeft
   ============================================================ */
@media (max-width:768px) {

    /* knop zelf erft al rand/kleur/hover van .mj-soc */
    #mj-social-mobile .mj-soc.mj-bluesky {
        /* niets extra nodig; regel bestaat voor expliciete consistentie */
    }

    /* zorg dat het SVG-icoon exact dezelfde maat heeft */
    #mj-social-mobile .mj-soc.mj-bluesky svg {
        display: block;
        width: 20px;
        height: 20px;
    }
}

/* === MOBIEL TITELRUIMTE: kleiner rondom de titel in alle .news-grid kaarten === */
@media (max-width:768px) {

    /* Kaart zelf: minder padding zodat er niet Ã¢â‚¬Å“extra luchtÃ¢â‚¬Â om de titel ontstaat */
    .news-grid>article {
        padding: 6px 8px !important;
        /* was 10px all sides */
    }

    /* Titel: marges nog compacter (boven 0, onder 2px is meestal mooi strak) */
    .news-grid>article>h3 {
        margin: 0 0 2px !important;
        /* boven 0; onder 2px */
    }

    /* Excerpt: mini-afstand tot titel, niet meer */
    .news-grid>article>h3+p {
        margin-top: 2px !important;
        /* was 2px, houden we strak op 2px */
    }

    /* Bonus: haal baseline-wit onder afbeeldingen weg zodat beeld en titel Ã¢â‚¬Å“plakkenÃ¢â‚¬Â */
    .news-grid>article>a {
        line-height: 0 !important;
    }
}

/* === MOBIEL FIX: verwijder uitgerekte ruimte rond titel in kaarten (niet-Trending) === */
@media (max-width:768px) {

    /* Kaarten in nieuws/audities/recensies (alle .news-grid) */
    .news-grid-section .news-grid>article {
        justify-content: flex-start !important;
        /* geen ruimte verdelen */
        height: auto !important;
        /* niet forceren naar 420px */
        gap: 4px !important;
        /* kleine, voorspelbare verticale ruimte */
        padding: 6px 8px !important;
        /* iets compacter dan desktop */
    }

    /* Afbeelding strak, geen baseline-wit */
    .news-grid-section .news-grid>article>a {
        line-height: 0 !important;
    }

    .news-grid-section .news-grid>article>a>img {
        display: block !important;
        width: 100% !important;
        height: var(--card-thumb-h-mobile, 180px) !important;
        /* vaste beeldruimte */
        object-fit: cover !important;
        border-radius: 8px;
    }

    /* Titel: marges weg; (we laten je bestaande 3-regel clamp staan) */
    .news-grid-section .news-grid>article>h3 {
        margin: 0 !important;
    }

    /* Excerpt: mini-ruimte onder titel */
    .news-grid-section .news-grid>article>h3+p {
        margin: 2px 0 0 !important;
    }
}

/* ============================================================
   MJ HOTFIX v4 Ã¢â‚¬â€ MOBIEL KALENDER (append-only, safe)
   Probleem: Titel valt half onder afbeelding + te veel wit onder titel.
   Vereisten: Datum/tijd en excerpt NIET wijzigen. Dark mode: gouden border zichtbaar.
   Scope: Alleen kalenderpagina (page-events.php).
   ============================================================ */
@media (max-width:768px) {

    /* Kaart lay-out strak, geen clipping; geen invloed op andere grids */
    body.page-template-page-events-php .news-grid>article {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        align-content: start !important;
        gap: 4px !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        position: relative !important;
        /* nodig voor ::after border */
    }

    /* Thumbnail-link: geen extra line-height; voorkomt 'titel onder afbeelding' */
    body.page-template-page-events-php .news-grid>article>a {
        display: block !important;
        line-height: 0 !important;
        margin: 0 !important;
    }

    /* Afbeelding: voorspelbare hoogte, onder de titel in stacking order */
    body.page-template-page-events-php .news-grid>article>a>img {
        display: block !important;
        width: 100% !important;
        height: var(--mj-event-thumb-h, 180px) !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        position: relative !important;
        z-index: 0 !important;
        /* img onder titel */
    }

    /* TITEL: altijd boven de img + minimale ruimte eronder */
    body.page-template-page-events-php .news-grid>article>h3 {
        position: relative !important;
        /* eigen stacking context */
        z-index: 1 !important;
        /* boven img */
        clear: both !important;
        /* tegen floats/overlaps */
        margin: 6px 0 2px !important;
        /* kleine witruimte onder titel */
        padding: 0 !important;
        transform: none !important;
        /* vangt evt. translaties weg */
        line-height: 1.25 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
    }

    /* Link gedraagt zich als blok, voorkomt inline-gaps */
    body.page-template-page-events-php .news-grid>article>h3 a {
        display: block !important;
    }

    /* LET OP: GEEN regels voor .event-date of excerpt hier Ã¢â‚¬â€ jouw huidige (goede) marges blijven intact. */

    /* --- Dark mode: gouden border om de tegel --- */
    /* OS dark preference */
    @media (prefers-color-scheme: dark) {
        body.page-template-page-events-php .news-grid>article::after {
            content: "";
            position: absolute;
            inset: 0;
            border: 1px solid #FFD700;
            border-radius: 10px;
            pointer-events: none;
            z-index: 2;
            /* boven achtergrond, onder tekst */
        }
    }

    /* Site-gestuurde dark modes (extra compat) */
    body.dark-mode.page-template-page-events-php .news-grid>article::after,
    .dark-mode body.page-template-page-events-php .news-grid>article::after,
    [data-theme="dark"] body.page-template-page-events-php .news-grid>article::after,
    html[data-theme="dark"] body.page-template-page-events-php .news-grid>article::after {
        content: "";
        position: absolute;
        inset: 0;
        border: 1px solid #FFD700;
        border-radius: 10px;
        pointer-events: none;
        z-index: 2;
    }
}

/* === EINDE MJ HOTFIX v4 === */
/* ============================================================
   MJ MICRO-PATCH v3 Ã¢â‚¬â€ Kalender (mobiel): titel lager + groter (geforceerd)
   Functie:
   - Titel blijft op juiste positie (zelfde verschuiving)
   - Lettertype op mobiel duidelijk groter, met hoge prioriteit
   - Datum/tijd (.event-date) en excerpt blijven ongewijzigd
   Scope:
   - Mobiel (Ã¢â€°Â¤768px), event-tegels in kalendergrid
   ============================================================ */
@media (max-width:768px) {

    /* Fallback via template-class */
    body.page-template-page-events-php .news-grid>article>h3,
    body.page-template-page-events-php .news-grid>article>h3 a {
        position: relative !important;
        z-index: 2 !important;
        font-size: 18px !important;
        /* <<< verhoogd en met !important */
        line-height: 1.35 !important;
        font-weight: 600 !important;
    }

    body.page-template-page-events-php .news-grid>article>h3::before {
        --mj-title-spacer: 22px;
        content: "";
        display: block !important;
        height: var(--mj-title-spacer) !important;
    }

    /* Breder, met :has() voor compatibele browsers */
    .news-grid>article:has(.event-date)>h3,
    .news-grid>article:has(.event-date)>h3 a {
        position: relative !important;
        z-index: 2 !important;
        font-size: 18px !important;
        /* geforceerde vergroting */
        line-height: 1.35 !important;
        font-weight: 600 !important;
    }

    .news-grid>article:has(.event-date)>h3::before {
        --mj-title-spacer: 22px;
        content: "";
        display: block !important;
        height: var(--mj-title-spacer) !important;
    }
}

/**
 * MOBILE Ã¢â‚¬â€œ harde reset tegels "Mijn favorieten"
 * Doel:
 * - Alle interne padding/marges minimaliseren
 * - Gouden border
 * - Witte tekst in dark mode
 */

@media (max-width: 768px) {

    /* 1) TEGEL ZELF: alle padding weg, margin minimal, border goud */
    body.page-template-page-mijn-favorieten .news-grid article,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article {
        border: 2px solid #FFD700;
        border-radius: 12px;
        padding: 0 !important;
        /* NUL padding binnen de kaart */
        margin: 0 0 0.7rem !important;
        /* beetje ruimte onder kaart */
        background: transparent;
    }

    /* 2) AFBEELDING: direct tegen bovenrand, geen wit rondom */
    body.page-template-page-mijn-favorieten .news-grid article>a,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>a {
        display: block;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.page-template-page-mijn-favorieten .news-grid article>a img,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>a img {
        display: block;
        width: 100%;
        height: auto;
        margin: 0 !important;
        border-radius: 12px 12px 0 0;
    }

    /* 3) TITEL: minimale marge, alleen klein beetje horizontaal */
    body.page-template-page-mijn-favorieten .news-grid article>h3,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>h3 {
        margin: 0.35rem 0.6rem 0.1rem !important;
        /* heel weinig boven/onder */
        padding: 0 !important;
        font-size: 0.95rem !important;
        line-height: 1.25 !important;
    }

    /* 4) EXCERPT: compact onder titel, geen extra bovenmarge */
    body.page-template-page-mijn-favorieten .news-grid article>p,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>p {
        margin: 0 0.6rem 0.4rem !important;
        /* geen bovenmarge, klein beetje onder */
        padding: 0 !important;
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
    }

    /* 5) GRID-afstand */
    body.page-template-page-mijn-favorieten .news-grid,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid {
        row-gap: 0.6rem;
        column-gap: 0.6rem;
    }

    /* 6) DARK MODE Ã¢â‚¬â€œ tekst altijd wit in tegels */
    body[data-theme="dark"].page-template-page-mijn-favorieten .news-grid article>h3,
    body[data-theme="dark"].page-template-page-mijn-favorieten .mj-ai-recommended-grid article>h3,
    body[data-theme="dark"].page-template-page-mijn-favorieten .news-grid article>p,
    body[data-theme="dark"].page-template-page-mijn-favorieten .mj-ai-recommended-grid article>p {
        color: #ffffff !important;
    }
}

/**
 * MOBILE Ã¢â‚¬â€œ pagina "Mijn favorieten"
 * Fix:
 * - Verwijder min-height / vaste hoogte van tegels
 * - Minimaliseer witruimte rond titel & excerpt
 * - Gouden border
 * - Witte tekst in dark mode
 */

@media (max-width: 768px) {

    /* 1. Basis van de tegels: geen vaste hoogte, geen extra padding */
    body.page-template-page-mijn-favorieten .news-grid article,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article {
        border: 2px solid #FFD700;
        border-radius: 12px;
        background: transparent;
        padding: 0 !important;
        margin: 0 0 0.8rem !important;
        min-height: 0 !important;
        height: auto !important;
        display: block !important;
    }

    /* 2. Anchor + afbeelding bovenin de tegel, zonder witruimte */
    body.page-template-page-mijn-favorieten .news-grid article>a,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>a {
        display: block;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.page-template-page-mijn-favorieten .news-grid article>a img,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>a img {
        display: block;
        width: 100%;
        height: auto;
        margin: 0 !important;
        border-radius: 12px 12px 0 0;
    }

    /* 3. Titel: zo compact mogelijk onder de afbeelding */
    body.page-template-page-mijn-favorieten .news-grid article>h3,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>h3 {
        margin: 0.35rem 0.6rem 0.05rem !important;
        /* minimaal boven/onder */
        padding: 0 !important;
        font-size: 0.95rem !important;
        line-height: 1.25 !important;
    }

    /* 4. Excerpt: direct onder titel, klein beetje ruimte naar onderrand */
    body.page-template-page-mijn-favorieten .news-grid article>p,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid article>p {
        margin: 0 0.6rem 0.4rem !important;
        /* geen bovenmarge */
        padding: 0 !important;
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
    }

    /* 5. Gridafstand tussen tegels */
    body.page-template-page-mijn-favorieten .news-grid,
    body.page-template-page-mijn-favorieten .mj-ai-recommended-grid {
        row-gap: 0.6rem;
        column-gap: 0.6rem;
    }

    /* 6. Dark mode: tekst wit binnen tegels */
    body[data-theme="dark"].page-template-page-mijn-favorieten .news-grid article>h3,
    body[data-theme="dark"].page-template-page-mijn-favorieten .mj-ai-recommended-grid article>h3,
    body[data-theme="dark"].page-template-page-mijn-favorieten .news-grid article>p,
    body[data-theme="dark"].page-template-page-mijn-favorieten .mj-ai-recommended-grid article>p {
        color: #ffffff !important;
    }
}

@media (max-width: 768px) {
    body.page-template-page-mijn-favorieten .news-grid:not(.mj-ai-recommended-grid) .entry-subtitle {
        display: none !important;
    }
}

/* ==========================================================================
   MOBILE TILE FIX (unifying search, favorites, AI suggestions)
   ========================================================================= */

/* Geldt voor ALLE grids op mobiel */
@media (max-width: 768px) {

    /* TILE CONTAINER */
    .news-grid article {
        background: transparent !important;
        border: 2px solid var(--mj-gold, #d4af37) !important;
        border-radius: 10px;
        padding: 12px 12px 16px 12px;
        margin-bottom: 22px;
        overflow: hidden;
    }

    /* DARK MODE border fix */
    html[data-theme="dark"] .news-grid article {
        border-color: #ffd700 !important;
        /* feller goud */
    }

    /* TITEL (line-height fix + minder witruimte) */
    .news-grid article h3.entry-title {
        font-size: 1rem !important;
        line-height: 1.25em !important;
        /* voorkomt Ã¢â‚¬Ëœin elkaar drukkenÃ¢â‚¬â„¢ */
        margin: 10px 0 6px 0 !important;
        /* minder witruimte */
        padding: 0 !important;
    }

    .news-grid article h3.entry-title a {
        color: inherit !important;
        text-decoration: none !important;
    }

    /* EXCERPT Ã¢â‚¬â€œ minder witruimte */
    .news-grid article p.entry-summary {
        margin: 0 !important;
        font-size: 0.9rem !important;
        line-height: 1.35em !important;
        padding: 0 !important;
        color: inherit !important;
    }

    /* THUMBNAIL Ã¢â‚¬â€œ consistent op mobiel */
    .news-grid article .thumb-wrap img {
        border-radius: 6px;
        display: block;
        width: 100%;
        height: auto;
    }
}

/**
 * MOBILE Ã¢â‚¬â€œ zoekresultaten (search + AI-grid)
 * Zelfde layout-fix als "Mijn favorieten":
 * - Geen vaste hoogte
 * - Gouden border
 * - Compacte titel + excerpt
 * - Witte tekst in dark mode
 */

@media (max-width: 768px) {

    /* 1. Basis van de tegels: geen vaste hoogte, geen extra padding */
    body.search .news-grid article,
    body.search .mj-ai-search-grid article {
        border: 2px solid #FFD700;
        border-radius: 12px;
        background: transparent;
        padding: 0 !important;
        margin: 0 0 0.8rem !important;
        min-height: 0 !important;
        height: auto !important;
        display: block !important;
    }

    /* 2. Anchor + afbeelding bovenin de tegel, zonder witruimte */
    body.search .news-grid article>a,
    body.search .mj-ai-search-grid article>a,
    body.search .news-grid article .thumb-wrap>a,
    body.search .mj-ai-search-grid article .thumb-wrap>a {
        display: block;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.search .news-grid article>a img,
    body.search .mj-ai-search-grid article>a img,
    body.search .news-grid article .thumb-wrap>a img,
    body.search .mj-ai-search-grid article .thumb-wrap>a img {
        display: block;
        width: 100%;
        height: auto;
        margin: 0 !important;
        border-radius: 12px 12px 0 0;
    }

    /* 3. Titel: zo compact mogelijk onder de afbeelding */
    body.search .news-grid article>h3,
    body.search .mj-ai-search-grid article>h3 {
        margin: 0.35rem 0.6rem 0.05rem !important;
        /* minimaal boven/onder */
        padding: 0 !important;
        font-size: 0.95rem !important;
        line-height: 1.25 !important;
        /* voorkomt 2 regels over elkaar */
    }

    /* 4. Excerpt: direct onder titel, klein beetje ruimte naar onderrand */
    body.search .news-grid article>p,
    body.search .mj-ai-search-grid article>p,
    body.search .news-grid article .entry-summary,
    body.search .mj-ai-search-grid article .entry-summary {
        margin: 0 0.6rem 0.4rem !important;
        /* geen bovenmarge */
        padding: 0 !important;
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
    }

    /* 5. Gridafstand tussen tegels */
    body.search .news-grid,
    body.search .mj-ai-search-grid {
        row-gap: 0.6rem;
        column-gap: 0.6rem;
    }

    /* 6. Dark mode: tekst wit binnen tegels */
    body[data-theme="dark"].search .news-grid article>h3,
    body[data-theme="dark"].search .mj-ai-search-grid article>h3,
    body[data-theme="dark"].search .news-grid article>p,
    body[data-theme="dark"].search .mj-ai-search-grid article>p,
    body[data-theme="dark"].search .news-grid article .entry-summary,
    body[data-theme="dark"].search .mj-ai-search-grid article .entry-summary {
        color: #ffffff !important;
    }
}

/* === Zoekresultaten fix toegevoegd door AI (dec 2025) === */
@media (max-width: 768px) {
  body.search .news-grid article {
    border: 2px solid #FFD700;
    border-radius: 12px;
    background: transparent;
    padding: 0 !important;
    margin: 0 0 0.8rem !important;
    min-height: 0 !important;
    height: auto !important;
    display: block !important;
  }

  body.search .news-grid article .thumb-wrap > a {
    display: block;
    line-height: 0 !important;
  }

  body.search .news-grid article .thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px 12px 0 0;
  }

  body.search .news-grid article h3.entry-title {
    margin: 0.4rem 0.6rem 0.2rem !important;
    font-size: 0.95rem !important;
    line-height: 1.3 !important;
  }

  body.search .news-grid article h3.entry-title a {
    text-decoration: none;
    color: inherit;
    display: block;
    line-height: 1.3 !important;
  }

  body.search .news-grid article p.entry-summary {
    margin: 0 0.6rem 0.5rem !important;
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
  }

  body[data-theme="dark"].search .news-grid article h3,
  body[data-theme="dark"].search .news-grid article p {
    color: #ffffff !important;
  }
}

/* Herstelde Dark-Light Toggle Symbolen */
@media (max-width: 768px) {
  #dark-light-toggle-mobile {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    border: 2px solid #FFD700;
    background: #0A1A3C;
    color: #FFD700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 10002;
    pointer-events: auto;
    touch-action: manipulation;
  }

  #dark-light-toggle-mobile::before {
    content: "☀";
    font-size: 18px;
    line-height: 1;
  }

  html[data-theme="dark"] #dark-light-toggle-mobile::before {
    content: "🌙";
  }
}