/* ═══════════════════════════════════════════════════════════════════════════
   /home — Page d'accueil
   ---------------------------------------------------------------------------
   Remplace le bloc <style> de ~190 lignes qui était inline dans home.php, et
   qui redéfinissait au passage sa propre variable --primary.

   Tout ce qui n'est pas spécifique à l'accueil (cartes, badges, onglets,
   barres de progression, états vides) vient du socle /css/als-ui.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Conteneur de page : complète .als-page du socle. */
.hp-page { padding-block: 1.25rem 3rem; }

/* ───────────────────────────────────────────────────────────────────────────
   1. En-têtes de section
   ─────────────────────────────────────────────────────────────────────────── */
.hp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--als-border-divider);
}

.hp-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--als-text-heading);
    margin: 0;
}

.hp-section-link {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--als-text-link);
    text-decoration: none;
    white-space: nowrap;
}
.hp-section-link:hover,
.hp-section-link:focus-visible { color: var(--als-text-link-hover); }

/* ───────────────────────────────────────────────────────────────────────────
   2. Hero
   ---------------------------------------------------------------------------
   Hauteur fixe de 500 px auparavant, quelle que soit la largeur : sur mobile
   la bannière occupait la totalité de l'écran avant tout contenu utile.
   On passe à un ratio, borné en hauteur.
   ─────────────────────────────────────────────────────────────────────────── */
.hp-hero {
    border-radius: var(--als-radius);
    overflow: hidden;
    box-shadow: var(--als-shadow);
}

.hp-hero-figure {
    position: relative;
    margin: 0;
    aspect-ratio: 21 / 9;
    max-height: 460px;
    min-height: 260px;
    background: var(--als-surface-inset);
}

.hp-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Dégradé plutôt qu'un voile uni : l'image reste lisible en haut, le texte
   contrasté en bas. L'ancien overlay noir à 50 % ternissait toute la bannière
   sans garantir le contraste du texte. */
.hp-hero-figure::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
            to top,
            rgba(7, 7, 32, .96) 0%,
            rgba(7, 7, 32, .80) 35%,
            rgba(7, 7, 32, .25) 65%,
            rgba(7, 7, 32, .05) 100%);
    pointer-events: none;
}

.hp-hero-caption {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 1.25rem 1.5rem 1.75rem;
    max-width: 42rem;
    text-align: left;
}

.hp-hero-title {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 .4rem;
    line-height: 1.15;
}

.hp-hero-desc {
    font-size: .9rem;
    line-height: 1.5;
    color: var(--als-text-muted);
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-hero-indicators { margin-bottom: .6rem; }
.hp-hero-indicators [data-bs-target] {
    width: 1.75rem;
    height: .2rem;
    border-radius: var(--als-radius-pill);
    background-color: rgba(255, 255, 255, .45);
    border: 0;
    opacity: 1;
}
.hp-hero-indicators .active { background-color: var(--als-brand); }

/* Contrôle lecture / pause du défilement automatique */
.hp-hero-toggle {
    position: absolute;
    top: .75rem;
    right: .75rem;
    z-index: 3;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .35);
    background: rgba(7, 7, 32, .65);
    color: #fff;
    font-size: .7rem;
    line-height: 1;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.hp-hero-toggle-icon { display: block; }
.hp-hero-toggle:hover,
.hp-hero-toggle:focus-visible {
    background: rgba(7, 7, 32, .9);
    border-color: var(--als-brand);
}

/* ───────────────────────────────────────────────────────────────────────────
   3. Bandeau d'invitation (visiteur non connecté)
   ─────────────────────────────────────────────────────────────────────────── */
.hp-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    background: linear-gradient(135deg,
            var(--als-surface-raised) 0%,
            rgba(229, 54, 55, .16) 100%);
    border: 1px solid var(--als-border);
    border-radius: var(--als-radius);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--als-shadow-sm);
}
.hp-cta-text { flex: 1 1 22rem; min-width: 0; }
.hp-cta-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--als-text-heading);
    margin: 0 0 .35rem;
}
.hp-cta-text p { color: var(--als-text-muted); font-size: .9rem; line-height: 1.55; }
.hp-cta-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ───────────────────────────────────────────────────────────────────────────
   4. Reprise du visionnage — défilement horizontal
   ---------------------------------------------------------------------------
   Une bande défilante plutôt qu'une grille : la section reste compacte quel
   que soit le nombre d'animés en cours, et le geste est naturel sur mobile.
   ─────────────────────────────────────────────────────────────────────────── */
.hp-resume-scroller {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--als-border-input) transparent;
}
.hp-resume-scroller::-webkit-scrollbar { height: .4rem; }
.hp-resume-scroller::-webkit-scrollbar-thumb {
    background: var(--als-border-input);
    border-radius: var(--als-radius-pill);
}

.hp-resume-card {
    flex: 0 0 auto;
    width: 9.5rem;
    scroll-snap-align: start;
}
.hp-resume-link { text-decoration: none; display: block; height: 100%; }

.hp-resume-card .hp-resume-media {
    aspect-ratio: 3 / 4;
    border-radius: var(--als-radius-sm) var(--als-radius-sm) 0 0;
    overflow: hidden;
    background: var(--als-surface-inset);
}
.hp-resume-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--als-t-base) ease;
}
.hp-resume-link:hover .hp-resume-media img { transform: scale(1.05); }

.hp-resume-body {
    background: var(--als-surface);
    border: 1px solid var(--als-border-soft);
    border-top: 0;
    border-radius: 0 0 var(--als-radius-sm) var(--als-radius-sm);
    padding: .5rem .6rem .6rem;
    transition: border-color var(--als-t-fast) ease;
}
.hp-resume-link:hover .hp-resume-body { border-color: var(--als-accent); }

.hp-resume-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--als-text);
    margin: 0 0 .25rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.1em;
}
.hp-resume-progress { font-size: .72rem; color: var(--als-text-muted); margin: 0 0 .35rem; }
.hp-resume-next { font-size: .72rem; color: var(--als-text-muted); margin: .35rem 0 0; }

/* ───────────────────────────────────────────────────────────────────────────
   5. Carte anime (tendances)
   ─────────────────────────────────────────────────────────────────────────── */
.hp-card-link { text-decoration: none; display: block; }

.hp-card {
    position: relative;
    border-radius: var(--als-radius-sm);
    overflow: hidden;
    background: var(--als-surface);
    border: 1px solid transparent;
    transition: transform var(--als-t-base) ease,
                box-shadow var(--als-t-base) ease,
                border-color var(--als-t-fast) ease;
}
.hp-card-link:hover .hp-card,
.hp-card-link:focus-visible .hp-card {
    transform: translateY(-4px);
    border-color: var(--als-accent);
    box-shadow: var(--als-shadow);
}

.hp-card-media { background: var(--als-surface-inset); }
.hp-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hp-card-eps {
    position: absolute;
    top: .5rem;
    left: .5rem;
    background: var(--als-brand);
    color: #fff;
    padding: .15rem .55rem;
    font-size: .7rem;
    font-weight: 700;
    border-radius: var(--als-radius-xs);
}

.hp-card-rating {
    position: absolute;
    top: .5rem;
    right: .5rem;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* Le titre était auparavant hors de la carte, tronqué sur une ligne : il
   passe à l'intérieur, sur deux lignes, pour rester lisible. */
.hp-card-title {
    font-size: .82rem;
    font-weight: 600;
    color: var(--als-text);
    margin: 0;
    padding: .5rem .6rem .6rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}

/* ───────────────────────────────────────────────────────────────────────────
   6. Ligne anime (prochaines sorties)
   ─────────────────────────────────────────────────────────────────────────── */
.hp-row-link { text-decoration: none; display: block; height: 100%; }

.hp-row {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    height: 100%;
    background: var(--als-surface);
    border: 1px solid var(--als-border-soft);
    border-radius: var(--als-radius-sm);
    padding: .65rem;
    transition: border-color var(--als-t-fast) ease, background var(--als-t-fast) ease;
}
.hp-row-link:hover .hp-row,
.hp-row-link:focus-visible .hp-row {
    border-color: var(--als-accent);
    background: var(--als-surface-raised);
}

.hp-row-img {
    width: 4.5rem;
    height: 6rem;
    object-fit: cover;
    border-radius: var(--als-radius-xs);
    flex: 0 0 auto;
    background: var(--als-surface-inset);
}

.hp-row-body { min-width: 0; flex: 1 1 auto; }
.hp-row-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--als-text-heading);
    margin: 0 0 .3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hp-row-meta { font-size: .78rem; color: var(--als-text-muted); margin: 0 0 .45rem; }
.hp-row-date { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.hp-row-hint { font-size: .72rem; color: var(--als-text-muted); }

/* ───────────────────────────────────────────────────────────────────────────
   7. Listes de diffusion (planning et prochains épisodes du membre)
   ─────────────────────────────────────────────────────────────────────────── */
.hp-airing-list { list-style: none; margin: 0; padding: 0; }

.hp-airing-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--als-border-divider);
}
.hp-airing-item:last-child { border-bottom: 0; padding-bottom: 0; }
.hp-airing-item:first-child { padding-top: 0; }

.hp-airing-img {
    width: 2.75rem;
    height: 3.6rem;
    object-fit: cover;
    border-radius: var(--als-radius-xs);
    flex: 0 0 auto;
    background: var(--als-surface-inset);
}

.hp-airing-body { min-width: 0; flex: 1 1 auto; }
.hp-airing-title {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--als-text);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hp-airing-title:hover { color: var(--als-text-heading); }
.hp-airing-meta { font-size: .74rem; color: var(--als-text-muted); }
.hp-airing-late { color: var(--als-warn); font-weight: 600; }

.hp-airing-time {
    flex: 0 0 auto;
    background: var(--als-brand);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: var(--als-radius-xs);
    white-space: nowrap;
}

/* ───────────────────────────────────────────────────────────────────────────
   8. Actualités
   ---------------------------------------------------------------------------
   Les vignettes ont été retirées : elles affichaient trois images statiques
   en boucle (news_preview_1/2/3.jpg), sans rapport avec l'article. Une image
   qui ment sur son contenu dessert la lecture. À réintroduire le jour où les
   articles porteront une vraie image de couverture.
   ─────────────────────────────────────────────────────────────────────────── */
.hp-news {
    display: block;
    position: relative;
    background: var(--als-surface-sunken);
    border: 1px solid var(--als-border-soft);
    border-left: 3px solid var(--als-accent);
    border-radius: var(--als-radius-xs);
    padding: .65rem .75rem;
    text-decoration: none;
    transition: border-color var(--als-t-fast) ease, background var(--als-t-fast) ease;
}
.hp-news:hover,
.hp-news:focus-visible {
    background: var(--als-surface-raised);
    border-left-color: var(--als-brand);
}

.hp-news-pin { margin-bottom: .35rem; }
.hp-news-title {
    font-size: .88rem;
    font-weight: 700;
    color: var(--als-text-heading);
    margin: 0 0 .25rem;
    line-height: 1.3;
}
.hp-news-excerpt {
    font-size: .78rem;
    color: var(--als-text-muted);
    line-height: 1.45;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hp-news-date {
    display: block;
    margin-top: .35rem;
    font-size: .7rem;
    color: var(--als-text-ph);
}

/* ───────────────────────────────────────────────────────────────────────────
   9. Studios
   ─────────────────────────────────────────────────────────────────────────── */
.hp-studio-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.hp-studio {
    flex: 0 1 auto;
    min-width: 9rem;
    max-width: 14rem;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    text-align: center;
    padding: .5rem .9rem;
    border-radius: var(--als-radius-pill);
    background: var(--als-surface);
    border: 1px solid var(--als-border-soft);
    text-decoration: none;
    transition: border-color var(--als-t-fast) ease, background var(--als-t-fast) ease;
}
.hp-studio:hover,
.hp-studio:focus-visible {
    background: var(--als-surface-raised);
    border-color: var(--als-accent);
}

.hp-studio-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--als-text-heading);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hp-studio-meta { font-size: .7rem; color: var(--als-warn); line-height: 1.2; }
.hp-studio-meta-alt { color: var(--als-info); }

/* ───────────────────────────────────────────────────────────────────────────
   10. Responsive
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .hp-hero-figure { aspect-ratio: 4 / 3; max-height: 320px; }
    .hp-hero-caption { padding: 1rem 1rem 1.4rem; }
    .hp-hero-desc { -webkit-line-clamp: 3; line-clamp: 3; }
    .hp-cta { padding: 1rem; }
    .hp-cta-actions { width: 100%; }
    .hp-cta-actions .btn { flex: 1 1 auto; }
    .hp-resume-card { width: 8.5rem; }
    .hp-studio { min-width: 7.5rem; }
    .hp-row-img { width: 3.75rem; height: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hp-card,
    .hp-resume-media img { transition: none; }
    .hp-card-link:hover .hp-card { transform: none; }
    .hp-resume-link:hover .hp-resume-media img { transform: none; }
}
