/* ═══════════════════════════════════════════════════════════════════════
   STREAMLOG : vitrines (STL_Rails, bloc stl/rails, haut des rubriques)

   Même matière que les fiches (.stl-f) : blanc et noir, filets de 1 px,
   capitales espacées, Inter 500 à 900. Le seul rouge : « aujourd'hui ».

     .stl-rails
       .stl-rail            une rangée
         .stl-rail-head     titre, phrase, « Tout voir », flèches
         .stl-rail-track    la bande qui défile (scroll-snap)
           .stl-rail-card   une affiche + trois lignes
   ═══════════════════════════════════════════════════════════════════════ */

.stl-rails {
  /* Jetons des fiches (fiche.css), redéclarés : la vitrine doit tenir
     seule, dans l'éditeur comme dans une page sans fiche. */
  --f-ink:   var(--ink, #0a0a0a);
  --f-paper: var(--paper, #fff);
  --f-tx:    var(--tx, #0a0a0a);
  --f-bg:    var(--bg, #fff);
  --f-mt:    var(--mt, #6b6b6b);
  --f-surf:  var(--surf, #f3f3f3);
  --f-red:   var(--wf-red, #d23c0f);
  --f-line:  1px solid var(--f-tx);
  --f-font:  var(--sans, 'Inter', 'Helvetica Neue', Arial, sans-serif);
  --r-w: clamp(132px, 10vw + 40px, 184px);   /* largeur d'une affiche */
  font-family: var(--f-font);
  color: var(--f-tx);
  --r-gap: clamp(12px, 1.4vw, 20px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(30px, 4vw, 52px);
  min-width: 0;
  background: transparent;
}
.stl-rails [hidden] { display: none !important; }
.stl-rails *, .stl-rails *::before, .stl-rails *::after { box-sizing: border-box; }
.stl-rails :where(h2, h3, p, ol, ul) { margin: 0; }
.stl-rails img { display: block; max-width: 100%; }
/* Dans un article, le thème souligne les liens : pas sur les affiches. */
.stl-rails a { text-decoration: none; color: inherit; }
.stl-rails :where(a):hover { background: transparent; color: inherit; }
.stl-rails :is(.stl-rail-card) { border-bottom: 0; }
.stl-rails :is(.stl-rail-more) { border-bottom: var(--f-line); }
.stl-rail { min-width: 0; }

/* ── Tête de rangée ─────────────────────────────────────────────────── */
.stl-rail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: var(--f-line);
}
.stl-rail-titles { min-width: 0; }
.stl-rails .stl-rail-title {
  margin: 0;
  font-size: clamp(22px, 1rem + 1.4vw, 34px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.stl-rails .stl-rail-desc {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--f-mt);
}
.stl-rail-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.stl-rail-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: var(--f-line);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.stl-rail-more:hover,
.stl-rail-more:focus-visible { background: var(--f-ink); color: var(--f-paper); outline: none; }
.stl-rail-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: var(--f-line);
  background: var(--f-bg);
  color: var(--f-tx);
  font: 400 18px/1 var(--f-font);
  cursor: pointer;
  transition: background .12s, color .12s, opacity .12s;
}
.stl-rail-arrow:hover:not(:disabled),
.stl-rail-arrow:focus-visible { background: var(--f-ink); color: var(--f-paper); outline: none; }
.stl-rail-arrow:disabled { opacity: .3; cursor: default; }

/* ── La bande ───────────────────────────────────────────────────────── */
.stl-rails .stl-rail-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--r-w);
  gap: var(--r-gap);
  margin: 0;
  padding: 2px 2px 10px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--f-tx) transparent;
}
.stl-rail-track::-webkit-scrollbar { height: 4px; }
.stl-rail-track::-webkit-scrollbar-thumb { background: var(--f-tx); }
.stl-rail-item { scroll-snap-align: start; min-width: 0; }

/* ── Une carte ──────────────────────────────────────────────────────── */
.stl-rail-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.stl-rail-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: var(--f-line);
  background: var(--f-surf);
}
.stl-rail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, filter .2s;
}
.stl-rail-card:hover .stl-rail-poster img,
.stl-rail-card:focus-visible .stl-rail-poster img { transform: scale(1.04); }
.stl-rail-card:focus-visible { outline: 2px solid var(--f-tx); outline-offset: 3px; }
.stl-rail-initial {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 56px;
  font-weight: 900;
  color: var(--f-mt);
}
.stl-rail-pill {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 5px 7px;
  background: var(--f-ink);
  color: var(--f-paper);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stl-rail-text { display: grid; gap: 4px; min-width: 0; }
.stl-rail-when {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--f-mt);
}
.stl-rail-when.is-today { color: var(--f-tx); }
.stl-rail-when.is-today::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  background: var(--f-red);
}
.stl-rail-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stl-rail-card:hover .stl-rail-name { text-decoration: underline; text-underline-offset: 3px; }
.stl-rail-line {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--f-mt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Classement : le numéro à côté de l'affiche ─────────────────────── */
.stl-rail--top .stl-rail-track { grid-auto-columns: calc(var(--r-w) * 1.32); }
.stl-rail-card.has-rank {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 0;
  row-gap: 10px;
}
.stl-rail-card.has-rank .stl-rail-poster { grid-column: 2; grid-row: 1; }
.stl-rail-card.has-rank .stl-rail-text { grid-column: 1 / -1; grid-row: 2; }
.stl-rail-rank {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  margin-right: -10px;
  font-size: calc(var(--r-w) * .62);
  font-weight: 900;
  line-height: .78;
  letter-spacing: -.08em;
  color: var(--f-bg);
  -webkit-text-stroke: 2px var(--f-tx);
  paint-order: stroke fill;
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
}

/* ── Rubrique (haut d'une catégorie du thème) ───────────────────────── */
.stl-rails--hub { padding: clamp(26px, 4vw, 48px) 0 0; }

/* ── Petits écrans ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .stl-rails { --r-w: 128px; }
  .stl-rail-head { align-items: flex-end; gap: 10px; margin-bottom: 12px; }
  .stl-rail-arrow { display: none; }
  .stl-rail-more { min-height: 32px; padding: 0 10px; font-size: 10.5px; }
  .stl-rail-pill { white-space: normal; line-height: 1.15; }
  .stl-rails .stl-rail-desc { font-size: 13px; }
  .stl-rail-name { font-size: 14px; }
  /* La bande touche le bord de l'écran : on voit qu'elle continue. */
  .stl-rails--hub .stl-rail-track { margin-right: calc(-1 * var(--pad, 16px)); padding-right: var(--pad, 16px); }
}
@media (prefers-reduced-motion: reduce) {
  .stl-rail-poster img { transition: none; }
}
