/* Municipal navigation: restrained surfaces, clear hierarchy and visible focus. */
body .osm-site-header .osm-primary-nav .sub-menu {
    box-sizing: border-box;
    width: 264px;
    min-width: 0;
    max-width: calc(100vw - 40px);
    padding: 8px;
    border: 1px solid var(--osm-submenu-border, #dfe5e8);
    border-radius: 16px;
    background: var(--osm-submenu-bg, #fff);
    box-shadow: 0 18px 48px rgb(15 28 38 / 13%), 0 3px 10px rgb(15 28 38 / 5%);
    z-index: 50;
}
body .osm-site-header .osm-primary-nav .sub-menu > li { margin: 0; }
body .osm-site-header .osm-primary-nav .sub-menu > li + li { margin-top: 3px; }
body .osm-site-header .osm-primary-nav .sub-menu > li > a {
    position: relative;
    padding: 12px 16px;
    border-radius: 9px;
    color: var(--osm-submenu-text, #172127);
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background-color 160ms ease, color 160ms ease;
}
body .osm-site-header .osm-primary-nav .sub-menu > li > a:is(:hover, :focus-visible) {
    background: var(--osm-soft, #f1f5f7);
    background: color-mix(in srgb, var(--osm-submenu-hover-bg, var(--osm-primary)) 9%, var(--osm-submenu-bg, #fff));
    color: var(--osm-submenu-text, #172127);
}
body .osm-site-header .osm-primary-nav .sub-menu > li:is(.current-menu-item, .current_page_item) > a {
    background: var(--osm-submenu-hover-bg, var(--osm-primary));
    color: var(--osm-submenu-hover-text, #fff);
}
body .osm-site-header .osm-primary-nav .sub-menu > li > a:focus-visible {
    outline: 2px solid var(--osm-primary, #175b82);
    outline-offset: -2px;
}
body .osm-site-header .osm-primary-nav .menu-item-has-children > a::after {
    width: 5px; height: 5px; margin-left: 10px;
    transition: transform 160ms ease;
}
@media (min-width: 1400px) {
    body .osm-site-header .osm-primary-nav li > .sub-menu { top: calc(100% + 10px); left: 0; }
    /* A pointer bridge keeps the dropdown open while crossing the small gap. */
    body .osm-site-header .osm-primary-nav li > .sub-menu::before {
        content: ""; position: absolute; inset: -12px 0 100%;
    }
    body .osm-site-header .osm-primary-nav li:is(:hover, :focus-within) > .sub-menu {
        animation: oursask-dropdown-enter 160ms ease-out;
    }
    body .osm-site-header .osm-primary-nav .sub-menu .sub-menu { top: -9px; left: calc(100% + 8px); }
    body .osm-site-header .osm-primary-nav .sub-menu .sub-menu::before { inset: 0 100% 0 -10px; }
    body .osm-site-header .osm-primary-nav .sub-menu .menu-item-has-children > a { padding-right: 32px; }
    body .osm-site-header .osm-primary-nav .sub-menu .menu-item-has-children > a::after {
        position: absolute; right: 16px; top: 20px; margin: 0; transform: rotate(-45deg);
    }
    body .osm-site-header .osm-primary-nav > div > ul > li:nth-last-child(-n+2) > .sub-menu { left: auto; right: 0; }
    body .osm-site-header .osm-primary-nav > div > ul > li:nth-last-child(-n+2) .sub-menu .sub-menu { left: auto; right: calc(100% + 8px); }
    body .osm-site-header .osm-primary-nav > div > ul > li:nth-last-child(-n+2) .sub-menu .sub-menu::before { inset: 0 -10px 0 100%; }
}
@media (max-width: 1399px) {
    body .osm-site-header .osm-primary-nav > div {
        border-radius: 16px; padding: 12px; box-shadow: 0 18px 48px rgb(15 28 38 / 13%);
    }
    body .osm-site-header .osm-primary-nav .sub-menu {
        position: static; width: auto; max-width: none; padding: 4px 0 4px 12px;
        margin: 3px 0 8px 14px; border: 0; border-left: 1px solid var(--osm-submenu-border, #dfe5e8);
        border-radius: 0; background: transparent; box-shadow: none;
    }
    body .osm-site-header .osm-primary-nav .sub-menu > li > a { min-height: 44px; padding: 11px 12px; }
    body .osm-site-header .osm-primary-nav .sub-menu > li > a { color: var(--osm-mobile-text, var(--osm-submenu-text)); }
    body .osm-site-header .osm-primary-nav .sub-menu > li > a:is(:hover, :focus-visible) {
        background: color-mix(in srgb, var(--osm-primary) 9%, var(--osm-mobile-bg, #fff));
        color: var(--osm-mobile-text, var(--osm-submenu-text));
    }
    body .osm-site-header .osm-primary-nav .sub-menu > li:is(.current-menu-item, .current_page_item) > a {
        background: var(--osm-submenu-hover-bg, var(--osm-primary)); color: var(--osm-submenu-hover-text, #fff);
    }
}
@keyframes oursask-dropdown-enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    body .osm-site-header .osm-primary-nav li > .sub-menu { animation: none; }
    body .osm-site-header .osm-primary-nav .sub-menu a,
    body .osm-site-header .osm-primary-nav .menu-item-has-children > a::after { transition: none; }
}

/* Mobile header: identity, search and menu on one row; navigation stays in flow. */
.osm-submenu-toggle { display:none; }
.osm-menu-symbol { width:22px;height:16px;position:relative;border-block:2px solid currentColor; }
.osm-menu-symbol::after { content:"";position:absolute;inset:5px 0 auto;border-top:2px solid currentColor; }
@media(max-width:1399px) {
 body .osm-site-header { display:flex;flex-direction:column; }
 body .osm-site-header .osm-header-main { order:1; }
 body .osm-site-header .osm-header-utility { order:3; }
 body .osm-site-header .osm-header-top { order:2;display:none; }
 body .osm-site-header.is-menu-open .osm-header-top { display:block; }
 body .osm-site-header .osm-header-top__inner { flex-wrap:wrap;gap:8px 18px;padding:12px 18px; }
 body .osm-site-header .osm-header-main__inner { display:grid;grid-template-columns:minmax(0,1fr) 44px 44px;gap:10px;width:100%;padding:14px 18px;min-height:142px; }
 body .osm-site-header .osm-header-main__inner::after { display:none; }
 body .osm-site-header .osm-branding { grid-column:1;grid-row:1;flex-wrap:wrap;gap:8px;max-width:100%; }
 body .osm-site-header .osm-branding__logo img { width:auto;max-width:min(140px,100%);max-height:130px;height:auto; }
 body .osm-site-header .osm-branding__name { font-size:16px; }
 body .osm-site-header .osm-branding__tagline { font-size:12px; }
 body .osm-site-header .osm-navigation-group,
 body .osm-site-header .osm-primary-nav { display:contents; }
 body .osm-site-header .osm-primary-nav__toggle { display:flex;align-items:center;justify-content:center;grid-column:3;grid-row:1;width:44px;height:44px;padding:10px;border:0;border-radius:0;background:transparent;color:var(--osm-nav-link,#172127); }
 body .osm-site-header .osm-header-search { grid-column:2;grid-row:1; }
 body .osm-site-header .osm-header-search summary { border-radius:0;background:transparent; }
 body .osm-site-header .osm-header-search__panel { right:-54px; }
 body .osm-site-header .osm-primary-nav>div { position:static;grid-column:1/-1;width:calc(100% + 36px);max-height:none;margin:4px -18px -14px;padding:8px 0;border:0;border-radius:0;box-shadow:none;background:var(--osm-mobile-bg,#f4f5f7);overflow:visible; }
 body .osm-site-header .osm-primary-nav>div ul { display:block;width:100%;padding:0;margin:0;border:0;border-radius:0;background:transparent;box-shadow:none;list-style:none; }
 body .osm-site-header .osm-primary-nav li { margin:0; }
 body .osm-site-header .osm-primary-nav li>a { padding:14px 18px;min-height:48px;border-radius:0;line-height:1.5;overflow-wrap:anywhere; }
 body .osm-site-header .osm-primary-nav .has-submenu-toggle>a { padding-right:68px; }
 body .osm-site-header .osm-primary-nav .menu-item-has-children>a::after { display:none; }
 body .osm-site-header .osm-primary-nav .osm-submenu-toggle { position:absolute;right:18px;top:3px;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:4px;background:var(--osm-primary,#175b82);color:var(--oursask-palette-primary-foreground,#fff); }
 .osm-submenu-toggle::after { content:"";width:9px;height:9px;border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-2px) rotate(45deg); }
 .osm-submenu-toggle[aria-expanded="true"]::after { transform:translateY(2px) rotate(225deg); }
 body .osm-site-header .osm-primary-nav .has-submenu-toggle>ul { display:none;position:static;max-width:none;min-width:0;padding-left:16px;box-sizing:border-box; }
 body .osm-site-header .osm-primary-nav .is-submenu-open>ul { display:block; }
 body .osm-site-header .osm-header-cta { grid-column:1/-1;display:none;justify-self:start;margin-top:12px; }
 body .osm-site-header.is-menu-open .osm-header-cta { display:inline-flex; }
 body .osm-site-header.is-menu-open .osm-menu-symbol { border:0; }
 body .osm-site-header.is-menu-open .osm-menu-symbol::before,
 body .osm-site-header.is-menu-open .osm-menu-symbol::after { content:"";position:absolute;inset:7px 0 auto;border-top:2px solid currentColor;transform:rotate(45deg); }
 body .osm-site-header.is-menu-open .osm-menu-symbol::after { transform:rotate(-45deg); }
 body .osm-site-header :is(.osm-primary-nav__toggle,.osm-submenu-toggle):focus-visible { outline:2px solid var(--osm-primary,#175b82);outline-offset:3px; }
}
@media(max-width:600px) {
 body .osm-home-hero { min-height:380px; }
 body .osm-home-hero__inner { width:100%;min-height:380px;padding:40px 20px;justify-content:center; }
 body .osm-home-hero__panel { width:100%;padding:24px 20px;border-radius:16px; }
 body .osm-home-hero__welcome { font-size:clamp(25px,8vw,36px);line-height:1.2; }
 body .osm-home-hero__panel h1 { font-size:clamp(27px,8vw,34px);line-height:1.4; }
 body .osm-home-hero__panel .search-form { max-width:100%; }
 body .osm-home-hero__panel input[type="search"] { min-width:0;width:100%; }
}
