/* ============================================================
   SKIP LINK
   ============================================================ */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 9999;
    background: #FAF9F5;
    color: #141413;
    padding: 8px 16px;
    font-family: Manrope, sans-serif;
    font-size: 16px;
    font-weight: 400;
    text-decoration: none;
    border-radius: 4px;
    border: 2px solid #069A44;
}

.skip-link:focus-visible {
    top: 8px;
}

/* ============================================================
   HEADER — BASE
   ============================================================ */
#pageheader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    /* page.css sets filter:drop-shadow on #pageheader at ≥480px; cancel it */
    filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: background-color 250ms cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

#pageheader.scrolled {
    background: #FAF9F5;
    border-bottom-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

@media (prefers-reduced-motion: reduce) {
    #pageheader {
        transition: none;
    }
}

/* ============================================================
   HEADER INNER LAYOUT
   ============================================================ */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 32px;
    height: 72px;
}

/* ============================================================
   LOGO
   ============================================================ */
.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.header-logo img {
    max-height: 64px;
    width: auto;
    display: block;
}

.header-logo:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
   DESKTOP RIGHT CLUSTER (nav + lang switcher)
   ============================================================ */
.header-right {
    display: none; /* hidden on mobile — shown at 768px+ */
    align-items: center;
    gap: 28px;
}

/* ============================================================
   MAIN NAV (desktop)
   ============================================================ */
.header-nav .mainnav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 28px;
    /* page.css sets background:#FAF9F5 on .mainnav at ≥600px; cancel it */
    background: transparent;
    margin-left: auto;
}

.header-nav .mainnav li a {
    font-family: Manrope, sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: #141413;
    text-decoration: none;
    line-height: 1;
    /* page.css sets background:#FAF9F5 and padding:1.5rem 1rem on .mainnav li a */
    background: transparent;
    padding: 0;
}

.header-nav .mainnav li a:hover {
    text-decoration: underline;
    /* page.css sets background:#F0FFF9 on hover; cancel it */
    background: transparent;
}

.header-nav .mainnav li.current-menu-item > a {
    text-decoration: underline;
    text-decoration-color: #069A44;
    text-underline-offset: 4px;
}

.header-nav .mainnav li a:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================================
   LANGUAGE SWITCHER — DESKTOP SLASH/UNDERLINE
   Bogo outputs a <ul class="bogo-language-switcher"> with flag
   spans and language name spans. We hide flags and style names.
   Renders as: EN / 日本語 — active gets a green underline.
   ============================================================ */
.lang-switcher .bogoflags {
    display: none;
}

.lang-switcher ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    font-size: 14px;
    line-height: 1;
}

.lang-switcher ul li {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Slash separator injected between items via CSS */
.lang-switcher ul li + li::before {
    content: '/';
    font-size: 13px;
    color: #8A9199;
    margin: 0 7px;
    line-height: 1;
}

.lang-switcher ul li a {
    font-family: Manrope, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #6B7580;
    text-decoration: none;
    line-height: 1;
    transition: color 150ms ease;
}

.lang-switcher ul li a:hover {
    color: #141413;
}

/* text-decoration underline doesn't affect layout height, keeping everything on the same baseline */
.lang-switcher ul li.current a {
    color: #141413;
    text-decoration: underline;
    text-decoration-color: #069A44;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.lang-switcher ul li a:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .lang-switcher ul li a {
        transition: none;
    }
}

/* ============================================================
   HAMBURGER BUTTON (mobile only)
   ============================================================ */
.hamburger-btn {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: #141413;
    border-radius: 2px;
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 150ms ease;
}

.hamburger-btn:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: 2px;
    border-radius: 4px;
}

.hamburger-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
    .hamburger-btn span {
        transition: none;
    }
}

/* ============================================================
   DESKTOP BREAKPOINT — 768px+
   ============================================================ */
@media (min-width: 768px) {
    .header-right {
        display: flex;
    }

    .hamburger-btn {
        display: none;
    }
}

/* ============================================================
   MOBILE HEADER HEIGHT + BODY OFFSET
   ============================================================ */
@media (max-width: 767px) {
    .header-inner {
        height: 60px;
        padding: 0 16px;
    }

    body {
        padding-top: 60px;
    }
}

/* ============================================================
   DRAWER SCRIM
   ============================================================ */
.drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    .drawer-scrim {
        transition: none;
    }
}

/* ============================================================
   SITE DRAWER
   ============================================================ */
#site-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(80vw, 320px);
    background: #FAF9F5;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
}

#site-drawer.is-open {
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    #site-drawer {
        transition: none;
    }
}

.drawer-inner {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

/* Drawer top row */
.drawer-top {
    display: flex;
    justify-content: flex-end;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.drawer-close-btn {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #8A9199;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #141413;
    font-family: Manrope, sans-serif;
}

.drawer-close-btn:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: 2px;
}

/* Drawer nav */
.drawer-nav {
    flex: 1;
}

.drawer-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.drawer-nav-list li a {
    display: flex;
    align-items: center;
    padding: 0 20px;
    min-height: 52px;
    font-family: Manrope, sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: #141413;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.drawer-nav-list li a:hover {
    background: rgba(0, 0, 0, 0.04);
}

.drawer-nav-list li a:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: -2px;
}

.drawer-nav-list li.current-menu-item > a {
    color: #069A44;
    font-weight: 700;
}

/* Drawer language switcher — matches desktop slash/underline pattern */
.drawer-lang-links .bogoflags {
    display: none;
}

.drawer-lang {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.drawer-lang-label {
    font-family: Manrope, sans-serif;
    font-size: 12px;
    color: #6B7580;
    margin-bottom: 10px;
}

.drawer-lang-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.drawer-lang-links ul li + li::before {
    content: '/';
    font-size: 14px;
    color: #8A9199;
    margin: 0 9px;
    line-height: 1;
}

.drawer-lang-links ul li a {
    font-family: Manrope, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #6B7580;
    text-decoration: none;
    padding: 14px 0;
    line-height: 1;
    transition: color 150ms ease;
}

.drawer-lang-links ul li a:hover {
    color: #141413;
}

.drawer-lang-links ul li.current a {
    color: #141413;
    text-decoration: underline;
    text-decoration-color: #069A44;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.drawer-lang-links ul li a:focus-visible {
    outline: 2px solid #069A44;
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .drawer-lang-links ul li a {
        transition: none;
    }
}
