/* Shared transparent / scrolled header, including the nursing navigation. */
body .header,
body .sample-header,
body.static-nursing-html.nursing-human-notes .sample-header {
    --header-ink: #00475b;
    background: transparent;
    border-color: transparent;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: background-color 600ms ease, color 350ms ease, border-color 600ms ease,
        box-shadow 600ms ease, backdrop-filter 600ms ease, -webkit-backdrop-filter 600ms ease;
}
body .header[data-header-tone="light"] { --header-ink: #fff; }
body:has(.header[data-header-tone="light"]) .hero { margin-top: 0; }
body .header.is-scrolled,
body .sample-header.is-scrolled,
body .header:has(.header__nav.active),
body .sample-header:has(.sample-nav.is-open),
body.static-nursing-html.nursing-human-notes .sample-header.is-scrolled,
body.static-nursing-html.nursing-human-notes .sample-header:has(.sample-nav.is-open) {
    --header-ink: #00475b;
    background: rgba(255, 255, 255, 0.9);
    border-color: #e1e9eb;
    box-shadow: 0 3px 18px #173e4a14 !important;
    -webkit-backdrop-filter: blur(14px) saturate(125%);
    backdrop-filter: blur(14px) saturate(125%);
}
body.static-nursing-html.nursing-human-notes .sample-header { position: fixed; }
body .header .header__logo-text,
body .header .header__logo-sub,
body .header .header__link,
body .header .header__tel,
body .sample-header .sample-logo,
body .sample-header .sample-logo__ja,
body .sample-header .sample-logo__en,
body .sample-header .sample-nav__primary a,
body .sample-header .sample-nav__hospital {
    color: var(--header-ink);
}
body .header .header__link::after,
body .header .header__hamburger span,
body .sample-header .sample-menu span { background-color: var(--header-ink); }
body .header .mega-menu { color: #334b50; }
.header .mega-menu__list a { transition: color 300ms ease, opacity 300ms ease; }
.has-mega-menu:not([data-mega-managed]):focus-within .mega-menu { opacity: 1; visibility: visible; transform: none; }
@media (min-width: 768px) {
    .header .mega-menu {
        top: calc(var(--header-height) + 12px);
        left: var(--mega-left, 16px);
        width: min(1400px, calc(100% - 32px));
        border: 0;
        border-radius: 22px;
        box-shadow: 0 16px 44px #173e4a24;
        background-color: rgba(255, 255, 255, 0.93);
        -webkit-backdrop-filter: blur(12px) saturate(130%);
        backdrop-filter: blur(12px) saturate(130%);
    }
    /* backdrop-filter を持つ祖先はメガメニューのぼかし範囲を遮るため、ヘッダーのぼかしは擬似要素へ移す */
    body .header.is-scrolled,
    body .header:has(.header__nav.active) {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    body .header::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: -1;
        pointer-events: none;
        transition: backdrop-filter 600ms ease, -webkit-backdrop-filter 600ms ease;
    }
    body .header.is-scrolled::before,
    body .header:has(.header__nav.active)::before {
        -webkit-backdrop-filter: blur(14px) saturate(125%);
        backdrop-filter: blur(14px) saturate(125%);
    }
    .header .mega-menu::before {
        content: '';
        position: absolute;
        bottom: calc(100% - 1px);
        left: var(--mega-pointer-x, 50%);
        width: 28px;
        height: 16px;
        background: rgba(255, 255, 255, 0.93);
        clip-path: polygon(50% 0, 100% 100%, 0 100%);
        transform: translateX(-50%);
    }
    .header .has-mega-menu[data-mega-managed] > .mega-menu {
        pointer-events: none;
        transition: opacity 300ms ease, transform 300ms ease, visibility 0s linear 300ms;
    }
    .header .has-mega-menu.is-mega-open > .mega-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
        transition-delay: 0s;
    }
}
body .header[data-header-tone="light"]:not(.is-scrolled):not(:has(.header__nav.active)) .header__item--cta .btn {
    background: #fff;
    color: #00475b;
}
/* =========================================
   Tab bar for phones and tablets (built by header.js): up to 1024px wide, and touch screens up to 1366px.
   Five main pages and 総合メニュー sit at the bottom of the screen in place of the header's menu (its links and "≡").
   The current item rises into a round bubble; the bubble slides to whichever item is tapped.
   ========================================= */
.tabbar { display: none; }
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
    /* With the tab bar, the header no longer stays at the top: it scrolls away with the page and
       keeps its at-the-top look (no white band) while it is still on screen. The same goes for 看護部's own
       header (:is() outweighs its fixed position in the static-authoring rules). */
    html.has-tabbar body .header,
    html.has-tabbar body:is(*, .static-nursing-html.nursing-human-notes) .sample-header {
        position: absolute;
    }
    html.has-tabbar body .header.is-scrolled,
    html.has-tabbar body:is(*, .static-nursing-html.nursing-human-notes) .sample-header.is-scrolled {
        --header-ink: #00475b;
        background: transparent;
        border-color: transparent;
        box-shadow: none !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
    html.has-tabbar body .header.is-scrolled[data-header-tone="light"] { --header-ink: #fff; }
    html.has-tabbar { --tabbar-h: 64px; --tabbar-gap: 8px; }
    /* The tab bar replaces the header's menu: only the logo stays (the site header and 看護部's own header). */
    html.has-tabbar .header__hamburger,
    html.has-tabbar body .header .header__nav,
    html.has-tabbar body .sample-header .sample-menu,
    html.has-tabbar body .sample-header .sample-nav { display: none; }
    html.has-tabbar body { padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) * 2 + env(safe-area-inset-bottom)); }
    .tabbar {
        --tab-ink: #00475b;
        --tab-muted: #5a7175;
        --tab-index: 0;
        position: fixed;
        z-index: 1003;
        left: var(--tabbar-gap);
        right: var(--tabbar-gap);
        bottom: calc(var(--tabbar-gap) + env(safe-area-inset-bottom));
        /* Wide enough that the end items' bump (54px) clears the 18px rounded corners entirely. */
        --tab-pad: 19px;
        display: block;
        height: var(--tabbar-h);
        border-radius: 18px;
    }
    /* Frosted glass with the same values as the mega menu (white .93, blur 12px, saturate 130%).
       It sits on a pseudo-element because a backdrop-filter on the bar itself would stop the
       bubble's own blur from reaching the page behind it. */
    .tabbar::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        border-radius: inherit;
        background-color: rgba(255, 255, 255, 0.93);
        -webkit-backdrop-filter: blur(12px) saturate(130%);
        backdrop-filter: blur(12px) saturate(130%);
        /* No outline ring: under the glass bump it showed as a thin line across the bump's foot. */
        /* Only a downward shadow: anything reaching above the top edge shows through the bump. */
        box-shadow: 0 12px 30px -14px rgba(0, 56, 72, .45), 0 6px 12px -8px rgba(0, 56, 72, .22);
        pointer-events: none;
    }
    /* Photo-hero pages: the bar waits below the picture and fades in once scrolling starts. */
    /* It only fades: the bar keeps its place, so nothing moves while the page scrolls. */
    .tabbar.waits-for-scroll {
        opacity: 0;
        pointer-events: none;
        transition: opacity 600ms ease;
    }
    .tabbar.waits-for-scroll.is-revealed,
    .tabbar.waits-for-scroll:focus-within {
        opacity: 1;
        pointer-events: auto;
    }
    /* Side padding keeps the first and last items' bump inside the bar's rounded corners. */
    .tabbar__list {
        position: relative;
        z-index: 1;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        height: 100%;
        margin: 0;
        padding: 0 var(--tab-pad);
        list-style: none;
    }
    .tabbar__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 4px;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0 0 9px;
        border: 0;
        background: none;
        color: var(--tab-muted);
        font: inherit;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .tabbar__icon {
        display: grid;
        place-items: center;
        width: 26px;
        height: 26px;
        transition: transform 460ms cubic-bezier(.34, 1.45, .64, 1), color 260ms ease;
    }
    .tabbar__label { font-size: 10px; font-weight: 700; line-height: 1.2; letter-spacing: 0; white-space: nowrap; }
    .tabbar__item.is-active { color: var(--tab-ink); }
    .tabbar__item.is-active .tabbar__icon { color: #fff; transform: translateY(-18px); }
    .tabbar__item:focus-visible { outline: 3px solid #237a8c; outline-offset: -3px; border-radius: 14px; }
    /* One sixth of the bar wide; a white bump rising above the bar with a teal disc inside. */
    .tabbar__bubble {
        position: absolute;
        z-index: 0;
        left: var(--tab-pad);
        top: 0;
        width: calc((100% - var(--tab-pad) * 2) / 6);
        height: 100%;
        opacity: 0;
        pointer-events: none;
        transform: translateX(calc(var(--tab-index) * 100%));
        transition: transform 460ms cubic-bezier(.22, 1, .36, 1), opacity 200ms ease;
    }
    .tabbar.is-settled .tabbar__bubble { will-change: transform; }
    .tabbar.has-active .tabbar__bubble { opacity: 1; }
    .tabbar__bubble::before,
    .tabbar__bubble::after {
        content: "";
        position: absolute;
        left: 50%;
        border-radius: 50%;
        transform: translateX(-50%);
    }
    /* The bump uses the same glass; it is cut at the bar's top edge so the two layers never overlap. */
    .tabbar__bubble::before {
        top: -19px;
        width: 54px;
        height: 54px;
        background-color: rgba(255, 255, 255, 0.93);
        -webkit-backdrop-filter: blur(12px) saturate(130%);
        backdrop-filter: blur(12px) saturate(130%);
        box-shadow: 0 -8px 16px -10px rgba(0, 56, 72, .4);
        clip-path: inset(-20px -20px 35px -20px);
    }
    .tabbar__bubble::after {
        top: -14px;
        width: 44px;
        height: 44px;
        background: linear-gradient(150deg, #0f6c80, #00475b);
        box-shadow: 0 6px 14px -6px rgba(0, 71, 91, .7);
    }
}
/* 採用メニュー: on recruit pages the last button opens the recruit menu instead of 総合メニュー.
   It is set apart in rose (a card icon on a soft tile), and its bubble turns rose while the menu is open. */
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
    .tabbar__menu--page { color: #c4446a; }
    .tabbar__menu--page .tabbar__icon {
        width: 30px;
        height: 26px;
        border-radius: 9px;
        background: #fde9ef;
        box-shadow: inset 0 0 0 1px #f6c9d6;
    }
    .tabbar__menu--page .tabbar__label { color: #c4446a; }
    .tabbar__menu--page.is-active .tabbar__icon { background: none; box-shadow: none; }
    .tabbar.is-page-menu-open .tabbar__bubble::after {
        background: linear-gradient(150deg, #e46d8d, #c4446a);
        box-shadow: 0 6px 14px -6px rgba(196, 68, 106, .7);
    }
    .global-menu--page .global-menu__row[aria-current="page"] { border-color: #f1b8c8; background: #fff6f8; }
    .global-menu--page .global-menu__row[aria-current="page"] .global-menu__icon { color: #c4446a; }
}
/* 総合メニュー: a sheet that rises from the bottom (above the tab bar) over a dimmed page.
   Level 1 lists the sections; choosing one slides its pages in from the right. */
.global-menu { display: none; }
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
    html.is-global-menu-open { overflow: hidden; }
    .global-menu {
        --gm-ink: #00475b;
        --gm-text: #33494d;
        --gm-muted: #5d7276;
        --gm-line: #dbe7e3;
        --gm-mint: #e6f2ee;
        --gm-paper: #fbfcfa;
        position: fixed;
        inset: 0 0 calc(var(--tabbar-h, 64px) + var(--tabbar-gap, 8px) * 2 + env(safe-area-inset-bottom));
        z-index: 1002;
        display: block;
        color: var(--gm-text);
        visibility: hidden;
        pointer-events: none;
        transition: visibility 0s linear 480ms;
    }
    .global-menu.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
    .global-menu a { color: inherit; text-decoration: none; }
    .global-menu button { font: inherit; color: inherit; cursor: pointer; }
    .global-menu ul { margin: 0; padding: 0; list-style: none; }
    .global-menu :focus-visible { outline: 3px solid #237a8c; outline-offset: 2px; }
    .global-menu__backdrop {
        position: absolute;
        inset: 0 0 calc((var(--tabbar-h, 64px) + var(--tabbar-gap, 8px) * 2 + env(safe-area-inset-bottom)) * -1);
        background: rgba(0, 40, 50, .38);
        opacity: 0;
        transition: opacity 360ms ease;
    }
    .global-menu.is-open .global-menu__backdrop { opacity: 1; }
    .global-menu__sheet {
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: 10px;
        display: flex;
        flex-direction: column;
        height: min(640px, calc(100% - 56px));
        overflow: hidden;
        border-radius: 26px;
        background: #fff;
        box-shadow: 0 -10px 40px -16px rgba(0, 40, 50, .5);
        transform: translateY(calc(100% + 120px));
        transition: transform 520ms cubic-bezier(.34, 1.3, .64, 1);
    }
    .global-menu.is-open .global-menu__sheet { transform: none; }
    .global-menu__handle { flex: none; align-self: center; width: 44px; height: 5px; margin-top: 10px; border-radius: 3px; background: #cfdcd8; }
    .global-menu__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 8px 20px; }
    .global-menu__title { margin: 0; color: var(--gm-ink); font-size: 18px; font-weight: 700; letter-spacing: .06em; }
    .global-menu__close { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--gm-mint); color: var(--gm-ink) !important; }
    .global-menu__track { display: flex; flex: 1; width: 200%; min-height: 0; transition: transform 420ms cubic-bezier(.22, 1, .36, 1); }
    .global-menu.is-deep .global-menu__track { transform: translateX(-50%); }
    /* flex: none and min-width: 0 stop one long line from widening a level past the sheet. */
    .global-menu__level { flex: none; width: 50%; min-width: 0; min-height: 0; padding: 4px 18px 20px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .global-menu__rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .global-menu__row {
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        min-height: 78px;
        padding: 12px 14px;
        border: 1px solid var(--gm-line);
        border-radius: 18px;
        background: var(--gm-paper);
        text-align: left;
    }
    .global-menu__row > svg { flex: none; color: #8aa2a5; }
    .global-menu__icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: #fff; color: var(--gm-ink); box-shadow: inset 0 0 0 1px var(--gm-line); }
    .global-menu__row-text { flex: 1; min-width: 0; }
    .global-menu__row-text strong { display: block; color: var(--gm-ink); font-size: 17px; line-height: 1.4; }
    .global-menu__row-text small { display: block; margin-top: 2px; overflow: hidden; color: var(--gm-muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
    .global-menu__contact { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; margin-top: 18px; border-radius: 999px; background: var(--gm-ink); color: #fff !important; font-size: 16px; font-weight: 700; }
    .global-menu__back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 8px; border: 0; border-radius: 999px; background: var(--gm-mint); color: var(--gm-ink) !important; font-weight: 700; }
    .global-menu__sub-title { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; color: var(--gm-ink); font-size: 20px; font-weight: 700; }
    .global-menu__links { border-top: 1px solid var(--gm-line); }
    .global-menu__links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 10px 6px 10px 4px; border-bottom: 1px solid var(--gm-line); font-size: 16px; font-weight: 500; }
    .global-menu__links a svg { flex: none; color: #8aa2a5; }
}
@media (max-width: 1024px) and (prefers-reduced-motion: reduce), (pointer: coarse) and (max-width: 1366px) and (prefers-reduced-motion: reduce) {
    .global-menu, .global-menu__backdrop, .global-menu__sheet, .global-menu__track { transition: none; }
}
/* Tablets: the tab bar grows with the screen so it looks the same on every tablet: 1.2 times the phone's at 768px
   wide, in proportion up to 1.6 times at 1024px (--tu, the size of one phone pixel). Bar, bump, icons and labels
   all follow; the bar stays centred instead of spanning the screen. The menu sheet keeps about a phone's width.
   (Outside the tab bar's sizes neither is shown, so this needs no further condition.) */
@media (min-width: 768px) {
    html.has-tabbar { --tu: clamp(1.2px, 0.15625vw, 1.6px); --tabbar-h: calc(64 * var(--tu)); }
    .tabbar {
        left: max(var(--tabbar-gap), calc(50% - 280 * var(--tu)));
        right: max(var(--tabbar-gap), calc(50% - 280 * var(--tu)));
        --tab-pad: calc(19 * var(--tu));
        border-radius: calc(18 * var(--tu));
    }
    .tabbar__item { gap: calc(4 * var(--tu)); padding-bottom: calc(9 * var(--tu)); }
    .tabbar__icon { width: calc(26 * var(--tu)); height: calc(26 * var(--tu)); }
    .tabbar__icon svg { width: calc(24 * var(--tu)); height: calc(24 * var(--tu)); }
    .tabbar__label { font-size: calc(10 * var(--tu)); }
    .tabbar__item.is-active .tabbar__icon { transform: translateY(calc(-18 * var(--tu))); }
    .tabbar__item:focus-visible { border-radius: calc(14 * var(--tu)); }
    .tabbar__bubble::before {
        top: calc(-19 * var(--tu));
        width: calc(54 * var(--tu));
        height: calc(54 * var(--tu));
        clip-path: inset(calc(-20 * var(--tu)) calc(-20 * var(--tu)) calc(35 * var(--tu)) calc(-20 * var(--tu)));
    }
    .tabbar__bubble::after { top: calc(-14 * var(--tu)); width: calc(44 * var(--tu)); height: calc(44 * var(--tu)); }
    .tabbar__menu--page .tabbar__icon { width: calc(30 * var(--tu)); height: calc(26 * var(--tu)); border-radius: calc(9 * var(--tu)); }
    .global-menu__sheet { left: max(8px, calc(50% - 300px)); right: max(8px, calc(50% - 300px)); }
}
@media print { .tabbar, .global-menu { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
    .tabbar__icon, .tabbar__bubble, .tabbar.waits-for-scroll { transition: none; }
    body .header, body .sample-header { transition: none; }
    .header .has-mega-menu[data-mega-managed] > .mega-menu { transition: none; }
}
