/* ── FONT ── */
@font-face {
    font-family: 'Digital';
    src: url('./Font/DIGITAL.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── TOKENS ── */
:root {
    --bg: #FFFFFF;
    --ink: #333333;
    --red: #D40B03;
    --muted: #A8A39C;
}

/* ── RESET ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--bg);
    color: var(--ink);
}

body {
    font-family: 'Digital', monospace;
    font-size: 14px;
    line-height: 1.5;
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 32px 80px;  /* top clears the fixed header, bottom clears the fixed footer */
}

a {
    color: inherit;
    text-decoration: none;
}

ol, ul {
    list-style: none;
}

/* ── HEADER (fixed, body-shaped to mirror the footer) ── */
.site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 720px;
    background: var(--bg);
    padding: 32px 32px 0;
    z-index: 10;
    text-align: center;
}

.wordmark {
    display: inline-block;
    font-family: 'Digital', monospace;
    font-size: 18px;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.55em;
    text-decoration: none;
}

.wordmark:hover { opacity: 0.7; }

.rule {
    border: 0;
    border-top: 1px solid var(--ink);
    margin: 14px 0 0;
}

/* ── TABLE OF CONTENTS (dotted leaders) ── */
.toc li {
    margin: 0;
}

.toc li a,
.toc li > .toc-row {
    display: flex;
    align-items: baseline;
    text-decoration: none;
    color: inherit;
    padding: 8px 0;
}

.toc-title {
    flex: 0 1 auto;
    font-size: 13px;
    letter-spacing: 0.1em;
    white-space: nowrap;
    padding-right: 8px;
}

.toc-fill {
    flex: 1 1 auto;
    margin: 0 6px;
    border-bottom: 1.5px dotted var(--muted);
    transform: translateY(-4px);
    min-width: 30px;
}

.toc-num {
    flex: 0 0 auto;
    font-size: 13px;
    letter-spacing: 0.1em;
    padding-left: 8px;
    text-align: right;
    min-width: 28px;
}

.toc li a:hover .toc-title,
.toc li a:hover .toc-num {
    color: var(--red);
}

.toc li a:hover .toc-fill {
    border-bottom-color: var(--red);
}

/* Muted variant — applied to a whole list (.toc-muted) or a single row (li.muted).
   Set on the parent so .toc-row's `color: inherit` cascades through to the spans. */
.toc.toc-muted,
.toc li.muted {
    color: var(--muted);
}

.toc.toc-muted .toc-fill,
.toc li.muted .toc-fill {
    border-bottom-color: var(--muted);
    opacity: 0.6;
}

/* ── TOC SECTIONS (Publications / Forthcoming / Info) ── */
.toc-section {
    margin-bottom: 44px;
}

.toc-section:last-child {
    margin-bottom: 0;
}

.toc-section-label {
    font-family: 'Digital', monospace;
    font-size: 10px;
    font-weight: normal;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.toc-section .toc {
    padding-left: 32px;
}

/* ── PAGE HEADING (sub-pages) ── */
.page-heading {
    font-family: 'Digital', monospace;
    font-size: 10px;
    font-weight: normal;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 32px;
}

/* ── SECTION LABEL (DESCRIPTION / PHYSICAL DESCRIPTION) ── */
.section-label {
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 18px;
}

/* ── DESCRIPTION (body / paragraph block) ── */
.description {
    margin-bottom: 56px;
}

.description-body {
    font-size: 14px;
    letter-spacing: 0.02em;
    line-height: 1.9;
    color: var(--ink);
    text-align: justify;
}

.description-body p {
    margin-bottom: 20px;
}

.description-body p:last-child {
    margin-bottom: 0;
}

/* ── PRE-ORDER ── */
.preorder {
    margin: 48px 0 80px;
    text-align: center;
}

.preorder .btn {
    display: block;
    width: 100%;
    padding: 18px 32px;
}

.btn {
    display: inline-block;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Digital', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    padding: 14px 32px;
    text-decoration: none;
    border: 1px solid var(--ink);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn:hover {
    color: var(--red);
    border-color: var(--red);
}

/* ── CONTACT FORM ── */
.contact-form {
    width: 100%;
}

.form-field {
    display: block;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    background: var(--bg);
    border: 1px solid var(--ink);
    color: var(--ink);
    font-family: 'Digital', monospace;
    font-size: 13px;
    letter-spacing: 0.05em;
    line-height: 1.5;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s;
}

.form-field:focus {
    border-color: var(--red);
}

.form-field::placeholder {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 11px;
}

textarea.form-field {
    resize: vertical;
    min-height: 140px;
}

.form-submit {
    text-align: center;
    margin-top: 28px;
}

/* ── GALLERY (book detail page) ── */
.gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}

.gallery:active { cursor: grabbing; }

.gallery-track {
    display: flex;
    transition: transform 0.3s ease;
    height: 100%;
}

.gallery-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    padding: 0 4px;
}

.gallery-nav button {
    background: none;
    border: none;
    font-family: 'Digital', monospace;
    font-size: 22px;
    padding: 10px;
    cursor: pointer;
    color: var(--ink);
    pointer-events: auto;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.gallery-nav button:hover { opacity: 1; }

/* ── FOOTER (fixed, body-shaped so its rule matches the header rule) ── */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 720px;
    background: var(--bg);
    padding: 0 32px;
    z-index: 10;
}

.site-footer-inner {
    padding: 14px 0;
    border-top: 1px solid var(--ink);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    body {
        padding: 88px 20px 80px;  /* top clears fixed header, bottom clears fixed footer */
    }
    .site-header {
        padding: 20px 20px 0;
    }
    .site-footer {
        padding: 0 20px;  /* match body sides so header rule and footer rule are the same width */
    }
    .wordmark {
        font-size: 14px;
        letter-spacing: 0.4em;
    }
    .page-heading {
        margin-bottom: 24px;
    }
    .toc-section { margin-bottom: 36px; }
    .toc-section-label { margin-bottom: 8px; }
    .toc-title, .toc-num {
        font-size: 12px;
    }
    .description { margin-bottom: 48px; }
    .description-body { font-size: 14px; }
    .description-body p { margin-bottom: 18px; }
    .preorder { margin: 32px 0 56px; }
}
