/* ==========================================================================
   NSOROMMA — Page d'accueil
   « Livre à la une » façon fiche éditoriale + collections en étagères sobres.
   ========================================================================== */

.home {
    --ink: var(--shell-ink, #1E2230);
    --ink-soft: var(--shell-ink-soft, #5F5E5A);
    --muted: var(--shell-muted, #9A978F);
    --line: var(--shell-line, rgba(30, 34, 48, .1));
    --panel: var(--shell-panel, #FAF9F5);
    --serif: var(--shell-serif, 'Cormorant Garamond', Georgia, serif);
    --page-x: clamp(1.5rem, 4vw, 4rem);
    padding: .5rem var(--page-x) 5rem;
    color: var(--ink);
}

/* ==========================================================================
   Livre à la une
   ========================================================================== */
.spotlight {
    --cover-w: clamp(220px, 21vw, 300px);
    --gap: clamp(2.5rem, 6vw, 6.5rem);
    --nav-w: clamp(4rem, 7vw, 7rem);
    position: relative;
    max-width: 1180px;
    margin: 0 auto 5rem;
    padding-left: var(--nav-w);
}

.spotlight-nav {
    position: absolute; left: 0; top: calc(var(--cover-w) * .35);
    display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
    z-index: 3;
}
.spotlight-arrow {
    width: 42px; height: 42px; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: transparent; color: var(--ink);
    cursor: pointer; transition: background .2s, transform .2s;
}
.spotlight-arrow.is-ring { border: 1px solid rgba(30, 34, 48, .25); }
.spotlight-arrow:hover { background: rgba(30, 34, 48, .06); }
.spotlight-arrow:active { transform: scale(.92); }
.spotlight-arrow:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.spotlight-counter { font-size: .72rem; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }

.spotlight-top {
    position: relative; z-index: 2;
    display: grid; grid-template-columns: var(--cover-w) minmax(0, 1fr); gap: var(--gap);
    align-items: start;
}
.spotlight-cover { display: block; }
.spotlight-cover img {
    display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
    border-radius: 0;
    box-shadow:
        0 2px 4px rgba(30, 34, 48, .12),
        -24px 40px 60px -28px rgba(30, 34, 48, .45),
        -40px 70px 90px -50px rgba(30, 34, 48, .35);
    transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.spotlight-cover:hover img { transform: translateY(-6px) rotate(-1deg); }

.spotlight-intro { padding-top: clamp(.5rem, 2vw, 1.5rem); }
.spotlight-title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(2.4rem, 4.2vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -.005em;
    color: var(--ink);
}
.spotlight-author { margin: 1.6rem 0 0; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.spotlight-tagline { margin: 1.4rem 0 0; max-width: 44ch; font-style: italic; font-size: .95rem; line-height: 1.65; color: var(--ink-soft); }

.spotlight-title.is-long { font-size: clamp(2rem, 3.1vw, 2.9rem); }

/* Panneau clair placé derrière la moitié basse de la couverture et le contenu */
.spotlight-slide { position: relative; }
.spotlight-slide::before {
    content: '';
    position: absolute; z-index: 0;
    top: calc(var(--cover-w) * 1.5 * .55);
    left: calc(var(--cover-w) * -.45);
    right: calc(var(--page-x) * -.5);
    bottom: 0;
    background: var(--panel);
}
.spotlight-panel { position: relative; z-index: 1; padding: 0 clamp(1rem, 3vw, 4rem) 3.25rem 0; }
.spotlight-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-top: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line);
    max-width: 560px;
}
.spotlight-cta {
    display: inline-flex; align-items: center; gap: .6rem;
    padding: .8rem 1.3rem; border-radius: 999px;
    background: var(--ink); color: #fff; text-decoration: none;
    font-size: .88rem; font-weight: 500;
    transition: background .2s, transform .2s, gap .2s;
}
.spotlight-cta:hover { background: #33384A; gap: .85rem; }
.spotlight-cta:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.spotlight-tools { display: flex; gap: .75rem; }
.spotlight-tools form { margin: 0; }
.spotlight-tool {
    position: relative;
    width: 42px; height: 42px; display: grid; place-items: center;
    border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(30, 34, 48, .06); color: var(--ink); text-decoration: none;
    transition: background .2s, transform .2s;
}
.spotlight-tool:hover { background: rgba(30, 34, 48, .12); transform: translateY(-2px); }
.spotlight-tool:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.spotlight-tool-tip {
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    padding: .3rem .6rem; border-radius: 6px; white-space: nowrap;
    background: var(--ink); color: #fff; font-size: .72rem;
    opacity: 0; pointer-events: none; transform: translate(-50%, 4px);
    transition: opacity .2s, transform .2s;
}
.spotlight-tool:hover .spotlight-tool-tip, .spotlight-tool:focus-visible .spotlight-tool-tip { opacity: 1; transform: translate(-50%, 0); }

.spotlight-body {
    display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem);
    margin-top: 3.5rem;
}
.spotlight-heading { margin: 0 0 1.25rem; font-size: .98rem; font-weight: 600; color: var(--ink); }
.spotlight-text { margin: 0 0 1.1rem; font-size: .88rem; line-height: 1.75; color: var(--ink-soft); }

.spotlight-review { display: flex; gap: 1.1rem; margin: 2.25rem 0 0; }
.spotlight-review-avatar {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center;
    background: #E4E1D6; color: var(--ink); font-weight: 600;
}
.spotlight-review-name { font-weight: 600; font-size: .95rem; margin-top: .45rem; }
.spotlight-review-text { margin: .45rem 0 0; font-style: italic; font-size: .88rem; line-height: 1.6; color: var(--ink-soft); }

.spotlight-details { margin: 0; display: flex; flex-direction: column; gap: 2rem; }
.spotlight-details dt { font-size: .98rem; font-weight: 600; color: var(--ink); margin-bottom: .75rem; }
.spotlight-details dd { margin: 0; font-size: .85rem; line-height: 1.7; color: var(--ink-soft); }
.spotlight-stock { color: var(--muted); }

/* Transition entre deux livres */
.slide-enter { transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .2, 1); }
.slide-enter-start { opacity: 0; transform: translateY(18px); }
.slide-enter-end { opacity: 1; transform: none; }
.spotlight-slide { animation: spotlight-in .9s cubic-bezier(.2, .8, .2, 1) both; }
.spotlight-slide .spotlight-cover img { animation: cover-in 1s cubic-bezier(.2, .8, .2, 1) both; }
.spotlight-slide .spotlight-intro > * { animation: fade-up .8s cubic-bezier(.2, .8, .2, 1) both; }
.spotlight-slide .spotlight-intro > :nth-child(2) { animation-delay: .1s; }
.spotlight-slide .spotlight-intro > :nth-child(3) { animation-delay: .2s; }

/* ==========================================================================
   Collections en étagères
   ========================================================================== */
.collections { max-width: 1180px; margin: 0 auto; }
.collections-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 2.25rem; }
.collections-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 3vw, 2.6rem); color: var(--ink); }
.collections-link { font-size: .85rem; color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.collections-link:hover { color: var(--ink); border-color: var(--ink); }

.shelf { --books-per-view: 4; --book-gap: clamp(1.5rem, 3vw, 3rem); margin: 0 0 3.75rem; }
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.shelf-title { margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink); }
.shelf-title a { color: inherit; text-decoration: none; }
.shelf-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.shelf-meta { display: flex; align-items: center; gap: .35rem; }
.shelf-count { margin-right: .4rem; font-size: .8rem; color: var(--muted); text-decoration: none; }
.shelf-count:hover { color: var(--ink); }
.shelf-arrow {
    width: 32px; height: 32px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink);
    cursor: pointer; transition: background .2s, opacity .2s, transform .2s;
}
.shelf-arrow:hover:not(:disabled) { background: var(--ink); color: #fff; border-color: var(--ink); }
.shelf-arrow:active:not(:disabled) { transform: scale(.92); }
.shelf-arrow:disabled { opacity: .3; cursor: default; }

.shelf-stage { position: relative; }
.shelf-row {
    list-style: none; margin: 0;
    display: flex; gap: var(--book-gap);
    padding: 1.75rem clamp(1.25rem, 3vw, 3rem) 2.4rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scroll-padding-inline: clamp(1.25rem, 3vw, 3rem);
    scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }

.shelf-book {
    flex: 0 0 calc((100% - (var(--books-per-view) - 1) * var(--book-gap)) / var(--books-per-view));
    scroll-snap-align: start;
    opacity: 0; transform: translateY(36px);
}
.shelf.is-visible .shelf-book { animation: book-in .7s cubic-bezier(.2, .8, .2, 1) forwards; animation-delay: calc(150ms + var(--i) * 60ms); }

.shelf-book-link { position: relative; display: block; text-decoration: none; color: inherit; outline: none; }
.shelf-book-link img {
    display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover;
    border-radius: 0;
    box-shadow: inset 4px 0 6px -4px rgba(0, 0, 0, .35), 0 1px 2px rgba(30, 34, 48, .12), 0 16px 26px -14px rgba(30, 34, 48, .5);
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s;
}
.shelf-book-link:hover img, .shelf-book-link:focus-visible img {
    transform: translateY(-12px);
    box-shadow: inset 4px 0 6px -4px rgba(0, 0, 0, .35), 0 28px 34px -16px rgba(30, 34, 48, .45);
}
.shelf-book-link:focus-visible img { outline: 2px solid var(--ink); outline-offset: 4px; }
.shelf-book-caption {
    position: absolute; left: 50%; top: .6rem; z-index: 3;
    width: max-content; max-width: 90%;
    padding: .45rem .7rem; border-radius: 8px;
    background: rgba(30, 34, 48, .92); color: #fff; text-align: center;
    font-size: .76rem; line-height: 1.35;
    opacity: 0; pointer-events: none; transform: translate(-50%, 6px);
    transition: opacity .25s, transform .25s;
}
.shelf-book-title { display: block; font-weight: 600; }
.shelf-book-author { display: block; opacity: .7; }
.shelf-book-link:hover .shelf-book-caption, .shelf-book-link:focus-visible .shelf-book-caption { opacity: 1; transform: translate(-50%, -12px); }

/* Planche translucide aux tons sourds */
.shelf-board {
    --board: 214, 196, 160;
    position: absolute; left: 0; right: 0; bottom: .9rem; z-index: 2;
    height: clamp(46px, 5vw, 64px);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(var(--board), .62), rgba(var(--board), .82));
    border-top: 1px solid rgba(255, 255, 255, .6);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 18px 24px -18px rgba(var(--board), 1);
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
    transform: scaleX(.6); opacity: 0; transform-origin: left center;
}
.shelf.is-visible .shelf-board { animation: board-in .8s cubic-bezier(.2, .8, .2, 1) forwards; }
.shelf-screw { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #CFCFCB 55%, #96948D); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

.shelf-sand .shelf-board { --board: 214, 196, 160; }
.shelf-sage .shelf-board { --board: 165, 183, 155; }
.shelf-slate .shelf-board { --board: 156, 170, 190; }
.shelf-clay .shelf-board { --board: 207, 160, 143; }
.shelf-lilac .shelf-board { --board: 180, 168, 204; }

/* ---------- États ---------- */
.home-empty { text-align: center; padding: 5rem 1rem; color: var(--ink-soft); }
.home-empty-title { font-family: var(--serif); font-size: 2rem; color: var(--ink); margin-bottom: .5rem; }

/* ---------- Animations ---------- */
@keyframes spotlight-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cover-in { from { opacity: 0; transform: translateY(30px) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes book-in { 60% { opacity: 1; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes board-in { to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .spotlight { --cover-w: 220px; --gap: 2.5rem; }
    .spotlight-body { grid-template-columns: 1fr; }
    .shelf { --books-per-view: 3; }
}

@media (max-width: 768px) {
    .home { padding: 1.5rem 1.25rem 3rem; }
    .spotlight { --cover-w: min(58vw, 230px); padding-left: 0; margin-bottom: 3.5rem; }
    .spotlight-nav { position: static; flex-direction: row; justify-content: center; margin-bottom: 1.25rem; }
    .spotlight-top { grid-template-columns: 1fr; gap: 1.75rem; justify-items: center; text-align: center; }
    .spotlight-cover { width: var(--cover-w); }
    .spotlight-intro { padding-top: 0; }
    .spotlight-author { margin-top: .9rem; }
    .spotlight-tagline { margin: .9rem auto 0; }
    .spotlight-slide::before { top: calc(var(--cover-w) * 1.5 * .6); left: -1.25rem; right: -1.25rem; }
    .spotlight-actions { margin: 1.75rem auto 0; padding-bottom: 1.5rem; text-align: left; }
    .spotlight-panel { padding: 0 0 2.25rem; }
    .spotlight-body { margin-top: 1.75rem; gap: 2rem; text-align: left; }
    .spotlight-tool-tip { display: none; }
    .collections-head { margin-bottom: 1.25rem; }
    .shelf { --books-per-view: 2.3; --book-gap: 1rem; margin-bottom: 2.5rem; }
    .shelf-row { padding: 1.25rem 1rem 1.9rem; scroll-padding-inline: 1rem; }
    .shelf-book-caption { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .home *, .home *::before, .home *::after { animation: none !important; transition: none !important; }
    .shelf-book, .shelf-board { opacity: 1 !important; transform: none !important; }
    .shelf-row { scroll-behavior: auto; }
}
