/**
 * Homepage V3/V4 – opmaak voor homepage-v3.php en homepage-v4.php.
 *
 * Kleurtokens (--imb-*) staan in css/navbar-v3.css. Papier en wit wisselen
 * per sectie, inkt voor tekst; rood alleen voor de primaire actie.
 * Het zoeksysteem en de verhaalkaarten zelf staan in css/v3-components.css.
 *
 * @package understrap
 */

.hp3 {
    /* linkerrand van de Bootstrap-container, voor beeld dat rechts doorloopt */
    --hp3-edge: 15px;
    color: var(--imb-ink);
    font-family: var(--imb-body);
}

@media (min-width: 576px) { .hp3 { --hp3-edge: calc((100% - 540px) / 2 + 15px); } }
@media (min-width: 768px) { .hp3 { --hp3-edge: calc((100% - 720px) / 2 + 15px); } }
@media (min-width: 992px) { .hp3 { --hp3-edge: calc((100% - 960px) / 2 + 15px); } }
@media (min-width: 1200px) { .hp3 { --hp3-edge: calc((100% - 1140px) / 2 + 15px); } }

.hp3 h1,
.hp3 h2 {
    font-family: var(--imb-head);
    font-weight: 400;
    color: var(--imb-ink);
    text-wrap: balance;
}

.hp3-h2 {
    font-size: clamp(2.2rem, 4vw, 3.3rem);
    line-height: 1;
    margin: 0 0 12px;
}

.hp3-lead {
    font-size: 1.12rem;
    line-height: 1.6;
    color: var(--imb-ink-soft);
    max-width: 36em;
    margin: 0;
    text-align: left;
}

/* ================================================================
   KNOPPEN
   ================================================================ */

.hp3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: var(--imb-head);
    font-size: 1.08rem;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.hp3-btn:active {
    transform: scale(0.97);
}

.hp3-btn:focus-visible {
    outline: 2px solid var(--imb-ink);
    outline-offset: 3px;
}

.hp3-btn-primary,
.hp3-btn-primary:visited {
    background: var(--imb-accent);
    color: #fff;
}

.hp3-btn-primary:hover,
.hp3-btn-primary:focus-visible {
    background: var(--imb-accent-dark);
    color: #fff;
}

.hp3-btn-ghost,
.hp3-btn-ghost:visited {
    background: transparent;
    border-color: var(--imb-ink);
    color: var(--imb-ink);
}

.hp3-btn-ghost:hover,
.hp3-btn-ghost:focus-visible {
    background: var(--imb-ink);
    color: #fff;
}

.hp3-btn-yellow {
    background: var(--imb-yellow-soft);
    color: var(--imb-ink);
}

.hp3-btn-yellow:hover {
    background: #fff;
    color: var(--imb-ink);
}

.hp3-btn-yellow:focus-visible {
    outline-color: var(--imb-yellow-soft);
}

/* ================================================================
   HERO
   ================================================================ */

.hp3-hero {
    --hp3-photo-overlap: 150px;
    background: linear-gradient(
        to bottom,
        var(--imb-paper) 0,
        var(--imb-paper) calc(100% - var(--hp3-photo-overlap)),
        #fff calc(100% - var(--hp3-photo-overlap))
    );
    padding-top: clamp(36px, 5vw, 72px);
}

.hp3-hero-title {
    font-size: clamp(3.3rem, 8.2vw, 7.4rem);
    line-height: 0.92;
    letter-spacing: -0.005em;
    margin: 0 0 clamp(22px, 3vw, 36px);
}

.hp3-hero-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 28px 64px;
    align-items: end;
}

.hp3-hero-sub {
    font-size: clamp(1.12rem, 1.5vw, 1.3rem);
    line-height: 1.55;
    color: var(--imb-ink-soft);
    max-width: 30em;
    margin: 0;
    text-align: left;
}

.hp3-hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.hp3-search {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--imb-line);
    border-radius: 999px;
    box-shadow: var(--imb-shadow);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.hp3-search:focus-within {
    border-color: var(--imb-ink);
    box-shadow: 0 0 0 4px rgba(31, 29, 26, 0.08), var(--imb-shadow);
}

.hp3-search-ico {
    flex-shrink: 0;
    margin-left: 16px;
    color: var(--imb-muted);
}

.hp3-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    padding: 12px 12px;
    font-family: var(--imb-body);
    font-size: 1.08rem;
    color: var(--imb-ink);
    -webkit-appearance: none;
    appearance: none;
}

.hp3-search-input::placeholder {
    color: var(--imb-muted);
}

.hp3-search-input:focus {
    outline: none;
}

.hp3-search .hp3-btn {
    padding: 14px 28px;
}

.hp3-textlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 18px;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--imb-ink);
    font-family: var(--imb-head);
    font-size: 1.02rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: underline;
    text-decoration-color: var(--imb-line);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
    cursor: pointer;
    transition: text-decoration-color 0.18s ease;
}

.hp3-textlink:hover,
.hp3-textlink:focus-visible {
    text-decoration-color: var(--imb-accent);
}

.hp3-textlink:focus-visible {
    outline: 2px solid var(--imb-ink);
    outline-offset: 3px;
}

/* groepsfoto: start op de containerrand, loopt rechts door tot de schermrand */
.hp3-hero-photo {
    margin: clamp(36px, 5vw, 64px) 0 0 var(--hp3-edge);
    height: clamp(240px, 36vw, 520px);
    border-radius: 14px 0 0 14px;
    overflow: hidden;
    background: var(--imb-line);
}

.hp3-hero-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
}

/* ================================================================
   MISSIE + CIJFERS
   ================================================================ */

.hp3-intro {
    background: #fff;
    padding: clamp(56px, 7vw, 96px) 0;
}

.hp3-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 48px 72px;
    align-items: start;
}

.hp3-intro-text,
.hp3-intro-text p {
    font-size: clamp(1.25rem, 1.9vw, 1.55rem);
    line-height: 1.5;
    color: var(--imb-ink);
    text-align: left;
}

.hp3-intro-text {
    max-width: 32em;
}

.hp3-intro-text p:last-child {
    margin-bottom: 0;
}

.hp3-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px 28px;
    margin: 6px 0 0;
}

.hp3-stat {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid var(--imb-line);
}

.hp3 .hp3-stat-num {
    margin: 0;
    font-family: var(--imb-head);
    font-size: clamp(2.8rem, 4.6vw, 4.1rem);
    line-height: 0.95;
    color: var(--imb-ink);
    font-variant-numeric: tabular-nums;
}

/* markeerstift onder het belangrijkste cijfer */
.hp3-stat:first-child .hp3-stat-num {
    align-self: flex-start;
    padding: 0 4px;
    margin-left: -4px;
    background: linear-gradient(to bottom, transparent 58%, var(--imb-yellow-soft) 58%, var(--imb-yellow-soft) 92%, transparent 92%);
}

.hp3-stat-label {
    font-family: var(--imb-head);
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--imb-muted);
}

/* ================================================================
   ZOEKSYSTEEM-SECTIE
   ================================================================ */

.hp3-app {
    background: var(--imb-paper);
    padding-top: clamp(56px, 7vw, 88px);
}

.hp3 .hp3-app .vz-app {
    background: transparent !important;
    padding: 32px 0 clamp(64px, 8vw, 104px);
    scroll-margin-top: 24px;
}

/* ================================================================
   THEMA'S
   ================================================================ */

.hp3-themas {
    background: #fff;
    padding: clamp(64px, 8vw, 104px) 0;
}

.hp3-themas-grid {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 28px 72px;
    align-items: start;
}

.hp3-thema-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--imb-ink);
}

.hp3-thema {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 6px 24px;
    padding: 24px 6px 24px 4px;
    border-bottom: 1px solid var(--imb-line);
    color: var(--imb-ink);
    text-decoration: none;
    transition: background 0.2s ease;
}

.hp3-thema:hover,
.hp3-thema:focus-visible {
    color: var(--imb-ink);
    background: linear-gradient(to right, var(--imb-paper), #fff 85%);
    outline: none;
}

.hp3-thema-name {
    font-family: var(--imb-head);
    font-size: clamp(1.6rem, 2.5vw, 2.25rem);
    line-height: 1.05;
    transition: transform 0.25s var(--imb-ease);
}

.hp3-thema:hover .hp3-thema-name {
    transform: translateX(6px);
}

.hp3-thema-count {
    font-size: 1rem;
    color: var(--imb-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.hp3-thema-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--imb-line);
    color: var(--imb-ink);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hp3-thema:hover .hp3-thema-arrow,
.hp3-thema:focus-visible .hp3-thema-arrow {
    background: var(--imb-ink);
    border-color: var(--imb-ink);
    color: #fff;
}

/* ================================================================
   IN BEELD (bento)
   ================================================================ */

.hp3-beeld {
    background: var(--imb-paper);
    padding: clamp(64px, 8vw, 104px) 0;
}

.hp3-beeld-head {
    margin-bottom: 32px;
}

.hp3-bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: clamp(130px, 15vw, 220px);
    gap: 14px;
}

.hp3-bento-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: var(--imb-line);
}

/* theme.css geeft a.glightbox een polaroid-kader; dat hier neutraliseren */
.hp3 a.hp3-bento-item.glightbox {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: var(--imb-line);
    box-shadow: none;
    transform: none;
}

.hp3 a.hp3-bento-item.glightbox img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform 0.6s var(--imb-ease);
}

.hp3 a.hp3-bento-item.glightbox:hover img {
    transform: scale(1.04);
}

.hp3 a.hp3-bento-item.glightbox::after {
    background: rgba(31, 29, 26, 0.5);
    border-width: 1.5px;
    font-weight: 400;
}

.hp3-bento-item:focus-visible {
    outline: 3px solid var(--imb-ink);
    outline-offset: 3px;
}

/* één groot beeld, de rest vult precies 4 × 2 op */
.hp3-bento .hp3-bento-item:first-child {
    grid-column: span 2;
    grid-row: span 2;
}

.hp3-bento-4 .hp3-bento-item:nth-child(2),
.hp3-bento-3 .hp3-bento-item:nth-child(2),
.hp3-bento-3 .hp3-bento-item:nth-child(3) {
    grid-column: span 2;
}

/* ================================================================
   IN JOUW BUURT (inkt)
   ================================================================ */

.hp3-buurt {
    background: var(--imb-ink);
    color: #fff;
    padding: clamp(64px, 8vw, 104px) 0;
}

.hp3-buurt-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 40px 72px;
    align-items: center;
}

.hp3 .hp3-buurt .hp3-h2 {
    color: #fff;
}

.hp3-buurt-text p {
    font-size: 1.12rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.74);
    max-width: 30em;
    margin: 0 0 28px;
    text-align: left;
}

.hp3-gemeenten {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hp3-gemeente {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 15px 22px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.hp3-gemeente-name {
    font-family: var(--imb-head);
    font-size: 1.3rem;
    letter-spacing: 0.03em;
    line-height: 1.1;
}

.hp3-gemeente-count {
    font-family: var(--imb-body);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}

.hp3-gemeente:hover,
.hp3-gemeente:focus-visible {
    background: var(--imb-yellow-soft);
    border-color: var(--imb-yellow-soft);
    color: var(--imb-ink);
    outline: none;
}

.hp3-gemeente:hover .hp3-gemeente-count,
.hp3-gemeente:focus-visible .hp3-gemeente-count {
    color: var(--imb-ink-soft);
}

.hp3-gemeente:active {
    transform: scale(0.98);
}

/* ================================================================
   WIE ZIJN WIJ + DOE MEE (geel)
   ================================================================ */

.hp3-join {
    background: var(--imb-yellow-soft);
    padding: clamp(64px, 8vw, 104px) 0;
    overflow: hidden;
}

.hp3-join-grid {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 48px 72px;
    align-items: center;
}

.hp3-join-text p {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--imb-ink-soft);
    max-width: 32em;
    margin: 0 0 30px;
    text-align: left;
}

.hp3-join-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hp3-join-art {
    margin: 0;
    justify-self: end;
    max-width: 480px;
}

/* rode tekening wordt een inkttekening op het geel (zoals de schets in de footer) */
.hp3-join-art img {
    display: block;
    width: 100%;
    height: auto;
    filter: grayscale(1) brightness(2.2) contrast(1.5);
    mix-blend-mode: multiply;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 991px) {
    .hp3-hero-row,
    .hp3-intro-grid,
    .hp3-themas-grid,
    .hp3-buurt-grid,
    .hp3-join-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hp3-hero {
        --hp3-photo-overlap: 110px;
    }

    .hp3-textlink {
        margin-left: 4px;
    }

    .hp3-intro-text {
        max-width: none;
    }

    .hp3-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .hp3-join-art {
        justify-self: start;
        max-width: 400px;
    }
}

@media (max-width: 767px) {
    .hp3-stats {
        grid-template-columns: 1fr 1fr;
    }

    .hp3-thema {
        grid-template-columns: minmax(0, 1fr) 40px;
        gap: 4px 16px;
        padding: 20px 4px 20px 4px;
    }

    .hp3-thema-name {
        grid-column: 1;
    }

    .hp3-thema-count {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.95rem;
    }

    .hp3-thema-arrow {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: 40px;
        height: 40px;
    }

    .hp3-bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: clamp(120px, 34vw, 200px);
        gap: 10px;
    }
}

@media (max-width: 575px) {
    .hp3-hero {
        --hp3-photo-overlap: 90px;
    }

    .hp3-search {
        padding: 5px;
    }

    .hp3-search-ico {
        margin-left: 12px;
    }

    .hp3-search-input {
        padding: 11px 8px;
        font-size: 1rem;
    }

    .hp3-search .hp3-btn {
        padding: 13px 20px;
    }

    .hp3-gemeente {
        padding: 13px 18px;
    }

    .hp3-gemeente-name {
        font-size: 1.15rem;
    }
}

@media (max-width: 359px) {
    .hp3-gemeenten {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp3-btn,
    .hp3-thema,
    .hp3-thema-name,
    .hp3-thema-arrow,
    .hp3-bento-item img,
    .hp3-gemeente {
        transition: none;
    }

    .hp3-thema:hover .hp3-thema-name,
    .hp3-bento-item:hover img {
        transform: none;
    }
}

/* ================================================================
   HOMEPAGE V4 (huidige homepage + v3-secties)
   ================================================================ */

/* Buurt-sectie in huisstijlrood */
.hp3-buurt--rood {
    background: var(--imb-accent);
}

.hp3-buurt--rood .hp3-buurt-text p {
    color: #fff;
}

.hp3-buurt--rood .hp3-gemeente {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.hp3-buurt--rood .hp3-gemeente-count {
    color: rgba(255, 255, 255, 0.9);
}

.hp3-buurt--rood .hp3-gemeente:hover,
.hp3-buurt--rood .hp3-gemeente:focus-visible {
    background: var(--imb-yellow-soft);
    border-color: var(--imb-yellow-soft);
    color: var(--imb-ink);
}

.hp3-buurt--rood .hp3-gemeente:hover .hp3-gemeente-count,
.hp3-buurt--rood .hp3-gemeente:focus-visible .hp3-gemeente-count {
    color: var(--imb-ink-soft);
}

/* Smart Slider (masthead) zet inline overflow-x: hidden op <body>; daardoor
   wordt body de scroll-container in plaats van het venster, en werken de
   sticky filters en het springen naar de resultaten niet goed meer.
   clip knipt horizontale uitloop net zo goed weg zonder scroll-container. */
body.page-template-homepage-v4 {
    overflow-x: clip !important;
}

/* Masthead precies als op de homepage: de slider bepaalt de hoogte. Op een
   niet-homepage (zoals de voorbeeldpagina) zet theme.css via html.offset een
   schermvullende hoogte; die geldt hier niet. */
.offset body.page-template-homepage-v4 .masthead {
    height: auto;
    margin-top: 0;
}

/* V4: witte achtergrond onder het zoeksysteem, witte knoppen */
.hp4 .hp3-app {
    background: #fff;
}

.hp4 .hp3-buurt--rood .hp3-btn-yellow {
    background: #fff;
    color: var(--imb-ink);
}

.hp4 .hp3-buurt--rood .hp3-btn-yellow:hover {
    background: var(--imb-yellow-soft);
    color: var(--imb-ink);
}

.hp4 .hp3-join .hp3-btn-ghost,
.hp4 .hp3-join .hp3-btn-ghost:visited {
    background: #fff;
    border-color: #fff;
    color: var(--imb-ink);
}

.hp4 .hp3-join .hp3-btn-ghost:hover,
.hp4 .hp3-join .hp3-btn-ghost:focus-visible {
    background: var(--imb-ink);
    border-color: var(--imb-ink);
    color: #fff;
}
