/* ==========================================================================
   /css/brievenbus.css — brievenbus / berichtensysteem vakantiehuis-frankrijk.nl
   Wordt via /includes/brievenbus-knop.php geladen, na framework.css.
   ========================================================================== */

:root {
    --bb-inkt: #2c3e50;
    --bb-zacht: #5f6b7a;
    --bb-rand: #dee2e6;
    --bb-rand-sterk: #c5ccd4;
    --bb-vlak: #f6f7fb;
    --bb-accent: #4c51bf;
    --bb-accent-hover: #3c40a0;
    --bb-geel: #ffc72c;
    --bb-rood: #c8102e;
    --bb-vlag-uit: #8c96a3;
}

/* -------------------------------------------------------------- de knop */
/* button.vhf-bb wint van ".modern-header *" (reset van marges en padding) */
button.vhf-bb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 56px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
button.vhf-bb[hidden],
.vhf-bb-teller[hidden] { display: none !important; }

button.vhf-bb:hover { background: rgba(76, 81, 191, .08); }
button.vhf-bb:focus-visible { outline: 3px solid var(--bb-accent); outline-offset: 2px; }

.vhf-bb-icoon { display: block; width: 48px; height: 40px; overflow: visible; }
.vhf-bb-paal, .vhf-bb-gleuf, .vhf-bb-arm, .vhf-bb-scharnier { fill: var(--bb-inkt); }
.vhf-bb-bus { fill: var(--bb-geel); stroke: var(--bb-inkt); stroke-width: 2.5; stroke-linejoin: round; }
.vhf-bb-doek { fill: var(--bb-vlag-uit); transition: fill .3s; }
.vhf-bb-vlag {
    transform-box: view-box;
    transform-origin: 46px 31px;
    transition: transform .5s cubic-bezier(.3, 1.6, .5, 1);
}
.vhf-bb.heeft-post .vhf-bb-vlag { transform: rotate(-90deg); }
.vhf-bb.heeft-post .vhf-bb-doek { fill: var(--bb-rood); }

/* Variant voor de paarse backoffice-header */
.vhf-bb--licht .vhf-bb-paal,
.vhf-bb--licht .vhf-bb-arm,
.vhf-bb--licht .vhf-bb-scharnier { fill: #ffffff; }
.vhf-bb--licht .vhf-bb-bus { stroke: #ffffff; }
.vhf-bb--licht .vhf-bb-gleuf { fill: #2c3e50; }
button.vhf-bb--licht:hover { background: rgba(255, 255, 255, .15); }
button.vhf-bb--licht:focus-visible { outline-color: #ffffff; }

.vhf-bb-teller {
    position: absolute;
    top: -2px;
    left: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 11px;
    border: 2px solid #ffffff;
    background: var(--bb-rood);
    color: #ffffff;
    font: 700 13px/18px -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    text-align: center;
}
.vhf-bb-teller.nieuw { animation: vhfBbPop .4s ease-out; }
.vhf-bb--licht .vhf-bb-teller { border-color: #6a5fc1; }

@keyframes vhfBbPop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* -------------------------------------------------------------- het paneel */
html.vhf-bb-open, html.vhf-bb-open body { overflow: hidden; }

.vhf-bb-scherm {
    position: fixed;
    inset: 0;
    z-index: 1100;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--bb-inkt);
}
.vhf-bb-scherm[hidden] { display: none; }

.vhf-bb-achtergrond {
    position: absolute;
    inset: 0;
    background: rgba(15, 25, 40, .38);
    animation: vhfBbVervaag .2s ease-out;
}

.vhf-bb-paneel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    box-shadow: -12px 0 32px rgba(15, 25, 40, .18);
    animation: vhfBbRechts .25s ease-out;
    outline: none;
}

.vhf-bb-greep { display: none; }

.vhf-bb-kop {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 8px;
}
.vhf-bb-paneel h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--bb-inkt);
}
.vhf-bb-kop p {
    margin: 2px 0 0;
    font-size: .95rem;
    line-height: 1.4;
    color: var(--bb-zacht);
}

.vhf-bb-sluit {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--bb-rand);
    border-radius: 22px;
    background: #ffffff;
    cursor: pointer;
}
.vhf-bb-sluit:hover { background: var(--bb-vlak); }

.vhf-bb-voor {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 24px 8px;
    font-size: .85rem;
    color: var(--bb-zacht);
}
.vhf-bb-voor span.chip {
    padding: 2px 10px;
    border-radius: 999px;
    background: #e9ebf8;
    color: #33378c;
    font-weight: 700;
}

.vhf-bb-tabs {
    display: flex;
    gap: 4px;
    margin: 8px 24px 0;
    border-bottom: 1px solid var(--bb-rand);
}
.vhf-bb-tab {
    min-height: 44px;
    margin: 0 0 -1px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bb-zacht);
    cursor: pointer;
}
.vhf-bb-tab[aria-selected="true"] {
    border-bottom-color: var(--bb-accent);
    color: var(--bb-accent);
    font-weight: 700;
}

.vhf-bb-lijst {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vhf-bb-voet {
    padding: 12px 24px 20px;
    border-top: 1px solid var(--bb-rand);
}
.vhf-bb-voet[hidden] { display: none; }
.vhf-bb-alles {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--bb-vlak);
    color: var(--bb-accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.vhf-bb-alles:hover { background: #eceef8; }

/* -------------------------------------------------------------- kaarten */
.vhf-bb-kaart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--bb-rand-sterk);
    border-radius: 12px;
    background: #ffffff;
}
.vhf-bb-kaart.is-belangrijk { box-shadow: 0 0 0 2px #f3b36b; border-color: #e0a35d; }
.vhf-bb-kaart.is-actie { border: 2px solid var(--bb-rood); }
.vhf-bb-kaart.is-gelezen { background: #fafbfc; border-color: var(--bb-rand); box-shadow: none; }
.vhf-bb-kaart.is-gelezen.is-actie { border-width: 1px; border-color: var(--bb-rand); }
.vhf-bb-kaart.verdwijnt { animation: vhfBbWeg .25s ease-in forwards; }

.vhf-bb-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: .82rem;
    color: var(--bb-zacht);
}
.vhf-bb-soort {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
}
.vhf-bb-soort--nieuws     { background: #dce8f7; color: #1d4e89; }
.vhf-bb-soort--tip        { background: #ddf1e6; color: #1e6b43; }
.vhf-bb-soort--belangrijk { background: #fde7cf; color: #8a4b08; }
.vhf-bb-soort--actie      { background: var(--bb-rood); color: #ffffff; }
.vhf-bb-vast { display: inline-flex; align-items: center; gap: 4px; }

.vhf-bb-kaart h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    color: var(--bb-inkt);
}
.vhf-bb-beeld {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bb-vlak);
}
.vhf-bb-tekst {
    font-size: .95rem;
    line-height: 1.55;
    color: #3a4552;
    overflow-wrap: anywhere;
}
.vhf-bb-tekst > :first-child { margin-top: 0; }
.vhf-bb-tekst > :last-child { margin-bottom: 0; }
.vhf-bb-tekst p { margin: 0 0 .6em; line-height: 1.55; }
.vhf-bb-tekst h2, .vhf-bb-tekst h3, .vhf-bb-tekst h4 { margin: .6em 0 .3em; font-size: 1rem; color: var(--bb-inkt); }
.vhf-bb-tekst ul, .vhf-bb-tekst ol { margin: 0 0 .6em; padding-left: 1.3em; }
.vhf-bb-tekst a { color: var(--bb-accent); }
.vhf-bb-tekst a.knop {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--bb-accent);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
}
.vhf-bb-tekst img { max-width: 100%; height: auto; border-radius: 6px; }
.vhf-bb-tekst .kader { background: #eef3f9; border-left: 4px solid var(--bb-accent); padding: 10px 14px; }
.vhf-bb-tekst .klein { font-size: .85rem; color: var(--bb-zacht); }
.vhf-bb-tekst blockquote { margin: 0 0 .6em; padding-left: 12px; border-left: 3px solid var(--bb-rand-sterk); color: var(--bb-zacht); }

.vhf-bb-acties {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.vhf-bb-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 8px;
    background: var(--bb-accent);
    color: #ffffff !important;
    font-weight: 600;
    text-decoration: none !important;
}
.vhf-bb-cta:hover { background: var(--bb-accent-hover); }
.vhf-bb-actie {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--bb-rand-sterk);
    border-radius: 8px;
    background: #ffffff;
    color: var(--bb-inkt);
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
}
.vhf-bb-actie:hover { background: var(--bb-vlak); }
.vhf-bb-actie--link { border-color: transparent; background: transparent; color: var(--bb-accent); }

.vhf-bb-sluit:focus-visible,
.vhf-bb-tab:focus-visible,
.vhf-bb-alles:focus-visible,
.vhf-bb-cta:focus-visible,
.vhf-bb-actie:focus-visible { outline: 3px solid var(--bb-accent); outline-offset: 2px; }

.vhf-bb-leeg {
    padding: 32px 8px;
    text-align: center;
    color: var(--bb-zacht);
    font-size: .95rem;
    line-height: 1.5;
}
.vhf-bb-leeg strong { display: block; margin-bottom: 4px; font-size: 1.05rem; color: var(--bb-inkt); }

@keyframes vhfBbRechts  { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vhfBbOmhoog  { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vhfBbVervaag { from { opacity: 0; } to { opacity: 1; } }
@keyframes vhfBbWeg     { to { opacity: 0; transform: translateX(24px); } }

/* -------------------------------------------------------------- mobiel: van onderen */
@media (max-width: 640px) {
    .vhf-bb-paneel {
        top: auto;
        left: 0;
        width: 100%;
        max-height: 86vh;
        max-height: 86dvh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 32px rgba(15, 25, 40, .2);
        animation-name: vhfBbOmhoog;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .vhf-bb-greep {
        display: block;
        width: 40px;
        height: 5px;
        margin: 8px auto 0;
        border-radius: 3px;
        background: var(--bb-rand-sterk);
    }
    .vhf-bb-kop { padding: 8px 20px 4px; }
    .vhf-bb-voor { padding: 0 20px 6px; }
    .vhf-bb-tabs { margin: 4px 20px 0; }
    .vhf-bb-tab { padding: 10px 8px; font-size: .95rem; }
    .vhf-bb-lijst { padding: 14px 20px 20px; }
    .vhf-bb-voet { padding: 10px 20px 16px; }
    .vhf-bb-acties .vhf-bb-cta { width: 100%; justify-content: center; }
    .vhf-bb-acties .vhf-bb-actie { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
    .vhf-bb-vlag, .vhf-bb-doek { transition: none; }
    .vhf-bb-teller.nieuw, .vhf-bb-achtergrond, .vhf-bb-paneel, .vhf-bb-kaart.verdwijnt { animation: none; }
}