/* MangaPulse — homepage, découverte, bibliothèque, recherche, dock mobile. */

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.side-search { margin: .35rem .15rem .5rem; }
.side-search input {
    width: 100%; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); border-radius: 10px; padding: .55rem .7rem; font: inherit;
}
.side-search input::placeholder { color: var(--faint); }

.home-article { max-width: 920px; margin: 0 auto; padding: 1.2rem 1.4rem 4rem; }
.home-hero { padding: 1.2rem 0 1.6rem; }
.home-hero h1, .home-resume h1 {
    font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.03em; line-height: 1.15;
    margin: .35rem 0 .7rem;
}
.home-hero-compact h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.home-lead { color: var(--muted); font-size: 1.02rem; line-height: 1.55; max-width: 42rem; }
.home-lead.muted { color: var(--faint); }
.home-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.home-search, .side-search { position: relative; }
.suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + .28rem);
    z-index: 9; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 16px 40px -24px var(--shadow);
}
.suggest a {
    display: flex; flex-direction: column; gap: .1rem;
    padding: .55rem .8rem; color: inherit; text-decoration: none;
    border-top: 1px solid var(--border-soft);
}
.suggest a:first-child { border-top: 0; }
.suggest a:hover { background: var(--surface-2); }
.suggest span { color: var(--faint); font-size: .78rem; }
.home-search input {
    flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--surface);
    color: var(--text); border-radius: 12px; padding: .7rem .85rem; font: inherit;
}
.home-resume {
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg); padding: 1.15rem 1.2rem 1.3rem; margin-bottom: .8rem;
}

.rail { margin: 1.8rem 0; }
.rail h2 { font-size: 1.15rem; margin: .15rem 0 .7rem; }
.rail-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(11.5rem, 1fr);
    gap: .7rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory;
}
.rail-card {
    scroll-snap-align: start; display: flex; flex-direction: column; gap: .35rem;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: 14px; padding: .85rem .9rem; color: inherit; text-decoration: none;
    min-height: 6.2rem;
}
.rail-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    background: var(--surface-2);
}
.rail-cover[hidden] { display: none; }
.rail-card:hover { border-color: var(--border); background: var(--surface-2); }
.rail-card strong { font-size: .95rem; line-height: 1.25; }
.rail-card span { color: var(--faint); font-size: .78rem; }

.intent-list, .search-hits { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.intent-list a, .search-hits a {
    display: flex; flex-direction: column; gap: .15rem;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: 12px; padding: .75rem .9rem; color: inherit; text-decoration: none;
}
.search-hits a {
    flex-direction: row; align-items: center; gap: .75rem;
}
.search-cover {
    width: 48px; height: 72px; object-fit: cover; border-radius: 6px;
    background: var(--surface-2); flex: 0 0 48px;
}
.search-cover[hidden] { display: none; }
.search-hits a span { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.search-hits span { color: var(--faint); font-size: .82rem; }

.shelf-block { margin: 1.4rem 0; }
.shelf-block h2 { font-size: 1.05rem; display: flex; gap: .5rem; align-items: baseline; }
.shelf-block h2 small { color: var(--faint); font-weight: 500; }
.shelf-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.shelf-row {
    display: grid; grid-template-columns: 1fr auto auto auto; gap: .2rem .55rem;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: 12px; padding: .7rem .85rem; align-items: center;
}
.shelf-title { color: var(--text); text-decoration: none; font-weight: 600; }
.shelf-meta { grid-column: 1; color: var(--faint); font-size: .8rem; }
.shelf-star {
    grid-column: 2; grid-row: 1 / span 2;
    background: transparent; border: 0; color: var(--faint);
    font-size: 1.05rem; padding: .2rem .35rem; border-radius: 8px;
}
.shelf-star[aria-pressed="true"] { color: var(--accent); }
.shelf-pick { grid-column: 3; grid-row: 1 / span 2; }
.shelf-forget {
    grid-column: 4; grid-row: 1 / span 2;
    appearance: none; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: .78rem; font-weight: 550;
    padding: .35rem .45rem; border-radius: 8px; cursor: pointer;
    white-space: nowrap;
}
.shelf-forget:hover { color: var(--accent); background: var(--surface-2); }
.shelf-forget:disabled { opacity: .5; cursor: progress; }
.shelf-select {
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    border-radius: 8px; padding: .35rem .45rem; font: inherit;
}

.onboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .65rem; }
.onboard-chip {
    display: block; cursor: pointer; border: 1px solid var(--border-soft);
    background: var(--surface); border-radius: 12px; padding: .75rem .8rem;
}
.onboard-chip:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
.onboard-chip input { position: absolute; opacity: 0; pointer-events: none; }
.onboard-chip small { display: block; color: var(--faint); margin-top: .2rem; font-size: .75rem; }
.onboard-grid .home-cta { grid-column: 1 / -1; }

.lib-actions {
    display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0;
}
.lib-actions .discover-btn { margin: 0; }

.dock {
    display: none;
}

@media (max-width: 820px) {
    .dock {
        display: grid; grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
        background: var(--sidebar); border-top: 1px solid var(--border);
        padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
    }
    .dock a {
        color: var(--muted); text-decoration: none; font-size: .68rem;
        text-align: center; padding: .45rem .1rem; border-radius: 8px;
    }
    .dock a.is-on { color: var(--text); background: var(--surface-2); }
    .app { padding-bottom: calc(3.4rem + env(safe-area-inset-bottom)); }
    .chat-page .composer-wrap {
        padding-bottom: calc(.45rem + env(safe-area-inset-bottom));
    }
    .chat-page .scroll-bottom { bottom: 7.4rem; }
}
