/* ═══════════════════════════════════════════════════════════════════════════
   道の棚 · journey-shelves.css — the shelf room (journey-gallery PR 3).
   One hall door opens onto one shelf: ready-made journeys as leaning
   paintings, a preview wall of REAL paintings with the honest count, one CTA.
   Same additive-glue contract as home-hall.css: NO token/color redefinition —
   every value pulls from tokens.css; hairlines are warm sumi rgba(44,44,44,…),
   never cold black. Desktop-gated by the <link media="(min-width:769px)">.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══ THE ROOM — one level above the hall (hall 9500 < room 9550 < toast 9600) ═══ */
.shelf-room-root {
    position: fixed;
    inset: 0;
    z-index: 9550;
    background: var(--color-paper, #F0EDE8);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.shelf-room-root[hidden] { display: none; }
.shelf-room-root:focus { outline: none; }

/* ═══ THE BEAM — the hall beam's washi voice, slimmed to a doorway lintel:
   one back control, one breadcrumb. ═══ */
.shelf-beam {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 24px;
    pointer-events: none;
}
.shelf-beam .sb-inner {
    max-width: 1220px;
    margin: 12px auto 0;
    height: 52px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    pointer-events: auto;
    background: var(--color-card, #FAFAF7);
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.012'/%3E%3C/svg%3E");
    border-radius: 12px;
    border-bottom: 1px solid rgba(44, 44, 44, 0.02);
    box-shadow: 0 1px 4px rgba(44,44,44,0.025), 0 0 1px rgba(44,44,44,0.03);
}

/* back — a quiet ghost step, never a pill (components.css bare-button reset) */
.shelf-back {
    appearance: none;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-stone, #57534e);
    transition: background 0.25s ease, color 0.25s ease;
}
.shelf-back:hover, .shelf-back:active {
    background: rgba(140, 133, 120, 0.10);
    color: var(--color-ink, #2C2C2C);
    transform: none;
    box-shadow: none;
}
.shelf-back:focus-visible { outline: 2px solid rgba(61, 90, 128, 0.55); outline-offset: 2px; }
.shelf-back .sb-arrow { font-size: 13px; align-self: center; }
.shelf-back [lang="ja"] {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 400;
}
.shelf-back i {
    font-style: italic;
    font-weight: 400;
    font-size: 11px;
    color: var(--color-amber-deep, #8A6E35);
}

.sb-crumb {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    /* small-text faint that still holds AA (the tokens.css note) */
    color: var(--color-faint-warm, #6E6860);
    white-space: nowrap;
}
.sb-crumb [lang="ja"] {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--color-stone, #57534e);
}
.sb-crumb .sb-crumb-r {
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--color-amber-deep, #8A6E35);
}

/* ═══ THE ROOM'S PAGE ═══ */
.shelf-scroll {
    max-width: 1220px;
    margin: 0 auto;
    padding: 26px 40px 64px;
    box-sizing: border-box;
}
@media (min-width: 769px) and (max-width: 1440px) {
    .shelf-scroll { padding-left: 24px; padding-right: 24px; }
}

/* the door's own words open the room */
.shelf-head { max-width: 640px; margin-bottom: 26px; }
.sh-title { display: flex; align-items: baseline; gap: 12px; }
.sh-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 30px;
    font-weight: 600;
    color: var(--color-ink, #2C2C2C);
    letter-spacing: 0.06em;
    font-feature-settings: 'palt' 1;
    line-height: 1.2;
}
.sh-romaji {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-style: italic;
    letter-spacing: 0.04em;
    color: var(--color-amber-deep, #8A6E35);
}
.sh-en {
    margin-top: 4px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-ink, #2C2C2C);
    letter-spacing: 0.01em;
}
.sh-sub {
    margin: 6px 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-stone, #57534e);
}

/* a quiet series header opens each book's stretch of shelf */
.shelf-series {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 30px 0 14px;
}
.shelf-series:first-of-type { margin-top: 8px; }
.shelf-series .ss-en {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink, #2C2C2C);
}
.shelf-series .ss-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 14px;
    color: var(--color-stone, #57534e);
}
.shelf-series .ss-romaji {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-style: italic;
    color: var(--color-amber-deep, #8A6E35);
}
.shelf-series .ss-rule {
    flex: 1;
    height: 1px;
    align-self: center;
    margin-left: 8px;
    background: linear-gradient(90deg,
        rgba(44, 44, 44, 0.10) 0%,
        rgba(44, 44, 44, 0.07) 55%,
        transparent 96%);
}

/* ═══ THE SHELF — leaning path cards ═══ */
.shelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 10px;
}
.shelf-grid-wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }

.scard {
    display: flex;
    flex-direction: column;
    background: var(--color-card, #FAFAF7);
    border: 1px solid rgba(44, 44, 44, 0.07);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(44, 44, 44, 0.04);   /* warm sumi, cards REST */
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    animation: cardEntrance 0.6s var(--ease-out-expo, cubic-bezier(0.19,1,0.22,1)) backwards;
    animation-delay: calc(var(--card-i, 0) * 0.03s);
}
.scard:hover {
    border-color: rgba(44, 44, 44, 0.16);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(44, 44, 44, 0.06);
}
.scard:focus-visible {
    outline: 1.5px solid rgba(61, 90, 128, 0.45);
    outline-offset: 3px;
}

/* the cover — real paintings, montage seams = the mat between prints */
.scard-cover {
    position: relative;
    height: 128px;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-paper, #F0EDE8) 94%, var(--color-ink, #2C2C2C));
}
.shelf-grid-wide .scard-cover { height: 150px; }
.scard-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s var(--ease-out-expo, cubic-bezier(0.19,1,0.22,1));
}
.scard:hover .scard-cover img { transform: scale(1.035); }
.scard-cover.scard-montage { display: flex; gap: 2px; }
.scard-montage figure { margin: 0; position: relative; overflow: hidden; }
.scard-montage .sm-main { flex: 1 1 auto; min-width: 0; height: 100%; }
.scard-montage .sm-side {
    flex: 0 0 31%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.scard-montage .sm-side figure { flex: 1 1 50%; min-height: 0; }
/* only the MAIN painting breathes — one living print per frame */
.scard:hover .scard-montage .sm-side img { transform: none; }

.scard-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 13px 15px 12px;
}
.sc-seal {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-amber-deep, #8A6E35);
    margin-bottom: 2px;
}
.sc-seal [lang="ja"] {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
}
.sc-seal i { font-style: italic; font-weight: 400; letter-spacing: 0.04em; text-transform: none; }
.sc-name {
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--color-ink, #2C2C2C);
    line-height: 1.35;
}
.sc-jp {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 13px;
    color: var(--color-stone, #57534e);
}
.sc-jp i {
    font-family: 'Inter', sans-serif;
    font-style: italic;
    font-size: 11px;
    color: var(--color-amber-deep, #8A6E35);
}
.sc-gloss {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-stone, #57534e);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sc-foot {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-faint-warm, #6E6860);   /* AA at 10px */
}
.sc-foot b { font-weight: 700; color: var(--color-stone, #57534e); }
/* moss deepened toward ink just enough to hold AA at 10px caps */
.sc-owned { color: color-mix(in srgb, var(--color-moss, #6B7F5C) 78%, var(--color-ink, #2C2C2C)); font-weight: 600; }
.sc-owned::before { content: '✓ '; }

/* the blank paper — an honest note, not a dead door */
.shelf-blank {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 560px;
    margin-top: 34px;
    padding: 16px 18px;
    border: 1px dashed rgba(44, 44, 44, 0.14);
    border-radius: 8px;
}
.shelf-blank .sb-paper {
    flex: none;
    width: 34px; height: 44px;
    background: var(--color-card, #FAFAF7);
    border: 1px solid rgba(44, 44, 44, 0.10);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(44, 44, 44, 0.05);
}
.shelf-blank .sb-jp {
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 14px;
    color: var(--color-ink, #2C2C2C);
}
.shelf-blank .sb-jp i {
    font-family: 'Inter', sans-serif;
    font-style: italic;
    font-size: 11px;
    color: var(--color-amber-deep, #8A6E35);
}
.shelf-blank .sb-note {
    margin-top: 3px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--color-stone, #57534e);
}

/* ═══ THE VOLUME SHELF (§A2) — the whole book leads, lessons follow ═══ */
.scard-lead {
    max-width: 560px;
    animation-delay: 0s;
}
.scard-lead .scard-cover { height: 150px; }
.sc-kicker {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-faint-warm, #6E6860);   /* AA at 9.5px caps */
    margin-bottom: 2px;
}
.sc-kicker [lang="ja"] {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: none;
}
.sc-kicker i { font-style: italic; font-weight: 400; letter-spacing: 0.04em; text-transform: none; }

.shelf-lessons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 720px;
}
.lrow {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 14px 8px 8px;
    background: var(--color-card, #FAFAF7);
    border: 1px solid rgba(44, 44, 44, 0.07);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(44, 44, 44, 0.04);
    cursor: pointer;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    animation: cardEntrance 0.5s var(--ease-out-expo, cubic-bezier(0.19,1,0.22,1)) backwards;
    animation-delay: calc(var(--card-i, 0) * 0.025s);
}
.lrow:hover {
    border-color: rgba(44, 44, 44, 0.16);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(44, 44, 44, 0.06);
}
.lrow:hover .lrow-arrow { transform: translateX(3px); color: var(--color-accent, #3D5A80); }
.lrow:focus-visible {
    outline: 1.5px solid rgba(61, 90, 128, 0.45);
    outline-offset: 2px;
}
.lrow-thumb {
    flex: none;
    width: 56px; height: 42px;
    border-radius: 5px;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-paper, #F0EDE8) 94%, var(--color-ink, #2C2C2C));
}
.lrow-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lrow-label {
    flex: none;
    min-width: 74px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-ink, #2C2C2C);
}
.lrow-name {
    flex: 1 1 auto;
    min-width: 0;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    color: var(--color-stone, #57534e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lrow-foot {
    flex: none;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-faint-warm, #6E6860);
}
.lrow-foot b { font-weight: 700; color: var(--color-stone, #57534e); }
.lrow-arrow {
    flex: none;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--color-faint-warm, #6E6860);
    transition: transform 0.3s var(--ease-out-expo, cubic-bezier(0.19,1,0.22,1)), color 0.2s ease;
}

/* ═══ THE PREVIEW — real paintings, the honest count, ONE CTA ═══ */
.sp-head { margin-bottom: 20px; }
.sp-count {
    margin: 10px 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--color-stone, #57534e);
}
.sp-count b { font-weight: 700; color: var(--color-ink, #2C2C2C); }

.sp-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px;
}
.sp-piece {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(44, 44, 44, 0.07);
    background: color-mix(in srgb, var(--color-paper, #F0EDE8) 94%, var(--color-ink, #2C2C2C));
    animation: cardEntrance 0.6s var(--ease-out-expo, cubic-bezier(0.19,1,0.22,1)) backwards;
    animation-delay: calc(var(--card-i, 0) * 0.03s);
}
.sp-piece img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.sp-cap {
    padding: 8px 10px 9px;
    background: var(--color-card, #FAFAF7);
    border-top: 1px solid rgba(44, 44, 44, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.sp-cap .sp-jp {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 14px;
    color: var(--color-ink, #2C2C2C);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-cap .sp-romaji {
    font-family: 'Inter', sans-serif;
    font-size: 10.5px;
    font-style: italic;
    color: var(--color-amber-deep, #8A6E35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-cap .sp-en {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--color-stone, #57534e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-more {
    margin-top: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-style: italic;
    color: var(--color-faint-warm, #6E6860);   /* AA at small italic */
}

/* the one CTA — the app's accent, no gold, no ceremony */
.sp-foot { margin-top: 28px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sp-add {
    appearance: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: baseline;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 8px;
    background: var(--color-accent, #3D5A80);
    color: var(--color-card, #FAFAF7);
    box-shadow: none;
    font-family: 'Inter', sans-serif;
    transition: background 0.25s ease;
}
.sp-add:hover, .sp-add:active {
    background: color-mix(in srgb, var(--color-accent, #3D5A80) 88%, #000);
    transform: none;
    box-shadow: none;
}
.sp-add:focus-visible { outline: 2px solid rgba(61, 90, 128, 0.55); outline-offset: 3px; }
.sp-add [lang="ja"] {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.sp-add i {
    font-style: italic;
    font-size: 11px;
    opacity: 0.75;
}
.sp-add em {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

/* the already-here truth — quiet, factual, one step home */
.sp-already {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-ink, #2C2C2C);
    padding: 11px 16px;
    background: var(--color-card, #FAFAF7);
    border: 1px solid rgba(44, 44, 44, 0.08);
    border-radius: 8px;
}
.sp-ghost {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(44, 44, 44, 0.14);
    border-radius: 8px;
    box-shadow: none;
    padding: 9px 14px;
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-stone, #57534e);
    transition: color 0.25s ease, border-color 0.25s ease;
}
.sp-ghost:hover, .sp-ghost:active {
    color: var(--color-ink, #2C2C2C);
    border-color: rgba(44, 44, 44, 0.28);
    transform: none;
    box-shadow: none;
}
.sp-ghost:focus-visible { outline: 2px solid rgba(61, 90, 128, 0.55); outline-offset: 2px; }
.sp-ghost [lang="ja"] {
    font-family: 'Klee One', 'Noto Sans JP', sans-serif;
    font-size: 13px;
    font-weight: 400;
}
.sp-ghost i {
    font-style: italic;
    font-weight: 400;
    font-size: 10.5px;
    color: var(--color-amber-deep, #8A6E35);
}

/* image tone-wash settle (the hall's pattern) */
.shelf-room-root .img-loading img { opacity: 0; }
.shelf-room-root .img-settled img { opacity: 1; transition: opacity 0.35s ease; }

/* Honor reduced motion: pieces appear settled, nothing breathes or slides. */
@media (prefers-reduced-motion: reduce) {
    .scard, .sp-piece, .lrow { animation: none; }
    .lrow:hover .lrow-arrow { transform: none; }
    .scard:hover .scard-cover img { transform: none; }
    .scard-cover img { transition: none; }
    .shelf-room-root .img-settled img { transition: none; }
}
