/* Socle : couleurs, barre d'onglets, boutons, grille de reels, lecteur. */
:root {
  --encre: #1b100a;
  --encre-2: #2b1a12;
  --brun: #7a5a48;
  --creme: #fff8ee;
  --sable: #fae1c4;
  --carte: #fffaf1;
  --orange: #ee6c14;
  --orange-texte: #b93d08;
  --jaune: #ffc233;
  --rose: #ff3d77;
  --violet: #7a3cff;
  --trait: rgba(43, 26, 18, 0.16);
  --anneau: linear-gradient(45deg, var(--jaune), var(--orange) 40%, var(--rose) 72%, var(--violet));
  --titre: "Arial Rounded MT Bold", ui-rounded, "Nunito", "Segoe UI", system-ui, sans-serif;
  --texte: "Segoe UI", system-ui, -apple-system, sans-serif;
  --hauteur-barre: 58px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--encre); font: 17px/1.6 var(--texte); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
h1, h2, h3 { font-family: var(--titre); line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

code { font: 0.88em/1.4 Consolas, "Cascadia Mono", monospace; background: rgba(43, 26, 18, 0.08); padding: 0.12em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }

.evitement { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--jaune); padding: 8px 14px; border-radius: 999px; }
.evitement:focus { left: 8px; }

/* ---------- barre d'onglets ---------- */
.barre { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: var(--hauteur-barre); padding: 0 18px; background: rgba(27, 16, 10, 0.9); backdrop-filter: blur(12px); color: var(--creme); }
.marque { flex: none; font: 700 19px var(--titre); text-decoration: none; background: var(--creme); color: var(--encre); padding: 5px 14px; border-radius: 999px; }
.marque b { color: var(--orange-texte); font-weight: 700; }
.onglets { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; padding: 6px 0; }
.onglets::-webkit-scrollbar { display: none; }
.onglets a { flex: none; text-decoration: none; font-size: 15px; font-weight: 600; padding: 7px 13px; border-radius: 999px; color: rgba(255, 248, 238, 0.74); transition: background 0.15s, color 0.15s; }
.onglets a:hover { color: var(--creme); background: rgba(255, 248, 238, 0.1); }
.onglets a[aria-current="page"] { color: var(--encre); background: var(--jaune); }

/* ---------- langues ---------- */
/* Posée par js/langues/noyau.js, retirée par js/langues/page.js : la page n'apparaît qu'une fois traduite. */
html.traduction-en-attente body { visibility: hidden; }
.visuel-cache { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.langue { flex: none; display: flex; align-items: center; }
.langue select { max-width: 150px; padding: 6px 10px; border: 1.5px solid rgba(255, 248, 238, 0.3); border-radius: 999px; background: rgba(255, 248, 238, 0.1); color: var(--creme); font-size: 14px; font-weight: 600; cursor: pointer; }
.langue select:hover { border-color: var(--jaune); }
.langue option { background: #fff; color: var(--encre); }
.avis-langue { background: var(--jaune); color: var(--encre); text-align: center; font-size: 14.5px; font-weight: 600; padding: 9px 18px; }

/* ---------- mise en page commune ---------- */
.page { width: min(1120px, 100% - 36px); margin-inline: auto; }
.page.etroite { width: min(760px, 100% - 36px); }
.sur-titre { font: 700 13px var(--texte); letter-spacing: 0.14em; text-transform: uppercase; color: var(--orange-texte); margin-bottom: 10px; }
.bouton { display: inline-flex; align-items: center; gap: 8px; font: 700 16px var(--titre); text-decoration: none; padding: 12px 22px; border-radius: 999px; border: 2px solid currentColor; background: transparent; transition: transform 0.15s, background 0.15s; }
.bouton:hover { transform: translateY(-2px); }
.bouton.plein { background: var(--orange); border-color: var(--orange); color: #fff; }
.bouton.plein:hover { background: var(--orange-texte); border-color: var(--orange-texte); }
.bouton.clair { color: var(--creme); }
.bouton.petit { font-size: 13.5px; padding: 6px 13px; border-width: 1.5px; }

.commande { display: flex; align-items: center; gap: 8px; background: var(--encre); color: #ffe6c2; border-radius: 12px; padding: 7px 7px 7px 14px; margin: 8px 0; }
.commande { min-width: 0; }
.commande code { flex: 1; min-width: 0; background: none; padding: 4px 0; color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.copier { flex: none; border: 0; border-radius: 8px; background: rgba(255, 230, 194, 0.16); color: #ffe6c2; font-size: 13px; font-weight: 600; padding: 5px 11px; }
.copier:hover { background: var(--jaune); color: var(--encre); }

/* ---------- filtres ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; }
.filtre { border: 1.5px solid var(--trait); background: transparent; border-radius: 999px; padding: 7px 15px; font-size: 14.5px; font-weight: 600; transition: background 0.15s, color 0.15s; }
.filtre:hover { border-color: var(--encre); }
.filtre[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--creme); }
.filtre small { opacity: 0.6; font-weight: 500; margin-left: 4px; }
.barre-outils { display: flex; flex-wrap: wrap; align-items: end; gap: 14px 20px; margin: 28px 0 10px; }
.barre-outils .filtres { flex: 1 1 420px; }
.champ { display: grid; gap: 4px; font-size: 13px; font-weight: 700; color: var(--brun); }
.champ select, .champ input { min-width: 190px; padding: 8px 12px; border: 1.5px solid var(--trait); border-radius: 12px; background: #fff; font-size: 15px; font-weight: 400; color: var(--encre); }
.compte { font-size: 14px; color: var(--brun); margin: 8px 0 14px; }

/* ---------- grille de reels ---------- */
.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.grille.large { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tuile { position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--encre-2); color: #fff; text-align: left; isolation: isolate; }
.grille.large .tuile, .rail .tuile { border-radius: 16px; }
.tuile img, .tuile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tuile img { transition: transform 0.4s ease; }
.tuile:hover img, .tuile:focus-visible img { transform: scale(1.04); }
.tuile video { z-index: 1; opacity: 0; transition: opacity 0.25s; }
.tuile video.visible { opacity: 1; }
.tuile-voile { position: absolute; inset: auto 0 0 0; height: 55%; z-index: 2; background: linear-gradient(180deg, transparent, rgba(12, 7, 4, 0.86)); pointer-events: none; }
.tuile-titre { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 3; font: 600 13.5px/1.25 var(--texte); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.tuile-duree, .tuile-langue { position: absolute; top: 8px; z-index: 3; font: 700 11.5px var(--texte); padding: 3px 8px; border-radius: 999px; background: rgba(12, 7, 4, 0.66); backdrop-filter: blur(6px); }
.tuile-duree { right: 8px; }
.tuile-langue { left: 8px; background: var(--jaune); color: var(--encre); }

/* ---------- lecteur (reels et images) ---------- */
.lecteur { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 22px; border: 0; background: rgba(12, 7, 4, 0.95); color: var(--creme); }
.lecteur[open] { display: grid; grid-template-columns: 56px minmax(0, auto) minmax(260px, 370px) 56px; justify-content: center; align-items: center; gap: 20px; }
.lecteur::backdrop { background: rgba(12, 7, 4, 0.7); }
.lecteur-scene { display: grid; place-items: center; min-width: 0; }
.lecteur-scene video { height: min(88dvh, 920px); max-width: min(100%, 62vw); border-radius: 20px; background: #000; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.lecteur-scene video.horizontal { height: auto; max-height: 88dvh; width: min(62vw, 1100px); }
.lecteur-scene img { max-height: 88dvh; max-width: min(100%, 62vw); border-radius: 14px; background: #fff; object-fit: contain; }
.lecteur-fiche { align-self: center; min-width: 0; max-height: 88dvh; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.lecteur-fiche h2 { font-size: clamp(22px, 2.4vw, 30px); }
.lecteur-fiche p { color: rgba(255, 248, 238, 0.82); font-size: 15.5px; }
.lecteur-fiche code { background: rgba(255, 248, 238, 0.12); }
.lecteur-fiche .commande { align-items: flex-start; background: rgba(255, 248, 238, 0.08); }
.lecteur-fiche .commande code { background: none; white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; }
.lecteur-fiche .bouton.petit { margin: 0 6px 6px 0; }
.lecteur-rang { font: 700 12.5px var(--texte); letter-spacing: 0.12em; text-transform: uppercase; color: var(--jaune); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; }
.puces li { font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: rgba(255, 248, 238, 0.12); }
.puces li.alerte { background: var(--orange); color: #fff; }
.lecteur-detail { display: grid; gap: 3px; font-size: 14px; }
.lecteur-detail b { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 248, 238, 0.56); }
.lecteur-fermer, .lecteur-fleche { border: 0; border-radius: 50%; width: 52px; height: 52px; background: rgba(255, 248, 238, 0.12); color: var(--creme); font-size: 30px; line-height: 1; display: grid; place-items: center; }
.lecteur-fermer:hover, .lecteur-fleche:hover { background: var(--jaune); color: var(--encre); }
.lecteur-fermer { position: absolute; top: 16px; right: 16px; z-index: 2; }
.lecteur-fleche[disabled] { opacity: 0.25; cursor: default; }

.pied { background: var(--encre); color: rgba(255, 248, 238, 0.7); text-align: center; padding: 44px 18px 56px; font-size: 14.5px; display: grid; gap: 14px; justify-items: center; }

@media (min-width: 760px) {
  .grille:not(.large) { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}
/* Téléphone : la marque et le menu des langues sur une ligne, les onglets défilants dessous. */
@media (max-width: 640px) {
  :root { --hauteur-barre: 92px; }
  .barre { flex-wrap: wrap; align-content: center; gap: 0 12px; padding: 6px 14px 0; }
  .onglets { order: 3; flex: 1 0 100%; }
  .langue { margin-inline-start: auto; }
}
@media (max-width: 820px) {
  .lecteur { padding: 12px 12px 18px; }
  .lecteur[open] { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); align-items: start; gap: 12px; }
  .lecteur-scene video { height: auto; max-height: 60dvh; max-width: 100%; }
  .lecteur-scene img { max-height: 56dvh; max-width: 100%; }
  .lecteur-fiche { max-height: none; align-self: start; padding-bottom: 70px; }
  .lecteur-fleche { position: fixed; bottom: 14px; z-index: 2; background: rgba(27, 16, 10, 0.9); }
  .lecteur-fleche.avant { left: 14px; }
  .lecteur-fleche.apres { right: 14px; }
  .lecteur-fermer { width: 44px; height: 44px; top: 10px; right: 10px; background: rgba(27, 16, 10, 0.8); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
