/* --------------------------------------------------------------------------
   Burger trigger — three-line icon, morphs to X when drawer is open
-------------------------------------------------------------------------- */
.drawer-trigger {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--surface-border);
    border-radius: var(--r-card);
    width: 36px;
    height: 36px;
    padding: 0;
    display: none;                /* shown on mobile via media query */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        color        var(--transition),
        border-color var(--transition),
        background   var(--transition);
}
.drawer-trigger:hover {
    background: var(--surface-hover);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.burger {
    display: inline-block;
    width: 18px;
    height: 12px;
    position: relative;
}
.burger span {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.5px;
    background: currentColor;
    border-radius: 1px;
    transition: transform var(--transition), opacity var(--transition), top var(--transition);
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 5.25px; }
.burger span:nth-child(3) { top: 10.5px; }

/* Morph to X when drawer is open (JS toggles aria-expanded on the trigger). */
.drawer-trigger[aria-expanded="true"] .burger span:nth-child(1) { top: 5.25px; transform: rotate(45deg); }
.drawer-trigger[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.drawer-trigger[aria-expanded="true"] .burger span:nth-child(3) { top: 5.25px; transform: rotate(-45deg); }


/* --------------------------------------------------------------------------
   Slide drawer + scrim
-------------------------------------------------------------------------- */
.drawer-scrim {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    z-index: 90;
    transition: opacity var(--transition);
}
.drawer-scrim.is-open { opacity: 1; }

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;               /* GOT-005 — mobile viewport */
    width: min(320px, 85vw);
    background: var(--bg-alt);
    border-right: 1px solid var(--surface-border);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform var(--transition), background var(--transition);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    overflow-y: auto;
    outline: none;
}
.drawer.is-open { transform: translateX(0); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drawer-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.drawer-close {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--surface-border);
    border-radius: var(--r-card);
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.drawer-close svg { width: 16px; height: 16px; }
.drawer-close:hover {
    background: var(--surface-hover);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.drawer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}
.drawer-nav a {
    display: block;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--text);
    border-radius: var(--r-card);
    transition: background var(--transition), color var(--transition);
}
.drawer-nav a:hover,
.drawer-nav a:focus-visible {
    background: var(--surface-hover);
    color: var(--color-accent);
    outline: none;
}
.drawer-nav a[aria-current="page"] { color: var(--color-accent); }

.drawer-foot {
    margin-top: auto;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: var(--space-md);
    border-top: 1px solid var(--surface-border);
}

/* Lock the page behind the drawer so the body doesn't scroll. */
body.drawer-locked { overflow: hidden; }


/* --------------------------------------------------------------------------
   Drawer Resources sub menu  (added 19/10/2026 13:07)

   Mobile counterpart to the desktop mega. Native <details>/<summary>:
   keyboard operable, works with JS off, and the summary is not a link so the
   drawer's close-on-link-click handler ignores it. Reuses .mega-badge from
   nav-mega.css for the App / Doc chips. All colours are tokens, so dark
   default and [data-theme="light"] both resolve.
-------------------------------------------------------------------------- */
.drawer-sub-wrap { list-style: none; }

.drawer-sub {
    border-radius: var(--r-card);
}

/* Summary row mirrors a top-level drawer link so the two read as one list. */
.drawer-sub__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--text);
    border-radius: var(--r-card);
    cursor: pointer;
    list-style: none;                 /* strip default marker (Firefox) */
    transition: background var(--transition), color var(--transition);
}
.drawer-sub__summary::-webkit-details-marker { display: none; }  /* Safari / Chrome */
.drawer-sub__summary:hover,
.drawer-sub__summary:focus-visible {
    background: var(--surface-hover);
    color: var(--color-accent);
    outline: none;
}
.drawer-sub__summary.is-active { color: var(--color-accent); }

.drawer-sub__caret {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition);
}
.drawer-sub[open] > .drawer-sub__summary .drawer-sub__caret {
    transform: rotate(180deg);
    color: var(--color-accent);
}

/* Expanded panel — indented block of grouped links under the summary. */
.drawer-sub__panel {
    padding: var(--space-2xs) var(--space-sm) var(--space-xs);
}
.drawer-sub[open] > .drawer-sub__panel {
    animation: drawer-sub-in 200ms cubic-bezier(0.16, 0.84, 0.44, 1);
}
@keyframes drawer-sub-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Column heading — monospace eyebrow, matches the desktop mega. */
.drawer-sub__eyebrow {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: var(--space-sm) 0 var(--space-2xs);
    padding-bottom: var(--space-2xs);
    border-bottom: 1px solid var(--surface-border);
}
.drawer-sub__eyebrow:first-child { margin-top: 0; }

/* Sub group label inside the flattened Build & design accordion. */
.drawer-sub__group {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    margin: var(--space-xs) 0 2px;
    padding-left: var(--space-xs);
}

.drawer-sub__list {
    list-style: none;
    margin: 0 0 var(--space-xs);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-sub__link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--r-card);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}
.drawer-sub__link:hover,
.drawer-sub__link:focus-visible {
    background: var(--surface-hover);
    color: var(--color-accent);
    outline: none;
}

.drawer-sub__ico {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: var(--r-card);
    border: 1px solid var(--surface-border);
    display: grid;
    place-items: center;
    color: var(--color-accent);
}
.drawer-sub__ico svg { width: 15px; height: 15px; }

.drawer-sub__label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

/* Reduced motion — skip the expand slide. */
@media (prefers-reduced-motion: reduce) {
    .drawer-sub__caret { transition: none; }
    .drawer-sub[open] > .drawer-sub__panel { animation: none; }
}


