/* ==========================================================================
   NSOROMMA — Coque du site public
   Fond crème, barre latérale d'icônes, barre supérieure épurée.
   ========================================================================== */

:root {
    --shell-bg: #EEECE3;
    --shell-panel: #FAF9F5;
    --shell-ink: #1E2230;
    --shell-ink-soft: #5F5E5A;
    --shell-muted: #9A978F;
    --shell-line: rgba(30, 34, 48, .1);
    --shell-rail-w: 96px;
    --shell-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
}

body.broks-page {
    padding: 0 !important;
    background: var(--shell-bg) !important;
    color: var(--shell-ink);
}

.library-container {
    max-width: none !important;
    min-height: 100vh;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: var(--shell-bg) !important;
    padding-left: var(--shell-rail-w);
    overflow: visible;
}

/* ---------- Barre latérale ---------- */
.site-rail {
    position: fixed; inset: 0 auto 0 0; z-index: 80;
    width: var(--shell-rail-w);
    display: flex; flex-direction: column; align-items: center;
    padding: 1.75rem 0 1.5rem;
    background: var(--shell-bg);
}
.site-rail::after {
    content: ''; position: absolute; top: 1.75rem; bottom: 1.5rem; right: 0;
    width: 1px; background: var(--shell-line);
}
.site-rail-logo { display: grid; place-items: center; width: 48px; height: 48px; }
.site-rail-logo img { width: 34px; height: 34px; object-fit: contain; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.site-rail-logo:hover img { transform: rotate(45deg); }

.site-rail-nav { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; }
.site-rail-link {
    position: relative;
    width: 46px; height: 46px; display: grid; place-items: center;
    border-radius: 14px; color: var(--shell-ink-soft);
    transition: color .2s, background .2s;
}
.site-rail-link:hover { color: var(--shell-ink); background: rgba(30, 34, 48, .05); }
.site-rail-link.is-active { color: var(--shell-ink); background: var(--shell-panel); box-shadow: 0 6px 16px -10px rgba(30, 34, 48, .35); }
.site-rail-link:focus-visible, .site-rail-menu:focus-visible { outline: 2px solid var(--shell-ink); outline-offset: 2px; }
.site-rail-tip {
    position: absolute; left: calc(100% + 12px); top: 50%;
    padding: .35rem .65rem; border-radius: 8px;
    background: var(--shell-ink); color: #fff; font-size: .75rem; font-weight: 500; white-space: nowrap;
    opacity: 0; pointer-events: none; transform: translate(-4px, -50%);
    transition: opacity .2s, transform .2s;
}
.site-rail-link:hover .site-rail-tip, .site-rail-link:focus-visible .site-rail-tip { opacity: 1; transform: translate(0, -50%); }

.site-rail-menu {
    width: 46px; height: 46px; display: grid; place-items: center;
    border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(30, 34, 48, .06); color: var(--shell-ink);
    transition: background .2s;
}
.site-rail-menu:hover { background: rgba(30, 34, 48, .1); }
.site-rail-dropdown { top: auto !important; bottom: 0; right: auto !important; left: calc(100% + 12px); }

/* ---------- Barre supérieure ---------- */
.site-topbar {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 1.6rem clamp(1.5rem, 4vw, 4rem);
}
.site-search { flex: 1; max-width: 520px; display: flex; align-items: center; gap: .75rem; color: var(--shell-ink-soft); }
.site-search input {
    flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
    font: inherit; font-size: .9rem; color: var(--shell-ink); padding: .5rem 0;
    border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-search input::placeholder { color: var(--shell-muted); }
.site-search input:focus { border-bottom-color: var(--shell-line); }

.site-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }
.site-icon-btn {
    position: relative; width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 50%; color: var(--shell-ink); transition: background .2s;
}
.site-icon-btn:hover, .site-icon-btn.is-active { background: rgba(30, 34, 48, .06); }
.site-cart-badge {
    position: absolute; top: 4px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
    background: var(--shell-ink) !important; color: #fff !important;
    font-size: .62rem; font-weight: 700; line-height: 17px; text-align: center;
}
.site-user {
    display: flex; align-items: center; gap: .7rem;
    border: 0; background: transparent; cursor: pointer;
    font: inherit; font-size: .92rem; font-weight: 500; color: var(--shell-ink);
    padding: .25rem .5rem .25rem .25rem; border-radius: 999px; transition: background .2s;
}
.site-user:hover { background: rgba(30, 34, 48, .05); }
.site-user-avatar {
    width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    background: var(--shell-ink); color: #fff; font-weight: 600; font-size: .9rem;
}
.site-dropdown-head { padding: .5rem .75rem .75rem; border-bottom: 1px solid var(--shell-line); margin-bottom: .35rem; }
.site-dropdown-name { font-weight: 600; font-size: .9rem; }
.site-dropdown-email { font-size: .76rem; color: var(--shell-muted); }
.site-dropdown-danger { color: #B42318 !important; }

.nav-dropdown { background: var(--shell-panel) !important; border: 1px solid var(--shell-line) !important; border-radius: 14px !important; box-shadow: 0 18px 40px -16px rgba(30, 34, 48, .3) !important; }

/* ---------- Couvertures : toujours à angles droits ---------- */
img[src*="/covers/"],
img[src*="/images/books/"],
.book-cover-wrap, .book-cover-img,
.featured-book-wrap, .featured-book-img,
:is(a, div, span, figure):has(> img[src*="/covers/"]),
:is(a, div, span, figure):has(> img[src*="/images/books/"]) {
    border-radius: 0 !important;
}

/* ---------- Notifications ---------- */
.toast-stack {
    position: fixed; top: 1.5rem; right: 1.5rem; z-index: 1200;
    display: flex; flex-direction: column; gap: .75rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}
.toast {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: start;
    padding: 1rem 1rem 1.1rem 1.1rem;
    background: var(--shell-ink); color: #fff;
    border-radius: 14px;
    box-shadow: 0 22px 44px -18px rgba(30, 34, 48, .55), 0 2px 6px rgba(30, 34, 48, .18);
    pointer-events: auto;
    animation: toast-in .55s cubic-bezier(.2, 1.2, .4, 1) both;
    animation-delay: var(--delay, 0ms);
}
.toast.is-leaving { animation: toast-out .35s cubic-bezier(.4, 0, .6, 1) forwards; }
.toast-icon {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, .12); color: #fff;
}
.toast-success .toast-icon { background: #E9F5EE; color: #0B6B3A; }
.toast-error .toast-icon { background: #FCE9E7; color: #B42318; }
.toast-info .toast-icon { background: #ECEAE2; color: var(--shell-ink); }
.toast-body { padding-top: .1rem; }
.toast-title { margin: 0; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.toast-message { margin: .25rem 0 0; font-size: .88rem; line-height: 1.5; color: #fff; overflow-wrap: anywhere; }
.toast-close {
    width: 28px; height: 28px; margin: -.15rem -.15rem 0 0;
    display: grid; place-items: center; border: 0; border-radius: 50%;
    background: transparent; color: rgba(255, 255, 255, .6); cursor: pointer;
    transition: background .2s, color .2s;
}
.toast-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.toast-progress {
    position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
    background: rgba(255, 255, 255, .45);
    transform-origin: left center;
    animation: toast-progress 6s linear forwards;
    animation-delay: var(--delay, 0ms);
}
.toast.is-paused .toast-progress { animation-play-state: paused; }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px) scale(.96); } }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 768px) {
    .toast-stack { top: calc(64px + .75rem); right: 1rem; left: 1rem; width: auto; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(.97); } to { opacity: 1; transform: none; } }
    @keyframes toast-out { to { opacity: 0; transform: translateY(-16px) scale(.97); } }
}

@media (prefers-reduced-motion: reduce) {
    .toast, .toast.is-leaving { animation-duration: .01ms; }
    .toast-progress { display: none; }
}

/* ---------- Pied de page ---------- */
.site-footer {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
    margin: 0 clamp(1.5rem, 4vw, 4rem); padding: 2rem 0 2.5rem;
    border-top: 1px solid var(--shell-line);
    font-size: .8rem; color: var(--shell-muted);
}
.site-footer img { width: 26px; height: 26px; object-fit: contain; }
.site-footer-brand { display: flex; align-items: center; gap: .6rem; color: var(--shell-ink-soft); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer-links a { color: inherit; }
.site-footer-links a:hover { color: var(--shell-ink); }

/* ---------- Tiroir mobile ---------- */
.drawer-backdrop { position: fixed; inset: 0; z-index: 1001; background: rgba(30, 34, 48, .35); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1002;
    width: min(88vw, 380px);
    display: flex; flex-direction: column;
    background: var(--shell-bg);
    box-shadow: 24px 0 48px -24px rgba(30, 34, 48, .35);
    color: var(--shell-ink);
}
.drawer-slide { transition: transform .38s cubic-bezier(.2, .8, .2, 1); }
.drawer-slide-out { transform: translateX(-100%); }
.drawer-slide-in { transform: none; }
.drawer-fade { transition: opacity .3s ease; }
.drawer-fade-out { opacity: 0; }
.drawer-fade-in { opacity: 1; }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; }
.drawer-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--shell-ink); }
.drawer-brand img { width: 28px; height: 28px; object-fit: contain; }
.drawer-brand span { font-family: var(--shell-serif); font-size: 1.15rem; font-weight: 600; letter-spacing: .12em; }
.drawer-close {
    width: 40px; height: 40px; display: grid; place-items: center;
    border: 1px solid var(--shell-line); border-radius: 50%; background: transparent; color: var(--shell-ink); cursor: pointer;
    transition: background .2s, transform .3s;
}
.drawer-close:hover { background: rgba(30, 34, 48, .05); transform: rotate(90deg); }

.drawer-body { flex: 1; overflow-y: auto; padding: .25rem 1.5rem 1.5rem; }
.drawer-search {
    display: flex; align-items: center; gap: .65rem;
    padding-bottom: .6rem; margin-bottom: 1.75rem;
    border-bottom: 1px solid rgba(30, 34, 48, .2); color: var(--shell-ink-soft);
}
.drawer-search:focus-within { border-bottom-color: var(--shell-ink); }
.drawer-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: .95rem; color: var(--shell-ink); }
.drawer-search input::placeholder { color: var(--shell-muted); }

.drawer-nav { display: flex; flex-direction: column; }
.drawer-link {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .7rem 0; border-bottom: 1px solid var(--shell-line);
    font-family: var(--shell-serif); font-size: 1.85rem; font-weight: 500; line-height: 1.15;
    color: var(--shell-ink-soft); text-decoration: none;
    animation: drawer-item-in .5s cubic-bezier(.2, .8, .2, 1) both;
    animation-delay: calc(120ms + var(--i, 0) * 55ms);
    transition: color .2s, padding .25s;
}
.drawer-link svg { opacity: .35; transition: opacity .2s, transform .25s; }
.drawer-link:hover, .drawer-link.is-active { color: var(--shell-ink); }
.drawer-link:hover { padding-left: .35rem; }
.drawer-link:hover svg, .drawer-link.is-active svg { opacity: 1; transform: translateX(3px); }

.drawer-section { margin-top: 2rem; animation: drawer-item-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(120ms + var(--i, 0) * 55ms); }
.drawer-label { margin: 0 0 .75rem; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--shell-muted); }
.drawer-collections { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.drawer-collections a {
    display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
    padding: .5rem 0; font-size: .95rem; color: var(--shell-ink-soft); text-decoration: none;
    transition: color .2s, padding .2s;
}
.drawer-collections a:hover, .drawer-collections a.is-active { color: var(--shell-ink); padding-left: .3rem; }
.drawer-collections a.is-active span:first-child { border-bottom: 1px solid var(--shell-ink); }
.drawer-count { font-size: .76rem; color: var(--shell-muted); font-variant-numeric: tabular-nums; }
.drawer-services { display: flex; flex-direction: column; gap: .2rem; padding-top: 1.25rem; border-top: 1px solid var(--shell-line); }
.drawer-services a { padding: .4rem 0; font-size: .88rem; color: var(--shell-ink-soft); text-decoration: none; }
.drawer-services a:hover { color: var(--shell-ink); text-decoration: underline; text-underline-offset: 3px; }

.drawer-account { padding: 1.25rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--shell-line); background: var(--shell-panel); }
.drawer-user { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.drawer-avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: var(--shell-ink); color: #fff; font-weight: 600; }
.drawer-user-info { min-width: 0; }
.drawer-user-name { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-user-email { font-size: .78rem; color: var(--shell-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.drawer-actions:has(> :only-child) { grid-template-columns: 1fr; }
.drawer-actions form { margin: 0; display: contents; }
.drawer-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: .65rem .75rem; border-radius: 999px; white-space: nowrap;
    border: 1px solid var(--shell-ink); background: var(--shell-ink); color: #fff;
    font: inherit; font-size: .84rem; font-weight: 500; text-decoration: none; cursor: pointer;
    transition: background .2s, color .2s;
}
.drawer-btn:hover { background: #33384A; }
.drawer-btn-ghost { background: transparent; color: var(--shell-ink); border-color: rgba(30, 34, 48, .25); }
.drawer-btn-ghost:hover { background: rgba(30, 34, 48, .05); }

@keyframes drawer-item-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .drawer-slide, .drawer-fade { transition: none; }
    .drawer-link, .drawer-section { animation: none; }
}

/* ---------- Fenêtre de recherche ---------- */
.search-backdrop { position: fixed; inset: 0; z-index: 1003; background: rgba(30, 34, 48, .4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.search-panel {
    position: fixed; z-index: 1004; top: 9vh; left: 50%;
    width: min(680px, calc(100vw - 2rem)); max-height: 78vh;
    display: flex; flex-direction: column;
    background: var(--shell-panel); color: var(--shell-ink);
    box-shadow: 0 40px 80px -30px rgba(30, 34, 48, .55);
    transform: translateX(-50%);
}
.search-pop { transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.search-pop-out { opacity: 0; transform: translate(-50%, -14px); }
.search-pop-in { opacity: 1; transform: translate(-50%, 0); }

.search-form { display: flex; align-items: center; gap: .9rem; padding: 1.5rem 1.75rem 1.1rem; border-bottom: 1px solid var(--shell-line); color: var(--shell-ink-soft); }
.search-form input {
    flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
    font-family: var(--shell-serif); font-size: 1.75rem; font-weight: 500; color: var(--shell-ink);
}
.search-form input::placeholder { color: var(--shell-muted); }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-close {
    width: 40px; height: 40px; flex-shrink: 0; display: grid; place-items: center;
    border: 1px solid var(--shell-line); border-radius: 50%; background: transparent; color: var(--shell-ink); cursor: pointer;
    transition: background .2s, transform .3s;
}
.search-close:hover { background: rgba(30, 34, 48, .05); transform: rotate(90deg); }
.search-spinner { width: 18px; height: 18px; border: 2px solid var(--shell-line); border-top-color: var(--shell-ink); border-radius: 50%; animation: search-spin .7s linear infinite; }

.search-body { overflow-y: auto; padding: 1.25rem 1.75rem 1.75rem; }
.search-section + .search-section { margin-top: 1.5rem; }
.search-label { margin: 0 0 .75rem; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--shell-muted); }
.search-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.search-chip {
    padding: .45rem .9rem; border: 1px solid var(--shell-line); border-radius: 999px;
    font-size: .86rem; color: var(--shell-ink-soft); text-decoration: none;
    transition: border-color .2s, color .2s, background .2s;
}
.search-chip:hover { border-color: var(--shell-ink); color: var(--shell-ink); background: rgba(30, 34, 48, .03); }

.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li { animation: drawer-item-in .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 40ms); }
.search-result {
    display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 1rem; align-items: center;
    padding: .75rem .5rem; margin: 0 -.5rem; text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--shell-line); transition: background .2s;
}
.search-result:hover, .search-result:focus-visible { background: rgba(30, 34, 48, .04); outline: none; }
.search-result img { width: 44px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 0; box-shadow: -6px 10px 14px -10px rgba(30, 34, 48, .5); }
.search-result svg { opacity: .35; transition: opacity .2s, transform .2s; }
.search-result:hover svg { opacity: 1; transform: translateX(3px); }
.search-result-text { min-width: 0; }
.search-result-title { display: block; font-family: var(--shell-serif); font-size: 1.15rem; font-weight: 500; line-height: 1.25; color: var(--shell-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-meta { display: block; margin-top: .15rem; font-size: .8rem; color: var(--shell-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-all { display: inline-block; margin-top: 1.1rem; font-size: .86rem; color: var(--shell-ink); text-decoration: underline; text-underline-offset: 3px; }
.search-empty { margin: .5rem 0 0; font-size: .92rem; color: var(--shell-ink-soft); }

@keyframes search-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .search-panel { top: 0; left: 0; width: 100%; max-height: 100%; height: 100%; transform: none; box-shadow: none; }
    .search-pop-out { opacity: 0; transform: translateY(-12px); }
    .search-pop-in { opacity: 1; transform: none; }
    .search-form { padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem .9rem; }
    .search-form input { font-size: 1.45rem; }
    .search-body { padding: 1.1rem 1.25rem 2rem; }
}

@media (prefers-reduced-motion: reduce) {
    .search-pop { transition: none; }
    .search-results li { animation: none; }
    .search-spinner { animation-duration: 2s; }
}

/* ---------- Mobile : la topbar et la tab bar mobiles prennent le relais ---------- */
@media (max-width: 768px) {
    .library-container { padding-left: 0; }
    .site-rail, .site-topbar { display: none !important; }
    .site-footer { margin: 0 1.25rem; padding-bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px)); flex-direction: column; text-align: center; }
    .mobile-topbar { background: var(--shell-bg) !important; border-bottom-color: var(--shell-line) !important; }
}

@media (prefers-reduced-motion: reduce) {
    .site-rail-logo img, .site-rail-tip, .site-rail-link { transition: none; }
}

/* ---------- Barres de défilement ---------- */
/* Fines et arrondies, couleur de l'encre (dorées au survol là où le navigateur le permet). Suivent le mode jour / nuit. */
:root {
    --scroll-thumb: rgba(30, 34, 48, .22);
    --scroll-thumb-hover: #D9AE5C;
    --scroll-track: var(--shell-bg);
}
html[data-theme="dark"] {
    --scroll-thumb: rgba(236, 232, 223, .2);
    --scroll-thumb-hover: #D9AE5C;
}

/* Firefox, Chrome et Edge récents */
@supports (scrollbar-color: auto) {
    html, body, * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
}

/* Safari et anciens navigateurs Chromium */
@supports not (scrollbar-color: auto) {
    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-track { background: var(--scroll-track); }
    ::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 999px; background: var(--scroll-thumb) padding-box; }
    ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover) padding-box; }
    ::-webkit-scrollbar-corner { background: transparent; }
}

/* ---------- Mises à jour sans rechargement (js/live.js) ---------- */
[data-live] { transition: opacity .25s ease; }
[data-live].is-live-loading { opacity: .55; pointer-events: none; cursor: progress; }
[data-live].is-live-entering { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    [data-live] { transition: none; }
}

/* ---------- Bandeau d'annonce (Paramètres › Contenus du site) ---------- */
.site-announcement { position: relative; box-sizing: border-box; width: 100%; align-self: stretch; display: flex; align-items: center; justify-content: center; gap: .75rem; padding: .6rem 3rem; background: #1E2230; color: #FAF9F5; font-size: .82rem; letter-spacing: .02em; text-align: center; }
.site-announcement-text { color: inherit; text-decoration: none; }
a.site-announcement-text:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-announcement-close { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.site-announcement-close:hover { opacity: 1; background: rgba(250, 249, 245, .1); }

/* ---------- Animations ---------- */
/* Transition entre deux pages : l'en-tête et les barres restent en place, le contenu glisse.
   Navigateurs récents (Chrome, Edge, Safari) ; ailleurs, simple apparition du contenu (.no-page-transition). */
@view-transition { navigation: auto; }

.site-topbar { view-transition-name: site-header; }
.mobile-topbar { view-transition-name: site-header-mobile; }
.site-rail { view-transition-name: site-rail; }
.mobile-bottom-bar { view-transition-name: site-tabbar; }

/* Barres fixes : ni fondu ni déplacement, elles ne « clignotent » pas */
::view-transition-group(site-header), ::view-transition-group(site-header-mobile),
::view-transition-group(site-rail), ::view-transition-group(site-tabbar) { animation: none; }
::view-transition-old(site-header), ::view-transition-old(site-header-mobile),
::view-transition-old(site-rail), ::view-transition-old(site-tabbar) { display: none; }
::view-transition-new(site-header), ::view-transition-new(site-header-mobile),
::view-transition-new(site-rail), ::view-transition-new(site-tabbar) { animation: none; }

/* Contenu : l'ancienne page s'efface vers la gauche, la nouvelle arrive depuis la droite */
::view-transition-old(root) { animation: .28s cubic-bezier(.4, 0, 1, 1) both page-out; }
::view-transition-new(root) { animation: .5s cubic-bezier(.2, .8, .2, 1) .08s both page-in; }
@keyframes page-out { to { opacity: 0; transform: translateX(-36px) scale(.985); filter: blur(2px); } }
@keyframes page-in { from { opacity: 0; transform: translateX(48px) scale(.985); } }

/* Retour arrière du navigateur : même mouvement, dans l'autre sens */
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: page-out-back; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: page-in-back; }
@keyframes page-out-back { to { opacity: 0; transform: translateX(36px) scale(.985); filter: blur(2px); } }
@keyframes page-in-back { from { opacity: 0; transform: translateX(-48px) scale(.985); } }

/* Navigateurs sans transition entre pages : le contenu apparaît en douceur */
.no-page-transition .page-body { animation: page-in .45s cubic-bezier(.2, .8, .2, 1) both; }

/* Fine barre dorée pendant le chargement de la page suivante */
.page-progress { position: fixed; top: 0; left: 0; z-index: 3000; height: 2px; width: 100%; background: #D9AE5C; box-shadow: 0 0 8px rgba(217, 174, 92, .6); transform-origin: left; transform: scaleX(0); pointer-events: none; }
.page-progress.is-loading { animation: page-progress 2.5s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes page-progress { from { transform: scaleX(0); } to { transform: scaleX(.85); } }

/* Apparition au défilement (js/motion.js) */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2, .8, .2, 1) var(--reveal-delay, 0ms), transform .7s cubic-bezier(.2, .8, .2, 1) var(--reveal-delay, 0ms); }
.reveal.is-revealed { opacity: 1; transform: none; }

/* Retour discret au survol des couvertures et boutons */
.catalog-card img, .news-card-media img, .pg-owned-cover img { transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease; }
.catalog-card:hover img, .news-card:hover .news-card-media img { transform: translateY(-4px); }
.pg-btn:active, .btn:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
    .no-page-transition .page-body, .page-progress.is-loading { animation: none; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .catalog-card img, .news-card-media img, .pg-owned-cover img { transition: none; }
    .catalog-card:hover img, .news-card:hover .news-card-media img, .pg-btn:active, .btn:active { transform: none; }
}

/* Pastille « en direct » du tableau de bord */
.live-dot { display: inline-block; width: 7px; height: 7px; margin: 0 .35rem .1rem 0; border-radius: 50%; background: #2F9E6B; vertical-align: middle; animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* Rond qui file vers le panier à l'ajout d'un livre (js/motion.js) */
.cart-fly { position: fixed; z-index: 2000; width: 18px; height: 18px; pointer-events: none; }
.cart-fly-dot { width: 100%; height: 100%; border-radius: 50%; background: #D9AE5C; box-shadow: 0 0 0 3px rgba(217, 174, 92, .25), 0 6px 14px -4px rgba(169, 130, 47, .6); }
.cart-bump { animation: cart-bump .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cart-bump { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 65% { transform: scale(.94); } 100% { transform: scale(1); } }
