/* Boulevard issue archive — dark, minimal, no framework. */

:root {
    --bg: #0e0f12;
    --surface: #17191e;
    --surface-2: #20232a;
    --line: #2a2d35;
    --fg: #ececef;
    --muted: #9a9ca6;
    --accent: #e5484d;
    --radius: 10px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* ---------------------------------------------------------------- Grid */

.site-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 40px 24px 8px;
}

.brand {
    display: block;
    width: clamp(150px, 26vw, 260px);
}

.logo {
    display: block;
    width: 100%;
    height: auto;
}



.site-heading {
    margin: 0;
    color: var(--muted);
    font-size: clamp(18px, 2.4vw, 24px);
    font-weight: 600;
    letter-spacing: -.01em;
}

.archive {
    max-width: 1320px;
    margin: 0 auto;
    padding: 8px 24px 48px;
}

.notice {
    margin: 24px 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--muted);
}

.year-title {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 32px 0 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(var(--bg) 80%, transparent);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .12em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 36px 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    display: block;
    text-decoration: none;
    border-radius: var(--radius);
}

.card-cover {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background: var(--surface);
    aspect-ratio: 600 / 912;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease);
}

.card:focus-visible .card-cover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
}

@media (hover: hover) {
    .card:hover .card-cover {
        transform: translateY(-6px);
        box-shadow: var(--shadow);
    }

    .card:hover .card-cover img {
        transform: scale(1.025);
    }
}

.badge {
    align-self: center;
    padding: 1px 8px;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    padding: 12px 2px 0;
}

.card-num {
    font-size: 17px;
    font-weight: 700;
}

.card-month {
    flex-basis: 100%;
    color: var(--muted);
    font-size: 14px;
    white-space: nowrap;
}

.site-footer {
    padding: 24px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.site-footer a {
    text-decoration: none;
}

@media (max-width: 640px) {
    .site-header {
        align-items: center;
        padding: 24px 16px 4px;
    }

    .archive {
        padding: 4px 16px 32px;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 14px;
    }

}

/* -------------------------------------------------------------- Viewer */

body.is-viewer {
    overflow: hidden;
    overscroll-behavior: none;
}

.viewer {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.vbar {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
}

.vbar--top {
    justify-content: space-between;
}

.vbar--bottom {
    justify-content: center;
    gap: 6px;
    padding-bottom: 14px;
}

.vtitle {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
}

.vtitle-month {
    overflow: hidden;
    color: var(--muted);
    font-weight: 400;
    text-overflow: ellipsis;
}

.vbar-actions {
    display: flex;
    gap: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 99px;
    background: var(--surface);
    color: var(--fg);
    font: 500 14px var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s, opacity .2s;
    -webkit-tap-highlight-color: transparent;
}

.btn--ghost {
    background: transparent;
}

@media (hover: hover) {
    .btn:hover,
    .nav-arrow:hover {
        background: var(--surface-2);
    }
}

.btn--icon {
    width: 40px;
    padding: 0;
}

.btn:disabled {
    opacity: .3;
    cursor: default;
}

.btn:disabled:hover {
    background: transparent;
}

.stage {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px 64px;
}

.book-holder {
    position: relative;
    transition: transform .6s var(--ease), opacity .4s;
    opacity: 0;
}

.book-holder.is-ready {
    opacity: 1;
}

.page {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.page canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.page::after {
    /* subtle spine shading */
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.page.--left::after {
    background: linear-gradient(to left, rgba(0, 0, 0, .12), transparent 6%);
}

.page.--right::after {
    background: linear-gradient(to right, rgba(0, 0, 0, .12), transparent 6%);
}

.page-num {
    position: absolute;
    top: 50%;
    left: 50%;
    color: #c4c6cc;
    font-size: 28px;
    font-weight: 700;
    transform: translate(-50%, -50%);
}

.page.is-rendered .page-num {
    display: none;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--surface);
    color: var(--fg);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color .2s, opacity .2s;
}

.nav-arrow:disabled {
    opacity: 0;
    pointer-events: none;
}

.nav-arrow--prev {
    left: 10px;
}

.nav-arrow--next {
    right: 10px;
}

.loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
}

.loader p {
    margin: 0;
}

.loader-bar {
    overflow: hidden;
    width: 180px;
    height: 3px;
    border-radius: 3px;
    background: var(--surface-2);
}

.loader-bar span {
    display: block;
    width: 30%;
    height: 100%;
    background: var(--accent);
    animation: loading 1.1s ease-in-out infinite;
}

.loader-bar span.is-determinate {
    animation: none;
    transition: width .2s;
}

.loader.is-error .loader-bar {
    display: none;
}

.loader.is-error {
    color: var(--fg);
    pointer-events: auto;
}

@keyframes loading {
    from { transform: translateX(-100%); }
    to { transform: translateX(340%); }
}

.scrubber {
    display: flex;
    align-items: center;
    gap: 14px;
    width: min(420px, 50vw);
    padding: 0 8px;
}

.scrubber input {
    flex: 1;
    min-width: 0;
    height: 24px;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.scrubber input::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 4px;
    background: var(--surface-2);
}

.scrubber input::-moz-range-track {
    height: 4px;
    border-radius: 4px;
    background: var(--surface-2);
}

.scrubber input::-moz-range-progress {
    height: 4px;
    border-radius: 4px;
    background: var(--accent);
}

.scrubber input::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border: 0;
    border-radius: 50%;
    background: var(--fg);
    -webkit-appearance: none;
    appearance: none;
}

.scrubber input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 50%;
    background: var(--fg);
}

.scrubber output {
    min-width: 72px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.noscript {
    margin: 24px;
    text-align: center;
}

/* Zoom overlay */

.zoom {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: rgba(8, 9, 11, .97);
}

.zoom-bar {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
}

.zoom-bar output {
    min-width: 52px;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.zoom-scroll {
    flex: 1;
    overflow: auto;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.zoom-scroll.is-dragging {
    cursor: grabbing;
}

.zoom-pages {
    display: flex;
    justify-content: center;
    width: max-content;
    min-width: 100%;
    margin: 0 auto;
    padding: 0 16px 24px;
}

.zoom-pages canvas {
    display: block;
    background: #fff;
}

@media (max-width: 640px) {
    .stage {
        padding: 4px 8px;
    }

    .nav-arrow {
        display: none;
    }

    .btn-label {
        display: none;
    }

    .vbar {
        padding: 6px 8px;
    }

    .scrubber {
        width: auto;
        flex: 1;
    }

    .scrubber output {
        min-width: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
