/* ═══════════════════════════════════════════════════════════════
   StreamVault — Catalogue public
   Reprend la direction artistique d'index.php : mêmes cartes, mêmes
   pilules, même halo. Deux différences assumées :
     · les affiches passent en 2/3, leur ratio natif chez TMDB
       (elles étaient écrasées à 172 px de haut en object-fit:cover)
     · le rendu est paginé côté serveur — l'ancienne page injectait
       l'intégralité du catalogue en JSON à chaque chargement
   ═══════════════════════════════════════════════════════════════ */

/* ── En-tête ──────────────────────────────────────────────── */
header.site { position: relative; z-index: 10; padding: 44px 24px 26px;
              text-align: center; border-bottom: 1px solid var(--border); }
.brand      { font-family: var(--ff-d); font-size: clamp(52px, 9vw, 100px);
              letter-spacing: .04em; line-height: 1; color: #fff;
              text-shadow: 0 0 80px rgba(232, 16, 42, .35); text-decoration: none; display: block; }
.brand span { color: var(--red); }
.tagline    { margin-top: 6px; color: var(--muted); font-size: 12px;
              letter-spacing: .18em; text-transform: uppercase; font-weight: 500; }

.stats-row  { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.pill       { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-pill);
              padding: 7px 18px; display: inline-flex; align-items: center; gap: 8px;
              font-size: 12px; color: var(--muted); }
.pill strong { font-family: var(--ff-d); font-size: 20px; color: #fff; line-height: 1; letter-spacing: .03em; }

.header-nav  { position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; }
.header-nav a { background: var(--red); border-radius: var(--r-sm); padding: 8px 16px;
                color: #fff; font-size: 12px; font-weight: 600; text-decoration: none;
                box-shadow: 0 2px 8px rgba(232, 16, 42, .2); transition: all .2s; }
.header-nav a:hover { box-shadow: 0 4px 16px rgba(232, 16, 42, .4); transform: translateY(-1px); }

/* ── Recherche et onglets ─────────────────────────────────── */
.search-wrap  { position: relative; z-index: 10; max-width: 520px; margin: 24px auto 0; padding: 0 16px; }
.search-input { width: 100%; background: var(--bg3); border: 1.5px solid var(--border);
                border-radius: 12px; padding: 13px 18px 13px 46px; color: var(--text);
                font-family: var(--ff-b); font-size: 14px; outline: none; transition: border-color .2s; }
.search-input:focus { border-color: var(--red); }
.search-input::placeholder { color: var(--muted2); }
.search-wrap svg { position: absolute; left: 30px; top: 50%; transform: translateY(-50%);
                   color: var(--muted); pointer-events: none; }

.tabs   { position: relative; z-index: 10; display: flex; justify-content: center;
          gap: 6px; padding: 22px 16px 0; flex-wrap: wrap; }
.tab    { background: var(--card); border: 1.5px solid var(--border); border-radius: var(--r-pill);
          padding: 9px 22px; color: var(--muted); font-size: 13px; font-weight: 500;
          text-decoration: none; display: inline-flex; align-items: center; gap: 7px; transition: all .2s; }
.tab:hover  { border-color: var(--red-line); color: var(--text); }
.tab.active { background: var(--red); border-color: var(--red); color: #fff; }
.tab-badge  { background: rgba(0, 0, 0, .3); border-radius: var(--r-pill); padding: 2px 7px;
              font-size: 10px; font-weight: 600; }
.tab.active .tab-badge { background: rgba(255, 255, 255, .2); }

/* ── Grille ───────────────────────────────────────────────── */
.content { position: relative; z-index: 5; max-width: 1400px; margin: 0 auto; padding: 28px 14px 80px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
@media (max-width: 580px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
@media (max-width: 340px) { .grid { grid-template-columns: 1fr; } }

.item { background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
        overflow: hidden; text-decoration: none; color: inherit; display: block;
        transition: border-color .2s, transform .15s, box-shadow .2s;
        animation: fadeUp .35s ease both; }
.item:hover { border-color: rgba(232, 16, 42, .5); transform: translateY(-4px);
              box-shadow: 0 8px 24px rgba(232, 16, 42, .12); }

/* Ratio natif des affiches TMDB. L'ancienne grille les rognait à
   172 px de haut : les visages passaient à la trappe. */
.item-poster { position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: var(--bg3); }
.item-poster img { width: 100%; height: 100%; object-fit: cover; display: block;
                   opacity: 0; transition: opacity .4s, transform .35s; }
.item-poster img.loaded { opacity: 1; }
.item:hover .item-poster img { transform: scale(1.05); }
.item-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
           font-family: var(--ff-d); font-size: 44px; color: rgba(255, 255, 255, .09);
           background: linear-gradient(145deg, #1c1c1c, #0e0e0e); }
.item-ov { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 45%); }

.item-badge { position: absolute; top: 8px; right: 8px; background: var(--red);
              border-radius: var(--r-pill); padding: 3px 9px; font-size: 10px;
              font-weight: 700; color: #fff; letter-spacing: .04em; }

.item-body { padding: 10px 12px 12px; }
.item-title { font-size: 13px; font-weight: 500; line-height: 1.3;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item:hover .item-title { color: var(--red); }
.item-meta  { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.mt { font-size: 9px; padding: 2px 6px; border-radius: 4px; background: var(--bg3);
      color: var(--muted); border: 1px solid var(--border); }
.mt.hd  { color: var(--blue);   border-color: rgba(96,165,250,.2);  background: rgba(96,165,250,.07); }
.mt.uhd { color: var(--purple); border-color: rgba(167,139,250,.2); background: rgba(167,139,250,.07); }
.mt.r   { color: var(--red);    border-color: var(--red-line);      background: var(--red-soft); }

/* ── Fiche ────────────────────────────────────────────────── */
.hero { position: relative; margin-bottom: 28px; border-radius: var(--r); overflow: hidden;
        border: 1px solid var(--border); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center top;
           opacity: .3; }
.hero-bg::after { content: ''; position: absolute; inset: 0;
                  background: linear-gradient(to top, var(--bg) 5%, rgba(9,9,9,.6) 55%, rgba(9,9,9,.25) 100%); }
.hero-in { position: relative; display: grid; grid-template-columns: 190px 1fr; gap: 26px;
           padding: 28px; align-items: end; }
@media (max-width: 680px) { .hero-in { grid-template-columns: 1fr; padding: 20px; } }
.hero-poster { width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: var(--r-sm);
               border: 1px solid var(--border2); box-shadow: 0 10px 40px rgba(0,0,0,.6); }
.hero h1 { font-family: var(--ff-d); font-size: clamp(34px, 6vw, 58px); letter-spacing: .03em; line-height: 1; }
.hero .sub { color: var(--muted); font-size: 13px; margin-top: 8px; }
.hero .overview { color: var(--text); font-size: 14px; line-height: 1.65; margin-top: 14px; max-width: 70ch; opacity: .85; }

.season-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
                padding: 18px 20px; margin-bottom: 12px; }
.season-title { font-family: var(--ff-d); font-size: 17px; letter-spacing: .1em; color: var(--red);
                margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.season-title::after { content: ''; flex: 1; height: 1px; background: var(--red-line); }
.eps { display: flex; flex-wrap: wrap; gap: 6px; }
.ep  { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 34px;
       padding: 0 10px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r-sm);
       color: var(--muted); font-family: var(--ff-d); font-size: 16px; letter-spacing: .04em;
       text-decoration: none; transition: all .15s; }
.ep:hover { background: var(--red); border-color: var(--red); color: #fff; transform: scale(1.08); }

.src-list { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 6px 20px; }
.src { display: flex; align-items: center; gap: 10px; padding: 12px 0;
       border-bottom: 1px solid var(--border); text-decoration: none; color: inherit; }
.src:last-child { border-bottom: none; }
.src:hover .src-name { color: var(--red); }
.src-name { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-date { color: var(--muted2); font-size: 11px; white-space: nowrap; }

/* ── Divers ───────────────────────────────────────────────── */
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 32px; }
.pager a, .pager span { background: var(--card); border: 1.5px solid var(--border);
                        border-radius: var(--r-pill); padding: 9px 20px; color: var(--muted);
                        font-size: 13px; text-decoration: none; transition: all .2s; }
.pager a:hover { border-color: var(--red-line); color: var(--text); }
.pager .cur { color: var(--muted2); border-color: transparent; background: none; }

.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
        text-decoration: none; font-size: 13px; margin-bottom: 18px; transition: color .2s; }
.back:hover { color: var(--red); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
