/**
 * Pillar v2 — editorial blocks op taxonomy-archief leaves + parent-hub card-grid.
 *
 * Gebruikt PCBuildMate house-style tokens uit themes/flavor/assets/css/theme-vars.css.
 * Dark/light mode automatisch via `html.dark` / :root variable-flip — geen aparte
 * `*-dark` selectors nodig.
 */

/* ============================================================
   Pillar intro (leaf-pillar TL;DR met Speakable schema)
   ============================================================ */

.pillar-intro {
    background: var(--bg-secondary);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: clamp(var(--space-md), 2.5vw, var(--space-xl));
    margin: 0 0 clamp(var(--space-lg), 3vw, var(--space-2xl)) 0;
    box-shadow: var(--shadow-sm);
}

.pillar-intro__heading {
    margin: 0 0 var(--space-sm) 0;
    font-family: var(--font-display);
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 600;
    color: var(--brand-primary);
    letter-spacing: -0.01em;
}

.pillar-intro__body {
    font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
    line-height: 1.65;
    color: var(--text-primary);
}

.pillar-intro__body p { margin: 0 0 var(--space-sm) 0; }
.pillar-intro__body p:last-child { margin-bottom: 0; }
.pillar-intro__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.pillar-intro__body a:hover { color: var(--accent-hover); }

/* ============================================================
   Pillar featured (curated top-3 spokes)
   ============================================================ */

.pillar-featured {
    margin: 0 0 clamp(var(--space-lg), 3vw, var(--space-2xl)) 0;
}

.pillar-featured__heading {
    margin: 0 0 var(--space-md) 0;
    font-family: var(--font-display);
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.pillar-featured__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: clamp(var(--space-sm), 2vw, var(--space-lg));
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: pillar-featured;
}

.pillar-featured__item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease;
    counter-increment: pillar-featured;
    position: relative;
}

.pillar-featured__item::before {
    content: counter(pillar-featured);
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 1;
    background: var(--brand-primary);
    color: #fff;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: var(--font-display);
    box-shadow: var(--shadow-sm);
}

.pillar-featured__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-primary-light);
}

.pillar-featured__link {
    display: block;
    padding: var(--space-md);
    color: inherit;
    text-decoration: none;
}

.pillar-featured__image {
    margin-bottom: var(--space-sm);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.pillar-featured__image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.pillar-featured__title {
    display: block;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.pillar-featured__excerpt {
    display: block;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ============================================================
   Pillar CTA (open-tool aktie — subtiel accent, niet dominant)
   ============================================================ */

.pillar-cta {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: clamp(var(--space-md), 2vw, var(--space-lg));
    margin: clamp(var(--space-lg), 3vw, var(--space-2xl)) 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.pillar-cta__label {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.005em;
}

.pillar-cta__button {
    background: var(--brand-primary);
    color: #fff;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: background .15s ease, transform .15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.pillar-cta__button:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-1px);
}

.pillar-cta__button:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ============================================================
   Pillar hub (parent-archive: leaf-cards grid)
   ============================================================ */

.pillar-hub { margin: 0 0 clamp(var(--space-lg), 3vw, var(--space-2xl)) 0; }

.pillar-hub__heading {
    margin: 0 0 var(--space-md) 0;
    font-family: var(--font-display);
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.pillar-hub__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: clamp(var(--space-sm), 1.5vw, var(--space-md));
    list-style: none;
    margin: 0;
    padding: 0;
}

.pillar-hub__item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color .15s ease, transform .15s ease, box-shadow .2s ease;
}

.pillar-hub__item:hover {
    border-color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.pillar-hub__link {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    color: inherit;
    text-decoration: none;
    min-height: 4.5rem;
    justify-content: center;
}

.pillar-hub__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.005em;
}

.pillar-hub__count {
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.pillar-hub__item:hover .pillar-hub__name { color: var(--brand-primary); }

/* ============================================================
   Responsive — alleen voor flex-direction switch op CTA
   ============================================================ */

@media (max-width: 480px) {
    .pillar-cta {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    .pillar-cta__button { width: 100%; text-align: center; justify-content: center; }
}

/* ============================================================
   /guides/ archive — 2-column layout met sidebar (Bladeren op onderwerp)
   ============================================================ */

.guides-archive__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(var(--space-md), 3vw, var(--space-xl));
    align-items: start;
}

@media (min-width: 960px) {
    .guides-archive__layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }
}

@media (min-width: 960px) {
    .guides-archive__sidebar {
        /* Lichte offset zodat de eerste category-card uitlijnt met de
           "Uitgelichte guides" h2 in de main content (i.p.v. met de filter-row). */
        margin-top: var(--space-sm);
        position: sticky;
        top: calc(var(--space-md) + 80px);
        align-self: start;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--border) transparent;
    }
    .guides-archive__sidebar::-webkit-scrollbar { width: 6px; }
    .guides-archive__sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .guides-archive__sidebar::-webkit-scrollbar-track { background: transparent; }
}

.guides-archive__main {
    min-width: 0; /* fix: prevent grid blow-out */
}

/* ============================================================
   Sidebar pillar-hub — card-style rijen met huisstijl achtergrond
   ============================================================ */

.pillar-hub--sidebar { margin: 0; }

.pillar-hub--sidebar .pillar-hub__heading {
    margin: 0 0 var(--space-sm) 0;
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0 var(--space-xs);
}

.pillar-hub--sidebar .pillar-hub__grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pillar-hub--sidebar .pillar-hub__item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.pillar-hub--sidebar .pillar-hub__item:hover {
    background: var(--bg-hover);
    border-color: var(--brand-primary);
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.pillar-hub--sidebar .pillar-hub__link {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: 0.625rem 0.75rem;
    min-height: auto;
}

.pillar-hub--sidebar .pillar-hub__name {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: 0;
    transition: color .12s ease;
}

.pillar-hub--sidebar .pillar-hub__count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 8px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    line-height: 1.5;
    flex-shrink: 0;
    transition: background .12s ease, color .12s ease;
}

.pillar-hub--sidebar .pillar-hub__item:hover .pillar-hub__name {
    color: var(--brand-primary);
}

.pillar-hub--sidebar .pillar-hub__item:hover .pillar-hub__count {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* Mobile: heading visueel duidelijker als sidebar bovenaan flow staat */
@media (max-width: 959px) {
    .guides-archive__sidebar {
        margin-bottom: var(--space-md);
    }
    .pillar-hub--sidebar .pillar-hub__grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
        gap: var(--space-xs);
    }
}

/* ============================================================
   Filter dropdown — grijze achtergrond (matcht sidebar cards),
   blauwe accenten op hover/active state.
   Was: hardcoded #1f2937 blauwig in dark via niet-bestaande
   --color-bg-elevated var.
   ============================================================ */

.guides-filter-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

html.dark .guides-filter-dropdown {
    background: var(--bg-secondary);
    border-color: var(--border);
    box-shadow: var(--shadow-md);
}

.guides-filter-dropdown .guides-filter-btn {
    color: var(--text-primary);
    background: transparent;
    transition: background .12s ease, color .12s ease;
}

.guides-filter-dropdown .guides-filter-btn:hover {
    background: var(--accent-light);
    color: var(--brand-primary);
}

.guides-filter-dropdown .guides-filter-btn.active {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 600;
}

.guides-filter-dropdown .guides-filter-btn.active:hover {
    background: var(--brand-primary-dark, var(--brand-primary));
    color: #fff;
}

/* ============================================================
   Guide card title — kleiner lettertype + 3-regel line-clamp
   zodat titels niet meer mid-word afgekapt worden, en cards
   meer consistent in hoogte blijven.
   Override van partials-v123/guides-components.css (clamp(1rem, 1.5vw + 0.5rem, 1.25rem)).
   ============================================================ */

.guide-card__title {
    font-size: clamp(0.9375rem, 0.9vw + 0.6rem, 1.0625rem);
    line-height: 1.35;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Volledige titel blijft in DOM voor SEO + screen readers */
}
