.ksc-mobile-header-slot[data-ksc-mobile-header] {
    position: sticky;
    top: 0;
    z-index: 1100;
    pointer-events: none;
}

@media (min-width: 768px) {
    .ksc-mobile-header-slot {
        position: sticky;
        top: 0;
        z-index: 1100;
    }

    .ksc-mobile-header-slot > .site-header {
        background-color: #fff;
    }

    body.admin-bar .ksc-mobile-header-slot {
        top: var(--wp-admin--admin-bar--height, 32px);
    }
}

@media (min-width: 601px) {
    body.admin-bar .ksc-mobile-header-slot[data-ksc-mobile-header] {
        top: 46px;
    }
}

.ksc-mobile-header-slot[data-ksc-mobile-header] > .site-header {
    background-color: #fff;
    pointer-events: auto;
    transition: none;
}

.ksc-mobile-header-slot[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) {
    /* Keep the content at the same scroll position as the header shrinks. */
    min-height: var(--ksc-header-full-height);
}

.ksc-mobile-header-slot[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) > .site-header {
    padding-block: .6rem;
    box-shadow: 0 .25rem .8rem rgba(0, 0, 0, .12);
}

.ksc-mobile-header-slot[data-ksc-mobile-header="hidden"] > .site-header:not(:has(:focus-visible)) {
    transform: translateY(calc(-100% - 1.25rem));
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .ksc-mobile-header-slot[data-ksc-mobile-header] > .site-header {
        transition: transform .2s ease;
    }
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #siteheader > .wrapper {
    box-sizing: border-box;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: .4rem;
    padding-inline: 1rem;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #siteheader .col-site-brand {
    flex: 0 1 11.2rem;
    min-width: 0;
    margin: 0;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #siteheader .logo img {
    display: block;
    width: 100%;
    transition: none;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #siteheader .ksc-header-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: .4rem;
    width: auto;
    margin: 0;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .menu > li {
    margin: 0;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation a[href="#search-popup"],
[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .toggle-icon a {
    display: grid;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation a[href="#search-popup"] .icon {
    width: 21px;
    height: 21px;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .toggle-icon a span {
    left: 10px;
    width: 24px;
    height: 3px;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .toggle-icon a span:nth-child(1) {
    top: 13px;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .toggle-icon a span:nth-child(2) {
    top: 20px;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .toggle-icon a span:nth-child(3) {
    top: 27px;
}

[data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #site-navigation .toggle-icon.open a span {
    top: 20px;
}

[data-ksc-mobile-header] #ksc-hamburger-menu {
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ksc-mobile-header-slot + #search-popup:target {
    z-index: 1200;
}

@media (min-width: 768px) {
    .ksc-mobile-header-slot[data-ksc-desktop-header] {
        --ksc-desktop-header-offset: 0px;
        pointer-events: none;
    }

    body.admin-bar .ksc-mobile-header-slot[data-ksc-desktop-header] {
        --ksc-desktop-header-offset: var(--wp-admin--admin-bar--height, 32px);
    }

    .ksc-mobile-header-slot[data-ksc-desktop-header] > .site-header {
        pointer-events: auto;
        transition: none;
    }

    .ksc-mobile-header-slot[data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) {
        min-height: var(--ksc-header-full-height);
    }

    .ksc-mobile-header-slot[data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) > .site-header {
        padding-block: .6rem;
        box-shadow: 0 .25rem .8rem rgba(0, 0, 0, .12);
    }

    .ksc-mobile-header-slot[data-ksc-desktop-header="hidden"] > .site-header:not(:has(:focus-visible)) {
        transform: translateY(calc(-100% - var(--ksc-desktop-header-offset) - 1.25rem));
        pointer-events: none;
    }

    [data-ksc-desktop-header] #siteheader .logo img {
        transition: none;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #siteheader .logo img {
        width: 144px;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #top-navigation .search-form button .icon {
        width: 18px;
        height: 18px;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #site-navigation .toggle-icon a {
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        padding: 0;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #site-navigation .toggle-icon a span {
        left: 8px;
        width: 28px;
        height: 4px;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #site-navigation .toggle-icon a span:nth-child(1) {
        top: 12px;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #site-navigation .toggle-icon a span:nth-child(2) {
        top: 20px;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #site-navigation .toggle-icon a span:nth-child(3) {
        top: 28px;
    }

    [data-ksc-desktop-header]:not([data-ksc-desktop-header="full"]) #site-navigation .toggle-icon.open a span {
        top: 20px;
    }

    [data-ksc-desktop-header] #ksc-hamburger-menu {
        height: calc(100dvh - var(--ksc-desktop-header-offset));
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
    .ksc-mobile-header-slot[data-ksc-desktop-header] > .site-header {
        transition: transform .2s ease;
    }
}

/* The speaker list belongs to the same row as the primary navigation. */
#site-navigation .menu { display: flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
#site-navigation .ksc-list-link > a { display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; }
#site-navigation .ksc-list-link .num { display: inline-grid; place-items: center; min-width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #bfbd08; color: #27301e; font-size: 1.2rem; }
#site-navigation .ksc-list-link { font-size: 1.5rem; }
@media (max-width: 767px) {
 #siteheader .col-site-brand { flex: 0 1 28%; }
 #siteheader .ksc-header-controls { flex: 1 1 70%; width: auto; }
 #site-navigation .ksc-list-link { margin: 0 .3rem 0 0; font-size: 1.2rem; }
 #site-navigation .ksc-list-link > a { padding: .4rem 0; gap: .35rem; }
 #site-navigation .menu { gap: .2rem; }
 [data-ksc-mobile-header]:not([data-ksc-mobile-header="full"]) #siteheader .col-site-brand { flex-basis: 6rem; }
}

#site-navigation .ksc-list-link { display: list-item !important; }
#site-navigation .ksc-list-link > a::before { content: none; }
#site-navigation .menu > li > a { white-space: nowrap; }
@media (max-width: 767px) {
 #siteheader > .wrapper { display:flex; flex-wrap:nowrap; gap:.6rem; align-items:center; }
 #siteheader .col-site-brand { flex:0 0 6.8rem; width:6.8rem; margin:0; }
 #siteheader .col-site-brand img { width:100%; }
 #siteheader .ksc-header-controls { flex:1 1 auto; width:auto; min-width:0; margin:0; }
 #site-navigation .menu > li { margin-left:.4rem; margin-right:0; }
 #site-navigation a[href="#search-popup"] { padding:0; width:3.2rem; display:grid; place-items:center; }
 #site-navigation a[href="#search-popup"] .icon { width:2.4rem; height:2.4rem; }
 #site-navigation .ksc-list-link { font-size:1.2rem; }
 #site-navigation .ksc-list-link > a { min-height:4.4rem; }
 #site-navigation .ksc-list-link .num { min-width:1.8rem; width:1.8rem; height:1.8rem; padding:0; }
 #site-navigation .toggle-icon a { width:3.2rem; }
 #site-navigation .toggle-icon a span { width:3.2rem; }
}
@media (min-width:768px) and (max-width:1100px) {
 #siteheader > .wrapper { flex-wrap:nowrap; }
 #siteheader .col-site-brand { flex:0 0 12rem; margin:0; }
 #siteheader .col-site-brand img { width:12rem; }
 #siteheader .ksc-header-controls { flex:1 1 auto; width:auto; margin:0; }
 #site-navigation .menu>li { margin-left:.8rem; margin-right:0; }
 #site-navigation .menu>li>a, html[lang="fr-CA"] #site-navigation .menu>li>a { font-size:1.2rem; }
}
@media (max-width:767px) {
 #siteheader > .wrapper { box-sizing:border-box; width:100%; padding-inline:1.6rem; margin-inline:0; }
 #siteheader .col-site-brand { flex-basis:8.8rem; width:8.8rem; }
 html[lang="fr-CA"] #siteheader .col-site-brand { flex-basis:6.8rem; width:6.8rem; }
}
@media (min-width:768px) and (max-width:1100px) {
 #siteheader > .wrapper { box-sizing:border-box; width:100%; padding-inline:1.6rem; margin-inline:0; }
}

/* Separate the desktop search field from the hamburger below it. */
@media (min-width: 768px) {
 #top-navigation .search-form { transform: translateY(-12px); }
}

/* Reserve a dedicated button area so search text stays clear on hover. */
@media (min-width: 768px) {
 #top-navigation .search-form { width: 26rem; max-width: 100%; }
 #top-navigation .search-form input[type="search"] { width: 100%; padding-right: 3.8rem; }
 #top-navigation .search-form .search-submit { top: 1px; right: 1px; width: 3.2rem; height: calc(100% - 2px); }
}

/* Saved-speaker count inside a heart, retaining the live count element. */
#site-navigation .ksc-list-link .num {
 min-width: 3.2rem; width: 3.2rem; height: 3.2rem; flex: 0 0 3.2rem;
 border-radius: 0; padding: 0 0 .2rem; margin: 0;
 background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23bfbd08' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54z'/%3E%3C/svg%3E") center / contain no-repeat;
 color: #27301e; font-size: 1.1rem; font-weight: 700; line-height: 1;
}
@media (max-width: 767px) {
 #site-navigation .ksc-list-link .num { min-width: 3rem; width: 3rem; height: 3rem; flex-basis: 3rem; }
}

/* A compact, lighter hamburger in both full and sticky headers. */
#siteheader #site-navigation .toggle-icon a {
 box-sizing: border-box; width: 44px; height: 44px; padding: 0;
}
#siteheader #site-navigation .toggle-icon a span {
 left: 9px; width: 26px; height: 3px; border-radius: 2px;
}
#siteheader #site-navigation .toggle-icon a span:nth-child(1) { top: 12px; }
#siteheader #site-navigation .toggle-icon a span:nth-child(2) { top: 20px; }
#siteheader #site-navigation .toggle-icon a span:nth-child(3) { top: 28px; }
#siteheader #site-navigation .toggle-icon.open a span { top: 20px; }
#siteheader #site-navigation .toggle-icon.open a span:nth-child(2) { left: 9px; }

/* The utility row is visible above the main navigation on larger screens. */
#siteheader #top-navigation .ksc-header-utilities { display: none; }
@media (min-width: 768px) {
 #siteheader #top-navigation { align-items: center; gap: 2rem; }
 #siteheader #top-navigation .ksc-header-utilities { display: flex; align-items: center; gap: 2rem; transform: translateY(-12px); }
 #siteheader #top-navigation .ksc-header-utilities li { margin: 0; }
 #siteheader #top-navigation .ksc-header-utilities a { padding: .4rem 0; font-size: 1.4rem; white-space: nowrap; }
 #siteheader #top-navigation .ksc-header-utilities a:hover { text-decoration: underline; }
}

/* Keep the utility row in proportion to the smaller tablet navigation. */
@media (min-width: 768px) and (max-width: 1100px) {
 #siteheader #top-navigation .ksc-header-utilities a { font-size: 1.2rem; }
 #siteheader #top-navigation .search-form { width: 22rem; }
 #siteheader #top-navigation .search-form input[type="search"] { font-size: 1.2rem; }
}

/* Use one navigation mode at the existing phone/search layout boundary. */
@media (min-width: 768px) {
 #siteheader #site-navigation .menu > li.toggle-icon { display: none; }
}

#siteheader #site-navigation a:focus-visible {
 outline: 2px solid #344227;
 outline-offset: 3px;
 transition: none;
}
#siteheader #site-navigation .toggle-icon.open a:focus-visible {
 outline-color: #fff;
}
#ksc-hamburger-menu a:focus-visible {
 outline: 2px solid #fff;
 outline-offset: -2px;
 transition: none;
}
