
/* Category drawer + scrim (category-menu.js)                        */
/* ---------------------------------------------------------------- */

.menu-scrim {
    position: fixed;
    inset: 0;
    background: var(--overlay-scrim-light);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 55;
}
.menu-scrim.is-visible {
    opacity: 1;
}
.menu-scrim[hidden] {
    display: none;
}

body.menu-open {
    overflow: hidden;
}

.category-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    height: 100dvh;
    width: min(320px, 84vw);
    background: var(--paper-raised);
    border-right: 1px solid var(--rule-strong);
    box-shadow: 3px 0 28px rgba(0, 0, 0, 0.28);
    /* Closed, it sits a little further left than its own width, so its
       shadow (3px + 28px blur) doesn't show along the page's left edge. */
    transform: translateX(calc(-100% - 40px));
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    display: flex;
    flex-direction: column;
}
.category-drawer.is-open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 14px;
    border-bottom: 2px solid var(--ink);
    flex: none;
}

.drawer-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--ink);
}

.drawer-close {
    border: none;
    background: transparent;
    color: var(--ink-soft);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.drawer-close:hover {
    color: var(--rust-dark);
    background: var(--alert-bg);
}
.drawer-close:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

.drawer-list {
    flex: 1;
    overflow-y: auto;
    /* Scrolling to the end of the menu doesn't carry on into the page. */
    overscroll-behavior: contain;
    padding: 8px;
}

.menu-section + .menu-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 2px solid var(--ink);
}

.menu-section-title {
    padding: 6px 12px 8px;
    font-family: var(--font-label);
    font-size: var(--label-size);
    font-weight: var(--label-weight);
    letter-spacing: var(--label-tracking);
    text-transform: uppercase;
    color: var(--ink);
}

.menu-cat-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px;
    min-height: 46px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}
.menu-cat-item:hover,
.menu-cat-item:focus-visible {
    background: var(--accent-pale);
    outline: none;
}
.menu-cat-item--all {
    font-weight: 700;
    border-bottom: 1px dashed var(--rule-strong);
    border-radius: 6px 6px 0 0;
    margin-bottom: 4px;
}

.category-drawer .menu-cat-name {
    font-family: var(--font-sans);
    font-size: var(--value-size);
    font-weight: 600;
    color: var(--ink);
    text-transform: none;
    letter-spacing: normal;
}

.category-drawer .menu-cat-count {
    font-family: var(--font-label);
    font-size: 0.68rem;
    color: var(--ink-soft);
    background: var(--paper);
    border: 1px solid var(--rule);
    padding: 2px 8px;
    border-radius: 999px;
    flex: none;
}

/* The category the page is filtered on: light blue, the same as the
   active filter buttons under the search bar. */
.category-drawer .menu-cat-item.is-active {
    background: var(--color-filter-active);
}

.category-drawer .menu-cat-item.is-active .menu-cat-name {
    color: var(--on-accent);
    font-weight: 800;
}

.category-drawer .menu-cat-item.is-active .menu-cat-count {
    color: var(--on-accent);
    background: rgba(255, 255, 255, 0.55);
    border-color: transparent;
}

/* ---------------------------------------------------------------- */
/* The hamburger button and the menu's page links (every page)      */
/* ---------------------------------------------------------------- */

.menu-button {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: var(--paper-raised);
    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease;
}
.menu-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.32);
}
.menu-button:focus-visible {
    outline: 2px solid var(--accent-on-dark);
    outline-offset: 2px;
}
.menu-button[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--rust);
}

/* Hamburger menu: page links above the categories. */
.drawer-actions {
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-bottom: 2px solid var(--ink);
}

.drawer-action {
    padding: 11px 12px;
    border-radius: 4px;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.drawer-action:hover {
    background: var(--accent-pale);
}

.drawer-action:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.drawer-action[hidden] {
    display: none;
}

/* Hamburger menu colours: blue header, yellow links block, white categories. */
.category-drawer .drawer-header {
    background: var(--color-topbar);
    border-bottom: none;
}

.category-drawer .drawer-title {
    color: var(--on-dark);
}

.category-drawer .drawer-close {
    color: var(--on-dark);
}

.category-drawer .drawer-close:hover {
    color: var(--on-dark);
    background: rgba(255, 255, 255, 0.14);
}

.category-drawer .drawer-close:focus-visible {
    outline-color: var(--accent-on-dark);
}

.drawer-actions {
    background: var(--color-header-btn);
    border-bottom: none;
}

.drawer-action {
    color: var(--on-accent);
}

.drawer-action:hover {
    background: rgba(255, 255, 255, 0.28);
}

.drawer-list {
    background: var(--paper-raised);
}

/* Menu links: an arrow on the right to show they go somewhere. */
.drawer-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.drawer-action::after {
    content: "\2192";
    font-weight: 700;
}
