.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 253, 249, 0.92);
    backdrop-filter: blur(12px);
}

.topbar .wrap {
    max-width: 1180px;
}

.nav {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 10px;
    height: auto;
    padding-top: 14px;
    padding-bottom: 12px;
    transition: gap 180ms ease, height 180ms ease, padding 180ms ease;
}

.logo {
    overflow: hidden;
    max-width: 430px;
    max-height: 80px;
    margin-right: 0;
    opacity: 1;
    text-align: center;
    transform: translateY(0);
    transition: max-height 180ms ease, max-width 180ms ease, margin 180ms ease, opacity 140ms ease, transform 180ms ease;
}

.logo-title {
    display: block;
    color: var(--gold);
    font-family: var(--serif);
    font-size: 58px;
    font-weight: 400;
    letter-spacing: -2px;
    line-height: 0.85;
}

.logo-subtitle {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 2.8px;
    text-transform: uppercase;
}

.header-tools {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
}

.header-search {
    display: flex;
    width: 142px;
    flex: 0 0 142px;
}

.header-search input {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 18px 0 0 18px;
    font-size: 12px;
}

.header-search button {
    width: 36px;
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 18px 18px 0;
    background: var(--paper);
    color: var(--rose-dark);
    cursor: pointer;
}

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Laat bij scrollen alleen de onderwerpnavigatie compact bovenaan staan. */
.topbar.is-compact .nav {
    gap: 0;
    height: 68px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.topbar.is-compact .logo {
    width: 0;
    max-width: 0;
    max-height: 0;
    margin-right: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-18px);
}

.topbar.is-compact .menu {
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 900px) {
    .nav {
        gap: 8px;
        padding-top: 12px;
        padding-bottom: 10px;
    }

    .logo {
        width: 100%;
        margin-right: 0;
        text-align: center;
    }

    .logo-title {
        font-size: 48px;
    }

    .topbar.is-compact .nav {
        height: 60px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .header-tools {
        gap: 7px;
    }

    .header-search {
        width: 38px;
        flex-basis: 38px;
    }

    .header-search input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
    }

    .header-search button {
        width: 38px;
        height: 38px;
        border-left: 1px solid var(--line);
        border-radius: 50%;
    }
}

@media (max-width: 560px) {
    .logo-title {
        font-size: 42px;
    }
}
