/* ==============================================
   HOMEPAGE — Light par défaut / Dark via Madara
   ============================================== */

/* ---- Variables LIGHT (défaut) ---- */
:root {
    --hp-bg:       #f4f4f8;
    --hp-surface:  #ffffff;
    --hp-surface2: #eaeaf0;
    --hp-border:   rgba(0,0,0,.09);
    --hp-text:     #1a1a2e;
    --hp-muted:    rgba(26,26,46,.45);
    --hp-accent:   #e63946;
    --hp-gold:     #c49a00;
    --hp-radius:   8px;
    --hp-shonen:   #f97316;
    --hp-shojo:    #ec4899;
    --hp-bl:       #a855f7;
    --hp-teal:     #0d9488;
    --hp-blue:     #2563eb;
}

/* ---- Variables DARK — classe Madara : text-ui-light ---- */
body.text-ui-light {
    --hp-bg:       #0a0a0f;
    --hp-surface:  #111118;
    --hp-surface2: #1a1a24;
    --hp-border:   rgba(255,255,255,.07);
    --hp-text:     #e4e4f0;
    --hp-muted:    rgba(228,228,240,.4);
    --hp-gold:     #f4c542;
    --hp-teal:     #14b8a6;
    --hp-blue:     #3b82f6;
}

/* ---- Root ---- */
.hp-root {
    background: var(--hp-bg);
    color: var(--hp-text);
    font-family: 'Nunito','Segoe UI',sans-serif;
    transition: background .3s, color .3s;
}

/* ================================================================
   HERO — toujours sombre (image de fond)
   ================================================================ */
.hp-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}
.hp-hero__slides { position: relative; }

/* Espace entre hero et première section */
.hp-root > .container:first-of-type { padding-top: 2rem; }

.hp-hero__slide {
    position: absolute;
    inset: 0;
    min-height: 500px;
    display: flex;
    align-items: center;
    padding: 3.5rem 0 5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .7s ease;
}
.hp-hero__slide.is-active {
    position: relative;
    opacity: 1;
    pointer-events: auto;
}
.hp-hero__bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center 25%;
    filter: brightness(.4) saturate(1.2);
    transform: scale(1.04); z-index: 0;
    transition: transform 8s ease;
}
.hp-hero__slide.is-active .hp-hero__bg { transform: scale(1); }
.hp-hero__vignette {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(100deg, rgba(10,10,15,.97) 0%, rgba(10,10,15,.82) 45%, rgba(10,10,15,.25) 80%, transparent 100%);
}
.hp-hero__grain {
    position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
    background-size: 300px;
}
.hp-hero__layout {
    position: relative; z-index: 3;
    display: flex; align-items: center;
    justify-content: space-between; gap: 2.5rem; width: 100%;
}
.hp-hero__content { flex: 1; min-width: 0; max-width: 620px; }
.hp-hero__pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1.1rem; }
.hp-pill {
    font-size: .62rem; font-weight: 800; letter-spacing: .09em;
    text-transform: uppercase; padding: .22rem .6rem; border-radius: 4px; line-height: 1.5;
}
.hp-pill--end      { background: #10b981; color: #fff; }
.hp-pill--ongoing  { background: #3b82f6; color: #fff; }
.hp-pill--hold     { background: #f59e0b; color: #fff; }
.hp-pill--canceled { background: #6b7280; color: #fff; }
.hp-pill--upcoming { background: #8b5cf6; color: #fff; }
.hp-pill--ghost    { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.75); }
.hp-hero__title {
    font-size: 2.6rem; font-weight: 900; line-height: 1.08;
    color: #fff; margin: 0 0 .6rem;
    text-shadow: 0 4px 24px rgba(0,0,0,.6);
}
.hp-hero__title a { color: inherit; text-decoration: none; }
.hp-hero__title a:hover { color: var(--hp-accent); }
.hp-hero__author { font-size: .78rem; color: rgba(255,255,255,.5); margin-bottom: .75rem; }
.hp-hero__excerpt {
    font-size: .88rem; line-height: 1.68; color: rgba(255,255,255,.58);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 1rem;
}
.hp-hero__stats { display: flex; gap: 1.2rem; margin-bottom: 1.5rem; font-size: .82rem; color: rgba(255,255,255,.55); }
.hp-hero__stat--star { color: #f4c542; font-weight: 700; }
.hp-hero__cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hp-btn {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .85rem; font-weight: 700; padding: .7rem 1.5rem;
    border-radius: 6px; text-decoration: none; transition: all .2s; white-space: nowrap;
}
.hp-btn--red { background: var(--hp-accent); color: #fff; }
.hp-btn--red:hover { filter: brightness(1.12); color: #fff; transform: translateY(-1px); }
.hp-btn--ghost { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; }
.hp-btn--ghost:hover { background: rgba(255,255,255,.18); color: #fff; }
.hp-hero__cover { flex-shrink: 0; width: 220px; }
.hp-hero__cover img {
    width: 100%; aspect-ratio: 2/3; object-fit: cover;
    border-radius: 10px; display: block;
    box-shadow: 0 30px 80px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06);
}
.hp-hero__nav {
    position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px; z-index: 10;
}
.hp-hero__dot {
    width: 8px; height: 8px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.3); padding: 0; transition: all .25s;
}
.hp-hero__dot.is-active { background: var(--hp-accent); width: 22px; border-radius: 4px; }
.hp-hero__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); color: #fff;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: background .2s;
}
.hp-hero__arrow:hover { background: var(--hp-accent); border-color: var(--hp-accent); }
.hp-hero__arrow--prev { left: 16px; }
.hp-hero__arrow--next { right: 16px; }

/* ================================================================
   SECTIONS COMMUNES
   ================================================================ */
.hp-section { margin-bottom: 2.8rem; }
.hp-section-header {
    display: flex; align-items: center;
    justify-content: space-between; margin-bottom: 1rem; gap: .5rem;
}
.hp-section-header__left { display: flex; align-items: center; gap: .75rem; }
.hp-section-title { font-size: 1.05rem; font-weight: 800; color: var(--hp-text); margin: 0; }
.hp-section-sub { font-size: .72rem; color: var(--hp-muted); margin: .1rem 0 0; }
.hp-see-all {
    font-size: .72rem; font-weight: 700; color: var(--hp-accent);
    text-decoration: none; white-space: nowrap; transition: opacity .2s;
}
.hp-see-all:hover { opacity: .7; color: var(--hp-accent); }

/* Barres colorées */
.hp-bar { width: 4px; height: 26px; border-radius: 2px; flex-shrink: 0; }
.hp-bar--fire   { background: linear-gradient(to bottom, #ff6b35, #f4c542); }
.hp-bar--gold   { background: linear-gradient(to bottom, #f4c542, #f97316); }
.hp-bar--green  { background: linear-gradient(to bottom, #10b981, #14b8a6); }
.hp-bar--teal   { background: var(--hp-teal); }
.hp-bar--blue   { background: var(--hp-blue); }
.hp-bar--shonen { background: var(--hp-shonen); }
.hp-bar--shojo  { background: var(--hp-shojo); }
.hp-bar--bl     { background: var(--hp-bl); }

/* Fade-in scroll */
.hp-fade-in { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.hp-fade-in.hp-visible { opacity: 1; transform: none; }

/* ================================================================
   TRENDING GRID
   ================================================================ */
.hp-trending-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px; height: 440px;
}
.hp-tcard { position: relative; border-radius: var(--hp-radius); overflow: hidden; background: var(--hp-surface2); }
.hp-tcard--big { grid-row: 1 / 4; }
.hp-tcard--sm:nth-child(2) { grid-column: 2; grid-row: 1; }
.hp-tcard--sm:nth-child(3) { grid-column: 3; grid-row: 1; }
.hp-tcard--sm:nth-child(4) { grid-column: 2; grid-row: 2; }
.hp-tcard--sm:nth-child(5) { grid-column: 3; grid-row: 2; }
.hp-tcard--sm:nth-child(6) { grid-column: 2; grid-row: 3; }
.hp-tcard--sm:nth-child(7) { grid-column: 3; grid-row: 3; }
.hp-tcard__inner { display: block; width: 100%; height: 100%; position: relative; }
.hp-tcard__inner img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.hp-tcard:hover .hp-tcard__inner img { transform: scale(1.06); }
.hp-tcard__overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: space-between; padding: 10px;
    background: linear-gradient(to bottom, rgba(0,0,0,.5) 0%, transparent 35%, transparent 55%, rgba(0,0,0,.85) 100%);
}
.hp-tcard__top { display: flex; align-items: center; gap: 6px; }
.hp-tcard__rank { font-size: 1.6rem; font-weight: 900; color: rgba(255,255,255,.2); line-height: 1; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.hp-tcard--big .hp-tcard__rank { font-size: 3rem; color: rgba(255,255,255,.15); }
.hp-tcard__status { font-size: .58rem; font-weight: 800; padding: .18rem .45rem; border-radius: 3px; letter-spacing: .06em; text-transform: uppercase; }
.hp-tcard__status--end      { background: #10b981; color: #fff; }
.hp-tcard__status--ongoing  { background: #3b82f6; color: #fff; }
.hp-tcard__status--hold     { background: #f59e0b; color: #fff; }
.hp-tcard__status--canceled { background: #6b7280; color: #fff; }
.hp-tcard__status--upcoming { background: #8b5cf6; color: #fff; }
.hp-tcard__title { font-size: .8rem; font-weight: 700; color: #fff; margin: 0 0 .2rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hp-tcard--big .hp-tcard__title { font-size: 1.15rem; -webkit-line-clamp: 3; }
.hp-tcard__genre { font-size: .62rem; color: rgba(255,255,255,.55); display: block; margin-bottom: .25rem; }
.hp-tcard__meta { font-size: .65rem; color: rgba(255,255,255,.7); display: flex; gap: .6rem; }

/* ================================================================
   DOUBLE BLOC
   ================================================================ */
.hp-double { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.5rem; margin-bottom: 2.8rem; }

/* Classement */
.hp-ranking { margin-bottom: 0 !important; }
.hp-rank-item {
    display: flex; align-items: center; gap: .8rem;
    padding: .55rem .65rem; border-radius: var(--hp-radius);
    background: var(--hp-surface); border: 1px solid var(--hp-border);
    margin-bottom: 6px; transition: background .2s;
}
.hp-rank-item:hover { background: var(--hp-surface2); }
.hp-rank-item--podium { border-left: 3px solid; }
.hp-rank-item--podium:nth-child(2) { border-color: var(--hp-gold); }
.hp-rank-item--podium:nth-child(3) { border-color: #9ca3af; }
.hp-rank-item--podium:nth-child(4) { border-color: #cd7f32; }
.hp-rank-num { font-size: 1.3rem; font-weight: 900; min-width: 26px; text-align: center; line-height: 1; color: var(--hp-border); }
.hp-rank-num--1 { color: var(--hp-gold); }
.hp-rank-num--2 { color: #9ca3af; }
.hp-rank-num--3 { color: #cd7f32; }
.hp-rank-thumb { width: 42px; height: 58px; border-radius: 4px; overflow: hidden; display: block; flex-shrink: 0; }
.hp-rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hp-rank-body { flex: 1; min-width: 0; }
.hp-rank-title {
    display: block; font-size: .8rem; font-weight: 700; color: var(--hp-text);
    text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .2rem;
}
.hp-rank-title:hover { color: var(--hp-accent); }
.hp-rank-genre { font-size: .65rem; color: var(--hp-muted); display: block; margin-bottom: .2rem; }
.hp-rank-meta { font-size: .68rem; color: var(--hp-muted); display: flex; gap: .6rem; }
.hp-rank-star { color: var(--hp-gold); font-weight: 700; }

/* Nouveautés grid */
.hp-new-grid-section { margin-bottom: 0 !important; }
.hp-new-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hp-new-item { display: flex; flex-direction: column; }
.hp-new-item__thumb {
    display: block; position: relative; aspect-ratio: 2/3;
    border-radius: 6px; overflow: hidden; background: var(--hp-surface2); margin-bottom: .45rem;
}
.hp-new-item__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.hp-new-item:hover .hp-new-item__thumb img { transform: scale(1.06); }
.hp-new-item__badge {
    position: absolute; top: 5px; left: 5px; z-index: 2;
    font-size: .55rem; font-weight: 800; padding: .15rem .4rem;
    border-radius: 3px; text-transform: uppercase; letter-spacing: .05em;
}
.hp-new-item__badge--end      { background: #10b981; color: #fff; }
.hp-new-item__badge--ongoing  { background: #3b82f6; color: #fff; }
.hp-new-item__badge--hold     { background: #f59e0b; color: #fff; }
.hp-new-item__badge--canceled { background: #6b7280; color: #fff; }
.hp-new-item__badge--upcoming { background: #8b5cf6; color: #fff; }
.hp-new-item__title {
    display: block; font-size: .72rem; font-weight: 700; color: var(--hp-text);
    text-decoration: none; margin-bottom: .15rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hp-new-item__title:hover { color: var(--hp-accent); }
.hp-new-item__genre { font-size: .62rem; color: var(--hp-muted); display: block; margin-bottom: .1rem; }
.hp-new-item__meta { font-size: .63rem; color: var(--hp-muted); display: flex; gap: .5rem; }
.hp-new-item__star { color: var(--hp-gold); font-weight: 700; }

/* ================================================================
   MISES À JOUR
   ================================================================ */
.hp-updates-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hp-upd-item {
    display: flex; gap: .7rem; align-items: flex-start;
    padding: .55rem; border-radius: var(--hp-radius);
    background: var(--hp-surface); border: 1px solid var(--hp-border); transition: background .2s;
}
.hp-upd-item:hover { background: var(--hp-surface2); }
.hp-upd-thumb { flex-shrink: 0; width: 48px; height: 64px; border-radius: 4px; overflow: hidden; display: block; }
.hp-upd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hp-upd-body { flex: 1; min-width: 0; }
.hp-upd-title {
    display: block; font-size: .74rem; font-weight: 700; color: var(--hp-text);
    text-decoration: none; margin-bottom: .2rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hp-upd-title:hover { color: var(--hp-accent); }
.hp-upd-genre { font-size: .62rem; color: var(--hp-muted); display: block; margin-bottom: .25rem; }
.hp-upd-chapter { display: block; font-size: .65rem; color: var(--hp-teal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-upd-chapter em { color: var(--hp-muted); font-style: normal; margin-left: .3rem; }

/* ================================================================
   BANNIÈRE GENRES
   ================================================================ */
.hp-genre-banner { margin-bottom: 2.8rem; }
.hp-genre-banner__title { font-size: 1.05rem; font-weight: 800; color: var(--hp-text); margin: 0 0 1rem; }
.hp-genre-banner__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.hp-gtile {
    position: relative; border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 160px; text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease;
}
.hp-gtile:hover { transform: translateY(-5px); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.hp-gtile:hover .hp-gtile__bg { transform: scale(1.07); filter: brightness(.45) saturate(1.3); }

/* Image de fond */
.hp-gtile__bg {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    transition: transform .5s ease, filter .4s ease;
    z-index: 0;
}
.hp-gtile--shonen .hp-gtile__bg { background-image: url("https://mangahub.fr/wp-content/uploads/2026/03/shonen-banner.jpg"); filter: brightness(.5) saturate(1.2); }
.hp-gtile--shojo  .hp-gtile__bg { background-image: url("https://mangahub.fr/wp-content/uploads/2026/03/shojo-banner.jpg");  filter: brightness(.5) saturate(1.2); }
.hp-gtile--bl     .hp-gtile__bg { background-image: url("https://mangahub.fr/wp-content/uploads/2026/03/bl-banner.jpg");     filter: brightness(.45) saturate(1.2); }

/* Overlay couleur par genre */
.hp-gtile__overlay {
    position: absolute; inset: 0; z-index: 1;
    transition: opacity .3s ease;
}
.hp-gtile--shonen .hp-gtile__overlay { background: linear-gradient(135deg, rgba(194,65,12,.55) 0%, rgba(249,115,22,.35) 100%); }
.hp-gtile--shojo  .hp-gtile__overlay { background: linear-gradient(135deg, rgba(157,23,77,.55) 0%, rgba(236,72,153,.35) 100%); }
.hp-gtile--bl     .hp-gtile__overlay { background: linear-gradient(135deg, rgba(91,33,182,.6)  0%, rgba(168,85,247,.35) 100%); }

/* Dégradé bas pour lisibilité du texte */
.hp-gtile__vignette {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
}

/* Contenu centré */
.hp-gtile__content {
    position: relative; z-index: 3;
    display: flex; flex-direction: column; align-items: center;
    gap: .25rem; padding: 1rem;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.hp-gtile__icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
    transition: transform .3s ease;
}
.hp-gtile:hover .hp-gtile__icon { transform: scale(1.15); }
.hp-gtile__name { font-size: 1.05rem; font-weight: 900; color: #fff; display: block; letter-spacing: .02em; }
.hp-gtile__desc { font-size: .7rem; color: rgba(255,255,255,.75); display: block; margin-top: .1rem; }

/* ================================================================
   CARDS SLIDER
   ================================================================ */
.hp-card { padding: 0 5px; }
.hp-card__link { display: block; text-decoration: none; }
.hp-card__img {
    position: relative; aspect-ratio: 2/3;
    border-radius: var(--hp-radius); overflow: hidden; background: var(--hp-surface2);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.hp-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.hp-card__status {
    position: absolute; top: 6px; left: 6px; z-index: 3;
    font-size: .56rem; font-weight: 800; padding: .16rem .42rem;
    border-radius: 3px; text-transform: uppercase; letter-spacing: .06em;
}
.hp-card__status--end      { background: #10b981; color: #fff; }
.hp-card__status--ongoing  { background: #3b82f6; color: #fff; }
.hp-card__status--hold     { background: #f59e0b; color: #fff; }
.hp-card__status--canceled { background: #6b7280; color: #fff; }
.hp-card__status--upcoming { background: #8b5cf6; color: #fff; }
.hp-card__hover {
    position: absolute; inset: 0; z-index: 4;
    display: flex; align-items: flex-end;
    background: linear-gradient(to top, rgba(10,10,15,.96) 0%, rgba(10,10,15,.6) 50%, rgba(10,10,15,.08) 100%);
    opacity: 0; transition: opacity .3s ease;
}
.hp-card__link:hover .hp-card__img img { transform: scale(1.08); }
.hp-card__link:hover .hp-card__hover { opacity: 1; }
.hp-card__hover-inner { padding: 9px; width: 100%; display: flex; flex-direction: column; gap: .2rem; }
.hp-card__hover-title { font-size: .72rem; font-weight: 700; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hp-card__hover-genre { font-size: .6rem; color: rgba(255,255,255,.55); }
.hp-card__hover-stats { font-size: .62rem; color: rgba(255,255,255,.7); display: flex; gap: .5rem; margin-top: .1rem; }
.hp-card__hover-btn {
    display: inline-block; margin-top: .35rem;
    font-size: .65rem; font-weight: 800;
    background: var(--hp-accent); color: #fff;
    padding: .25rem .65rem; border-radius: 4px; align-self: flex-start;
}

/* ================================================================
   SLICK OVERRIDES
   ================================================================ */
.hp-slider .slick-list { margin: 0 -5px; }
.hp-slider .slick-track { margin-left: 0; }
.hp-slider .slick-prev,
.hp-slider .slick-next {
    z-index: 5; width: 30px; height: 30px;
    background: var(--hp-surface); border: 1px solid var(--hp-border);
    border-radius: 50%; top: -40px;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.hp-slider .slick-prev { right: 42px; left: auto; }
.hp-slider .slick-next { right: 4px; }
.hp-slider .slick-prev::before,
.hp-slider .slick-next::before { color: var(--hp-text); font-size: 13px; opacity: 1; }
.hp-slider .slick-prev:hover,
.hp-slider .slick-next:hover { background: var(--hp-accent); border-color: var(--hp-accent); }
.hp-slider .slick-prev:hover::before,
.hp-slider .slick-next:hover::before { color: #fff; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1199px) {
    .hp-updates-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 991px) {
    .hp-double { grid-template-columns: 1fr; }
    .hp-new-grid { grid-template-columns: repeat(4,1fr); }
    .hp-trending-grid { grid-template-columns: 1fr 1fr; height: auto; }
    .hp-tcard--big { grid-row: 1; grid-column: 1/3; height: 260px; }
    .hp-tcard--sm { height: 160px; }
    .hp-updates-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 767px) {
    .hp-hero__cover { display: none; }
    .hp-hero__title { font-size: 1.7rem; }
    .hp-hero__slide { min-height: 380px; padding: 2rem 0 4rem; }
    .hp-new-grid { grid-template-columns: repeat(3,1fr); }
    /* Genres en bannière verticale sur mobile */
    .hp-genre-banner__grid { grid-template-columns: 1fr; gap: 10px; }
    .hp-gtile--bl { grid-column: unset; }
    .hp-gtile { min-height: 100px; border-radius: 12px; }
    .hp-gtile__name { font-size: 1.1rem; }
    .hp-gtile__icon { font-size: 1.8rem; }
    .hp-updates-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
    /* Trending — scroll horizontal sur mobile */
    .hp-trending-grid {
        display: flex; flex-direction: row;
        overflow-x: auto; overflow-y: hidden;
        gap: 8px; height: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px; scrollbar-width: none;
    }
    .hp-trending-grid::-webkit-scrollbar { display: none; }
    .hp-tcard--big {
        flex: 0 0 82vw; height: 210px;
        grid-row: unset; grid-column: unset; scroll-snap-align: start;
    }
    .hp-tcard--sm {
        flex: 0 0 40vw; height: 190px;
        grid-row: unset; grid-column: unset; scroll-snap-align: start;
    }
    .hp-new-grid { grid-template-columns: repeat(2,1fr); }
    .hp-updates-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   DARK MODE — forcer backgrounds que Madara pourrait écraser
   ================================================================ */
body.text-ui-light .hp-rank-item,
body.text-ui-light .hp-upd-item {
    background: #111118 !important;
    border-color: rgba(255,255,255,.07) !important;
    color: #e4e4f0 !important;
}
body.text-ui-light .hp-rank-item:hover,
body.text-ui-light .hp-upd-item:hover {
    background: #1a1a24 !important;
}

/* Double bloc + sections en dark */
body.text-ui-light .hp-root {
    background: #0a0a0f !important;
}

/* ================================================================
   TOP RATED
   ================================================================ */
.hp-toprated { margin-top: 1rem; }
.hp-toprated__item {
    display: flex; align-items: center; gap: .75rem;
    padding: .5rem .6rem; border-radius: var(--hp-radius);
    background: var(--hp-surface); border: 1px solid var(--hp-border);
    margin-bottom: 6px; transition: background .2s;
}
.hp-toprated__item:hover { background: var(--hp-surface2); }
.hp-toprated__thumb {
    position: relative; flex-shrink: 0;
    width: 42px; height: 58px;
    border-radius: 4px; overflow: hidden; display: block;
}
.hp-toprated__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hp-toprated__score {
    position: absolute; bottom: 2px; left: 0; right: 0;
    text-align: center; font-size: .55rem; font-weight: 800;
    color: #f4c542; background: rgba(0,0,0,.65);
    padding: 1px 0; line-height: 1.4;
}
.hp-toprated__body { flex: 1; min-width: 0; }
.hp-toprated__title {
    display: block; font-size: .8rem; font-weight: 700;
    color: var(--hp-text); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-bottom: .18rem;
}
.hp-toprated__title:hover { color: var(--hp-accent); }
.hp-toprated__genre { font-size: .63rem; color: var(--hp-muted); display: block; margin-bottom: .15rem; }
.hp-toprated__ch { font-size: .62rem; color: var(--hp-muted); }

/* Dark mode top rated */
body.text-ui-light .hp-toprated__item {
    background: #111118 !important;
    border-color: rgba(255,255,255,.07) !important;
}
body.text-ui-light .hp-toprated__item:hover { background: #1a1a24 !important; }
