/*
Theme Name: Wheel Catalog
Description: A responsive gallery for the KYKY wheel series.
Version: 1.3.2
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: wheel-catalog
*/
:root {
    --ink: #1d2428;
    --paper: #f3f3f0;
    --line: #d5d7d5;
    --dark: #20282c;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a { color: inherit; }

a:focus-visible, summary:focus-visible, button:focus-visible {
    outline: 3px solid #d82e3b;
    outline-offset: 4px;
}

.wrap {
    width: min(1320px, calc(100% - 64px));
    margin: auto;
}

.series-header {
    background: var(--dark);
    color: #fff;
}

.series-header-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.series-brand img {
    display: block;
}

.series-selector {
    display: none;
    position: relative;
}

.series-selector summary {
    cursor: pointer;
    padding: 10px 14px;
    border: 1px solid #d5d7d5;
    font-weight: 700;
}

.series-main {
    padding: clamp(30px, 6vw, 74px) 0 64px;
}

.series-main h1 {
    margin: 0 0 24px;
    font-size: clamp(42px, 7vw, 84px);
    line-height: 1;
    letter-spacing: -0.06em;
}

.series-menu-desktop {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    margin-left: 16px;
}

.series-selector .series-menu {
    position: absolute;
    z-index: 1;
    top: calc(100% + 8px);
    right: 0;
    width: min(260px, calc(100vw - 32px));
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px #20282c26;
}

.series-selector:not([open]) .series-menu {
    display: none;
}

.series-menu a {
    display: block;
    padding: 12px 14px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
}

.series-menu a:hover {
    background: var(--paper);
    color: var(--ink);
}

.series-menu a[aria-current="page"] {
    background: var(--dark);
    color: #fff;
}

.series-menu-desktop a[aria-current="page"] {
    background: #fff;
    color: var(--ink);
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
    gap: 10px;
}

.series-grid button {
    display: block;
    padding: 0;
    border: 0;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: zoom-in;
}

.series-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.series-image-code {
    display: block;
    padding: 8px 12px 12px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 960px) {
    .series-menu-desktop {
        display: none;
    }

    .series-selector {
        display: block;
    }
}

@media (max-width: 700px) {
    .wrap {
        width: calc(100% - 32px);
    }

    .series-header-inner {
        min-height: 76px;
    }

    .series-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

body:has(.series-viewer[open]) {
    overflow: hidden;
}

.series-viewer {
    width: max-content;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 0;
    border: 0;
    background: #fff;
    color: var(--ink);
}

.series-viewer::backdrop {
    background: #10151bd9;
}

.series-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 14px;
}

.series-viewer-header button {
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.75rem;
    cursor: pointer;
}

.series-viewer-header button:focus-visible {
    outline-offset: -4px;
}

.series-viewer-image {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 72px);
    object-fit: contain;
}

.series-menu .series-stock-link {
    border: 1px solid #ffca71;
    background: #ffca71;
    color: #302009;
    font-weight: 800;
}

.series-menu .series-stock-link:hover,
.series-menu .series-stock-link[aria-current="page"] {
    background: #ffe2a9;
}

.stock-instructions {
    margin: 0 0 20px;
    padding-left: 1.4em;
}

.stock-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
}

.stock-sizes a {
    min-width: 48px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    background: #fff;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
}

.stock-sizes a:hover {
    border-color: var(--ink);
}

.stock-sizes a[aria-current="page"] {
    border-color: var(--dark);
    background: var(--dark);
    color: #fff;
}
