/* A full-width masthead, independent of each worksheet's content column. */
@font-face {
    font-family: AgeCalcWordmark;
    src: url("../sketch/gaegu-title.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}
html body .site-header.agecalc-mast {
    --mast-ink: #332e31;
    --mast-sheet: #fffdf8;
    --mast-font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
    position: relative;
    inset: auto;
    z-index: 40;
    display: block;
    width: 100vw;
    max-width: none;
    min-height: 0;
    margin: 0 calc(50% - 50vw);
    padding: 0;
    border: 0;
    border-bottom: 2px solid var(--mast-ink);
    border-radius: 0;
    background: #fffdf5;
    box-shadow: none;
    color: var(--mast-ink);
    line-height: 1.4;
    isolation: isolate;
}
.agecalc-mast .agecalc-mast-inner {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: clamp(20px, 3.5vw, 54px);
    width: min(1220px, 91%);
    max-width: none;
    min-height: 64px;
    margin: 0 auto;
    padding: 0;
}
html body .agecalc-mast .agecalc-wordmark {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 5px;
    padding: 0;
    min-height: 44px;
    margin: 0;
    color: var(--mast-ink);
    font: 700 38px/1 AgeCalcWordmark, var(--mast-font);
    letter-spacing: -.04em;
    text-decoration: none;
    white-space: nowrap;
}
html body .agecalc-mast .agecalc-wordmark .icon {
    display: block;
    flex: none;
    width: 37px;
    height: 37px;
    transform: rotate(-7deg);
}
html body .agecalc-mast .agecalc-wordmark span {
    background: linear-gradient(177deg, transparent 73%, #ffe397 74% 86%, transparent 87%);
}
html body .agecalc-mast .mega-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    margin: 0;
    padding: 0;
}
html body .agecalc-mast .mega-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    color: var(--mast-ink);
    font: 650 15px/1.4 var(--mast-font);
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}
html body .agecalc-mast .mega-nav a:is(.is-active,:hover,:focus-visible) {
    background: linear-gradient(178deg, transparent 18%, #ffebaf 19% 82%, transparent 84%);
}
html body .agecalc-mast .agecalc-mast-actions {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-inline-start: auto;
    padding: 0;
}
html body .agecalc-mast :is(.agecalc-mast-control,.language-switcher summary) {
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 12px;
    border: 1.5px solid var(--mast-ink);
    border-radius: 14px 11px 14px 10px;
    background: var(--mast-sheet);
    box-shadow: none;
    color: var(--mast-ink);
    font: 650 14px/1.3 var(--mast-font);
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
}
html body .agecalc-mast .agecalc-mast-control { display: inline-flex; }
.agecalc-mast .agecalc-nojs-menu { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; white-space: nowrap; }
html body .agecalc-mast .agecalc-mast-actions:has(.agecalc-nojs-menu) > button { display: none; }
html body .agecalc-mast .menu-toggle { display: none; }
.agecalc-menu-icon, .agecalc-menu-icon::before, .agecalc-menu-icon::after {
    display: block;
    width: 17px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}
.agecalc-menu-icon { position: relative; }
.agecalc-menu-icon::before, .agecalc-menu-icon::after { content: ""; position: absolute; left: 0; }
.agecalc-menu-icon::before { top: -5px; }
.agecalc-menu-icon::after { top: 5px; }
html body .agecalc-mast .language-switcher:not([open]) > nav { display: none; }
html body .agecalc-mast .language-switcher { position: relative; }
html body .agecalc-mast .language-switcher > nav {
    position: absolute;
    inset: calc(100% + 6px) 0 auto auto;
    width: min(260px, calc(100vw - 32px));
    max-width: none;
    padding: 6px;
    background: var(--mast-sheet);
    color: var(--mast-ink);
    border: 1.5px solid var(--mast-ink);
    border-radius: 10px;
    box-shadow: 2px 3px #ded3bd;
    font: 400 14px/1.5 var(--mast-font);
}
html body .agecalc-mast .language-switcher nav a { color: var(--mast-ink); }
html body .agecalc-mast .language-switcher nav a:is(:hover,[aria-current]) { background: #fff0bc; }
.agecalc-mast .visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
html body .agecalc-mast .reading-progress { position: absolute; inset: auto 0 -2px; width: 100%; height: 2px; background: transparent; pointer-events: none; }
html body .agecalc-mast .reading-progress-fill { display: block; height: 100%; background: #b68143; transform: scaleX(0); transform-origin: left; }

@media (max-width: 900px) {
    .agecalc-mast .agecalc-mast-inner { width: calc(100% - 48px); min-height: 58px; gap: 8px; }
    html body .agecalc-mast .agecalc-wordmark { font-size: 32px; }
    html body .agecalc-mast .agecalc-wordmark .icon { width: 31px; height: 31px; }
    html body .agecalc-mast :is(.mega-nav,.desktop-menu-toggle) { display: none; }
    html body .agecalc-mast .menu-toggle { display: inline-flex; }
    html body .agecalc-mast .language-switcher { position: static; }
    html body .agecalc-mast .language-switcher > nav { right: 0; }
}
@media (max-width: 719px) {
    .agecalc-mast .agecalc-mast-inner { width: calc(100% - 32px); }
}
@media print { html body .site-header.agecalc-mast { display: none; } }

/* The drawers are mounted under body, including on the standalone age worksheet. */
html body:has(.agecalc-directory-panel.is-open) { overflow: hidden; }
html body > .agecalc-directory-panel, html body > .agecalc-directory-overlay {
    position: fixed;
    margin: 0;
}
html body > .agecalc-directory-overlay {
    display: block;
    inset: 0;
    z-index: 1010;
    background: #332e3152;
    opacity: 0;
}
html body > .agecalc-directory-overlay.is-open { opacity: 1; }
html body > .agecalc-directory-panel {
    display: block;
    inset: 0 0 0 auto;
    z-index: 1020;
    width: min(420px, 94vw);
    max-width: 100%;
    padding: 18px 20px 28px;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fffdf8;
    border: 0;
    border-left: 1.5px solid #332e31;
    border-radius: 0;
    box-shadow: -4px 0 0 #332e3112;
    color: #332e31;
    transform: translateX(101%);
    font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
html body > .agecalc-directory-panel.is-open { transform: translateX(0); }
html body > :is(.agecalc-directory-panel,.agecalc-directory-overlay)[hidden] { display: none; }
.agecalc-directory-panel :is(.mobile-nav-head,.desktop-nav-head) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
}
.agecalc-directory-panel :is(h3,.desktop-nav-head strong) { color: inherit; font-size: 20px; font-weight: 700; line-height: 1.3; }
.agecalc-directory-panel :is(.desktop-nav-close,.mobile-nav-close) {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 26px;
    color: inherit;
    background: #fffdf8;
    border: 1px solid #6c625a;
    border-radius: 10px;
}
.agecalc-directory-panel .sketch-finder-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 12px 0 16px;
    color: inherit;
    font-weight: 700;
}
.agecalc-directory-panel .sketch-finder-link .icon { width: 24px; height: 24px; }
html body .agecalc-directory-panel :is(.mobile-hub-groups,.desktop-nav-groups) { display: grid; gap: 12px; }
html body .agecalc-directory-panel :is(.mobile-hub-group,.desktop-nav-group) { padding: 0; background: none; border: 0; border-top: 1px dashed #cdc1ad; }
html body .agecalc-directory-panel :is(.mobile-nav-links,.desktop-nav-links) { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; padding: 0; }
html body .agecalc-directory-panel :is(.mobile-nav-link,.desktop-nav-link,.mobile-hub-title,.desktop-nav-category,.mobile-nav-blog) {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    max-width: none;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 5px;
    box-shadow: none;
    color: inherit;
    background: none;
    font: inherit;
    letter-spacing: 0;
    text-decoration: none;
}
html body .agecalc-directory-panel :is(.mobile-hub-title,.desktop-nav-category,.mobile-nav-blog) { font-weight: 700; }
html body .agecalc-directory-panel .mobile-nav-link strong { color: inherit; font: inherit; }
html body .agecalc-directory-panel a:is(:hover,:focus-visible,.is-active) { background: #fff0bc; transform: none; }
@media (prefers-reduced-motion: no-preference) {
    html body > .agecalc-directory-panel { transition: transform 180ms ease-out; }
    html body > .agecalc-directory-overlay { transition: opacity 180ms ease-out; }
}
@media (prefers-reduced-motion: reduce) {
    html body > :is(.agecalc-directory-panel,.agecalc-directory-overlay) { transition: none; }
}
