/*
 * Header search v4 – mobile category override.
 *
 * This file is loaded from header.inc after page-level main.css.
 * main.css remains untouched.
 */

@media screen and (max-width: 736px) {
    html body #header.ifk-site-header
    .ifk-header-search
    .ifk-header-search__tabs {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        grid-auto-rows: minmax(1.9rem, auto) !important;
        gap: .28rem !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: .48rem .55rem .55rem !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    html body #header.ifk-site-header
    .ifk-header-search
    .ifk-header-search__tabs > button[data-search-type] {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        inset: auto !important;
        float: none !important;
        align-items: center !important;
        justify-content: center !important;
        grid-column: auto !important;
        grid-row: auto !important;
        flex: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 1.95rem !important;
        height: auto !important;
        margin: 0 !important;
        padding: .34rem .24rem !important;
        overflow: visible !important;
        border-radius: .52rem !important;
        font-size: .63rem !important;
        line-height: 1.08 !important;
        white-space: normal !important;
        text-align: center !important;
        text-overflow: clip !important;
        transform: none !important;
        pointer-events: auto !important;
    }
}

@media screen and (max-width: 430px) {
    html body #header.ifk-site-header
    .ifk-header-search
    .ifk-header-search__tabs {
        gap: .22rem !important;
        padding: .42rem .44rem .48rem !important;
    }

    html body #header.ifk-site-header
    .ifk-header-search
    .ifk-header-search__tabs > button[data-search-type] {
        min-height: 1.82rem !important;
        padding: .28rem .14rem !important;
        font-size: .58rem !important;
        letter-spacing: -.012em !important;
    }
}

@media screen and (max-width: 340px) {
    html body #header.ifk-site-header
    .ifk-header-search
    .ifk-header-search__tabs {
        gap: .18rem !important;
        padding-inline: .32rem !important;
    }

    html body #header.ifk-site-header
    .ifk-header-search
    .ifk-header-search__tabs > button[data-search-type] {
        min-height: 1.74rem !important;
        padding-inline: .08rem !important;
        font-size: .53rem !important;
    }
}


/* Header search v4.1: compact, bounded site header on iPhone-sized viewports. */
@media screen and (max-width: 430px) {
    :root {
        --ifk-header-reserved-height: 3.85rem !important;
    }

    html body #header.ifk-site-header {
        height: 3.85rem !important;
        max-height: 3.85rem !important;
    }

    html body #header.ifk-site-header.ifk-site-header--compact {
        top: .34rem !important;
        right: .42rem !important;
        left: .42rem !important;
        height: 3.45rem !important;
        max-height: 3.45rem !important;
        border-radius: .82rem !important;
    }

    html body #header.ifk-site-header .ifk-header__inner {
        height: 100% !important;
        min-height: 0 !important;
        padding-inline: .55rem !important;
    }

    html body #header.ifk-site-header .logo.ifk-header__logo {
        font-size: 2.1rem !important;
        line-height: .88 !important;
    }

    html body #header.ifk-site-header.ifk-site-header--compact .logo.ifk-header__logo {
        font-size: 1.95rem !important;
    }

    html body #header.ifk-site-header .ifk-header__menu,
    html body #header.ifk-site-header .ifk-header__search-toggle {
        min-width: 2.7rem !important;
        width: 2.7rem !important;
        min-height: 2.7rem !important;
        height: 2.7rem !important;
        max-height: 2.7rem !important;
        padding: .42rem !important;
        border-radius: .72rem !important;
    }

    html body #header.ifk-site-header .ifk-header-search {
        top: calc(var(--ifk-header-reserved-height) + .38rem) !important;
        max-height: calc(100dvh - var(--ifk-header-reserved-height) - .8rem) !important;
    }

    html body #header.ifk-site-header.ifk-site-header--compact .ifk-header-search {
        top: 4rem !important;
    }
}

@media screen and (max-width: 390px) {
    :root {
        --ifk-header-reserved-height: 3.7rem !important;
    }

    html body #header.ifk-site-header {
        height: 3.7rem !important;
        max-height: 3.7rem !important;
    }

    html body #header.ifk-site-header .logo.ifk-header__logo {
        font-size: 2rem !important;
    }

    html body #header.ifk-site-header .ifk-header__menu,
    html body #header.ifk-site-header .ifk-header__search-toggle {
        min-width: 2.62rem !important;
        width: 2.62rem !important;
        min-height: 2.62rem !important;
        height: 2.62rem !important;
        max-height: 2.62rem !important;
    }
}

@media screen and (max-height: 520px) and (max-width: 932px) {
    :root {
        --ifk-header-reserved-height: 3.45rem !important;
    }

    html body #header.ifk-site-header {
        height: 3.45rem !important;
        max-height: 3.45rem !important;
    }

    html body #header.ifk-site-header.ifk-site-header--compact {
        top: .28rem !important;
        height: 3.2rem !important;
        max-height: 3.2rem !important;
    }

    html body #header.ifk-site-header .logo.ifk-header__logo,
    html body #header.ifk-site-header.ifk-site-header--compact .logo.ifk-header__logo {
        font-size: 1.9rem !important;
    }

    html body #header.ifk-site-header .ifk-header__menu,
    html body #header.ifk-site-header .ifk-header__search-toggle {
        min-height: 2.5rem !important;
        height: 2.5rem !important;
        max-height: 2.5rem !important;
    }
}


/* Header search v4.2: tighter iPhone header sizing. */
@media screen and (max-width: 430px) {
    :root {
        --ifk-header-reserved-height: 3.62rem !important;
    }

    html body #header.ifk-site-header {
        height: 3.62rem !important;
        max-height: 3.62rem !important;
    }

    html body #header.ifk-site-header.ifk-site-header--compact {
        height: 3.28rem !important;
        max-height: 3.28rem !important;
    }

    html body #header.ifk-site-header .logo.ifk-header__logo {
        font-size: 1.98rem !important;
    }

    html body #header.ifk-site-header.ifk-site-header--compact .logo.ifk-header__logo {
        font-size: 1.82rem !important;
    }

    html body #header.ifk-site-header .ifk-header__menu,
    html body #header.ifk-site-header .ifk-header__search-toggle {
        min-width: 2.56rem !important;
        width: 2.56rem !important;
        min-height: 2.56rem !important;
        height: 2.56rem !important;
        max-height: 2.56rem !important;
    }
}

@media screen and (max-width: 390px) {
    :root {
        --ifk-header-reserved-height: 3.5rem !important;
    }

    html body #header.ifk-site-header {
        height: 3.5rem !important;
        max-height: 3.5rem !important;
    }

    html body #header.ifk-site-header .logo.ifk-header__logo {
        font-size: 1.9rem !important;
    }

    html body #header.ifk-site-header .ifk-header__menu,
    html body #header.ifk-site-header .ifk-header__search-toggle {
        min-width: 2.46rem !important;
        width: 2.46rem !important;
        min-height: 2.46rem !important;
        height: 2.46rem !important;
        max-height: 2.46rem !important;
    }
}


/* Desktop spacing between the quiz quick-link and search control. */
#header.ifk-site-header .ifk-header__side--right {
    gap: .55rem;
}
