/*
 * themes/hippique.home.css — Variante homepage du thème hippique
 * Layer : modules (scopes .th-home / .th-hero / .th-prg / .th-side)
 * Role : bloc central maquette juin 2026 — onglets dossier, hero Quinté vert
 *        profond + photo en diagonale, barres réunions rouge/verte avec
 *        accordéon, sidebar (Top Pronostics + carte promo TRITURF).
 *        Chargé uniquement quand le thème hippique est actif (css_extra),
 *        avec views/themes/hippique/home*.php.
 *
 * MOBILE-FIRST : base = mobile (UX application : photo en bandeau, gros taps,
 * onglets segmentés pleine largeur) ; desktop via @media (min-width: 901px).
 */

/* Police du thème : Pretendard (choix Xavier 2026-06-11 — fonte VARIABLE,
   licence SIL OFL, LICENSE.txt à côté des woff2). Sous-ensemble latin +
   latin-ext généré depuis PretendardVariable.ttf (le fichier complet fait
   6,7 Mo avec le coréen → 56/85 Ko en web). Auto-hébergée, chargée
   uniquement quand le thème est actif (ce fichier est en css_extra).
   Hors de @layer : @font-face est une déclaration de ressource. */
/* ESSAI EN COURS — ARIMO (Xavier, 02/09/2026), la police RÉFÉRENCÉE par le
   token. Arimo est le jumeau libre d'Arial : mêmes largeurs de lettres au
   dixième de pixel (190,8 px pour « RED HOT ROADSTER » en 17 px gras, mesuré
   contre l'Arial du système). Avant le 31/08 le site rendait avec Helvetica,
   qui a ces mêmes largeurs : Arimo rend donc exactement le confort d'avant —
   cette fois identique sur Mac, Windows, Android et iPhone, puisqu'elle est
   envoyée avec la page. 19 Ko en latin (le latin-ext, 94 Ko, n'est téléchargé
   que si un caractère de sa plage apparaît — jamais en français).
   Licence SIL OFL. Plages de caractères standard, identiques aux deux autres.

   TROIS POLICES SONT DÉCLARÉES ICI, une seule est utilisée : celle que nomme
   --font-family-sans dans themes/hippique.css. Un @font-face non référencé ne
   télécharge rien. C'est volontaire le temps de l'essai — quand Xavier aura
   tranché, retirer les deux perdantes (blocs, woff2, et le preload de
   partials/header.php). */
@font-face {
  font-family: 'Arimo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/arimo/arimo-vf-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Arimo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/arimo/arimo-vf-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ESSAI EN COURS — ARCHIVO (Xavier, 02/09/2026). Pretendard rendait le même
   texte 6 % plus étroit que le repli d'avant (178,6 px contre 190,8 px pour
   « RED HOT ROADSTER » en 17 px gras), à hauteur de x identique : des lettres
   serrées à hauteur égale, donc un texte qui paraît plus lourd. Archivo rend
   ce mot à 190 px — la respiration d'avant — avec un dessin de grotesque de
   signalétique, la même famille que le DIN de L'Équipe. Licence SIL OFL,
   auto-hébergée, 34 + 31 Ko.

   Les @font-face de Pretendard RESTENT juste en dessous : un @font-face non
   référencé ne télécharge rien, et l'essai se défait en remettant une seule
   ligne — le token de themes/hippique.css. Si Archivo est validée, retirer
   Pretendard (ces deux blocs, les woff2 et le preload de partials/header.php).
   Plages de caractères identiques à celles de Pretendard : même découpage
   latin / latin-ext. */
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/archivo/archivo-vf-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/archivo/archivo-vf-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/pretendard/pretendard-vf-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Pretendard';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/pretendard/pretendard-vf-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@layer modules {

  .th-home {
    /* variables locales du bloc (teintes maquette) */
    --thh-deep: #0c3320;            /* vert très profond (hero, têtes) */
    --thh-deep-2: #14663c;          /* vert hero clair (fin de dégradé) */
    --thh-badge: #1f8f55;           /* pill "Quinté+ du jour" */
    --thh-bar-green: #17804a;       /* barre réunion standard */
    --thh-bar-red: var(--color-danger);
    --thh-pick5: #ffc235;           /* jaune orangé CTA homepage */
    --thh-amount: #71e2a4;          /* montants Ordre/Désordre sur fond sombre */
    --thh-ink: #14233b;             /* titres sur fond clair */
    --thh-box: #0f4d2c;             /* panneau PLEIN « Arrivée officielle » */
    --thh-box-deep: #0b4124;        /* panneaux PLEINS Ordre / Désordre */
    --thh-m-gutter: 5px;            /* téléphone : marge gauche/droite des blocs (carte Quinté ET blocs réunion) — Xavier 11/09/2026 : 8 → 5 px */
    /* LA POLICE N'EST PLUS POSÉE ICI (31/08/2026). Elle l'était, et sur ce
       sélecteur-là uniquement : `.th-home`, c'est-à-dire l'accueil. Le reste
       du site restait donc en SF Pro Text, et aucun bloc partagé ne se
       ressemblait d'une page à l'autre. Elle est passée en token de thème
       (--font-family-sans dans themes/hippique.css), appliqué au body sur
       toutes les pages où le thème est actif. L'accueil hérite comme les
       autres. La règle `font-family: inherit` ci-dessous reste indispensable :
       les contrôles de formulaire n'héritent pas de la police par défaut. */
  }

  .th-home button,
  .th-home input,
  .th-home select,
  .th-home textarea {
    font-family: inherit;
  }

  /* ════════════════════════════════════════════════════════════
   *  BANDEAU H1 SEO — titre éditorial stable au-dessus des onglets.
   *  Le hero Quinté (« Prix Eva ») reste un H2 : un seul H1 par page.
   *  Mobile-first ; icône cheval en pastille verte (tokens --thh-*).
   * ════════════════════════════════════════════════════════════ */
  .th-home-intro {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    /* Mobile : la marge du <main> est à 0 (le bloc colle au header, cf.
       @media 979px plus bas) → l'espace AU-DESSUS du H1 = padding-top (8px)
       seul. On annule l'écart de grille .home-main (16px) SOUS la bannière
       pour retrouver la MÊME marge en dessous (padding-bottom 8px). Desktop
       repasse à -8px (@media min-width:901px). */
    margin-bottom: calc(var(--space-4) * -1);
  }
  .th-home-intro-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Mobile : la pastille épouse la hauteur du bloc titre (le sous-titre
       est masqué en dessous) → carré de la même taille que le H1, quel que
       soit le nombre de lignes (align-self:stretch fixe la hauteur, aspect-
       ratio la rend carrée). Desktop rétablit 46px centrés (@media 901px). */
    align-self: stretch;
    width: auto;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    color: var(--thh-deep);
    /* cadre conservé, fond transparent (pas de remplissage gris) */
    background: transparent;
    border: 1.5px solid var(--line, #dce3ec);
  }
  .th-home-intro-icon svg {
    width: 26px;
    height: 26px;
  }
  .th-home-intro-title {
    margin: 0;
    color: var(--thh-ink);
    font-size: clamp(15px, 3vw, 20px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: 0;
  }
  .th-home-intro-sub {
    /* Mobile : bannière réduite au seul H1 (demande Xavier). Le sous-titre
       reste affiché sur desktop (SEO) — cf. @media (min-width: 901px). */
    display: none;
    margin: 3px 0 0;
    color: var(--muted, #5f6d82);
    font-size: clamp(12px, 2.6vw, 14px);
    line-height: 1.35;
  }

  @media (min-width: 901px) {
    /* Marge header ↔ bannière réduite de moitié (16 → 8px). Porté par le
       thème : @layer modules prime sur @layer legacy (app.css ET la règle
       pub .mobile-ad-wrap-top), donc valeur stable, sans marge négative en
       haut → zéro risque de chevauchement sur le header. */
    .layout-homepage {
      margin-top: var(--space-2);
    }
    .th-home-intro {
      gap: var(--space-3, 14px);
      /* Marges verticales du H1 divisées par 2 (demande Xavier) :
         padding 12/8 → 6/4. La marge négative en bas ramène l'écart de
         grille .home-main (16px, partagé avec les autres blocs) à 8px pour
         CETTE seule bannière, sans resserrer le reste de la page. */
      padding: calc(var(--space-3) / 2) 0 var(--space-1);
      margin-bottom: calc(var(--space-2) * -1);
    }
    .th-home-intro-sub {
      display: block; /* sous-titre conservé sur desktop (SEO) */
    }
    .th-home-intro-icon {
      align-self: center; /* annule le stretch mobile → 46px centrés */
      width: 46px;
      height: 46px;
      border-radius: 6px;
    }
    .th-home-intro-icon svg {
      width: 30px;
      height: 30px;
    }
  }

  /* ════════════════════════════════════════════════════════════
   *  PANNEAU central — mobile : full-bleed bord à bord (effet app),
   *  la carte blanche disparaît au profit du contenu pleine largeur
   *  (le container global laisse 12px de gouttière de chaque côté).
   * ════════════════════════════════════════════════════════════ */
  .th-home .home-panel {
    /* mobile : le .container legacy est PLEINE LARGEUR (≤979px, app.css) —
       aucune marge négative (cause du pan latéral iOS). Le bloc Quinté touche
       les bords (Xavier 2026-06-10) ; la respiration est portée par les
       paddings INTERNES (contenu hero 20px, onglets, listes) */
    margin-inline: 0;
    padding: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    /* la carte legacy est une grille gap:14px → collerait un liseré blanc
       entre les onglets et le hero (effet dossier cassé) */
    gap: 0;
  }

  /* ════════════════════════════════════════════════════════════
   *  ONGLETS Hier / Aujourd'hui / Demain — style dossier
   * ════════════════════════════════════════════════════════════ */
  .th-home .home-day-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 6px;
    margin: 0;
    /* Mobile : padding-top à 0 pour que l'espace SOUS le H1 (H1 → onglets)
       égale l'espace AU-DESSUS (H1 → header). Les marges grises étaient déjà
       symétriques (24/24) ; c'est ce padding-top qui décalait le bas. Onglets
       ras le haut de la carte, comme sur desktop (@media 901px = padding:0). */
    padding: 0 var(--space-3);
    border-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .th-home .home-day-tabs::-webkit-scrollbar {
    display: none;
  }

  .th-home .home-day-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 11px 22px;
    border-radius: 6px 6px 0 0;
    background: #f2f4f3;
    border: 1px solid #e4e9e5;
    border-bottom: 0;
    color: var(--thh-ink);
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-sm);
    text-align: center;
  }

  /* l'onglet ouvert, collé au bloc Quinté : du même vert que lui, sur
     ordinateur comme sur téléphone (Xavier 2026-10-28). Retour arrière :
     #1a6240 */
  .th-home .home-day-tab.is-active {
    background: #1b764f;
    border-color: #1b764f;
    color: var(--color-text-inverse);
  }

  /* neutralise le souligné rouge du design par défaut */
  .th-home .home-day-tab.is-active::after {
    display: none;
    content: none;
  }

  /* ════════════════════════════════════════════════════════════
   *  HERO Quinté — panneau vert profond + photo
   * ════════════════════════════════════════════════════════════ */
  .th-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    /* mobile full-bleed : pas d'arrondi, le hero touche les bords */
    border-radius: 0;
    overflow: hidden;
    /* le vert foncé du haut de la page, plein (Xavier 2026-10-28) ; ne joue
       que sur ordinateur, le mobile pose son propre fond (≤ 900 px). Retour
       arrière : linear-gradient(135deg, #1a6240 0%, #11502d 60%, #0d4128 100%) */
    background: #1b764f;
    color: var(--color-text-inverse);
  }

  /* Mobile : PAS de photo dans le bloc Quinté (Xavier 2026-06-10) —
     elle revient en desktop (découpe en arc) */
  .th-hero-media {
    display: none;
    order: -1;
    height: 170px;
    background: var(--thh-deep);
  }

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

  /* le <svg> porteur des clipPaths est en 0x0 mais créerait quand même une
     ligne de ~15px dans le flux (inline) → hors flux, invisible */
  .th-hero-media > svg {
    position: absolute;
    width: 0;
    height: 0;
  }

  /* Fer à cheval clouté en filigrane (vue : svg.th-hero-fer) — desktop
     seulement, cf. @media (min-width: 901px) ; masqué ici (mobile : la photo
     couvre toute la carte) */
  .th-hero-fer {
    display: none;
  }

  .th-hero-content {
    /* plus d'air vertical : l'encadré général est plus haut (maquette) */
    padding: 20px;
    display: grid;
    gap: 12px;
    justify-items: start;
  }

  .th-hero-badge {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #27904f;
    color: var(--color-text-inverse);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: var(--font-size-13);
    font-weight: var(--text-bold-weight);
    /* Cette pastille est un <h2> (titre de section « Quinté+ du jour »). On
       fige line-height et letter-spacing sur leur valeur héritée d'origine
       (quand c'était un <p>) pour neutraliser .card h2 { line-height; letter-
       spacing } d'app.css → rendu strictement iso-visuel. */
    line-height: normal;
    letter-spacing: normal;
  }

  .th-hero-title {
    margin: 0;
    font-size: clamp(20px, 5.4vw, var(--font-size-xl));
    line-height: var(--text-ui-height);
    letter-spacing: -0.01em;
    color: var(--color-text-inverse);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Hippodrome / Départ : tronqués en … plutôt que de casser la ligne */
  .th-hero-meta > span {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .th-hero-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: #dff0e6;
    /* Nunito a une grande hauteur d'x : 13px ici ≈ le rendu maquette */
    font-size: var(--font-size-13);
  }

  .th-hero-meta-detail {
    align-items: center;
    opacity: 0.92;
    /* Ligne discipline • distance • partants • météo : les disciplines longues
       (« Steeple-Chase ») poussaient la météo à la ligne. Gap resserré
       (10px au lieu de 14px, soit 20px entre deux infos avec le séparateur)
       pour tout tenir sur une ligne sans changer la ligne Hippodrome/Départ. */
    column-gap: 10px;
  }

  .th-hero-meta-sep {
    opacity: 0.6;
  }

  .th-hero-meta-np {
    color: #ffb3ba;
    font-weight: var(--text-semibold-weight);
  }

  .th-hero-discipline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .th-hero-discipline-icon {
    width: 22px;
    height: auto;
    /* icônes sombres lisibles sur fond vert profond */
    filter: brightness(0) invert(1);
  }

  /* Arrivée officielle — panneau PLEIN vert foncé + fine bordure vert
     clair (maquette) ; numéros séparés par de petits tirets discrets */
  .th-hero-arrivee {
    justify-self: stretch;
    background: var(--thh-box);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    padding: 10px 16px;
    text-align: center;
    display: grid;
    gap: 4px;
    /* conteneur de requête : les numéros se dimensionnent sur la largeur
       RÉELLE de la box (arrivées longues → police réduite, zéro overflow) */
    container-type: inline-size;
  }

  .th-hero-arrivee-label {
    /* Casse normale (Xavier 28/09/2026). */
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: var(--font-size-11);
    font-weight: var(--text-bold-weight);
    color: #cfe8d9;
  }

  /* arrivée PAS ENCORE officielle (provisoire, enquête...) : libellé doré
     pour signaler que le résultat peut encore changer */
  .th-hero-arrivee-label.is-pending {
    color: #ffd9a3;
  }

  .th-hero-arrivee-nums {
    margin: 0;
    /* repli pour navigateurs sans container queries */
    font-size: clamp(19px, 6vw, 26px);
    /* la plus GROSSE taille qui tient sur une ligne : largeur de la box
       (96cqw) divisée par la largeur du texte en em (--th-arr-units,
       calculée dans la vue) — plafonnée à 30px, plancher 19px */
    font-size: clamp(19px, calc(96cqw / var(--th-arr-units, 8)), 30px);
    font-weight: var(--font-weight-800);
    letter-spacing: 0.04em;
    color: var(--color-text-inverse);
    white-space: nowrap;
    max-width: 100%;
  }

  /* petits tirets : plus petits et plus pâles que les chiffres, centrés
     sur leur hauteur (maquette) */
  .th-hero-arrivee-dot {
    margin: 0 0.34em;
    opacity: 0.75;
    font-size: 0.62em;
    vertical-align: 0.16em;
    font-weight: var(--text-bold-weight);
  }

  .th-hero-arrivee-nums.is-text {
    font-size: var(--font-size-base);
    font-weight: var(--text-semibold-weight);
    letter-spacing: 0;
  }

  .th-hero-arrivee-np {
    font-size: var(--font-size-xs);
    color: #ffb3ba;
  }

  /* Rapports Ordre / Désordre — panneaux PLEINS très foncés + fine
     bordure vert clair (maquette) */
  .th-hero-reports {
    justify-self: stretch;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
  }

  .th-hero-report-card {
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: var(--thh-box-deep);
    border-radius: 6px;
    padding: 10px 14px;
    display: grid;
    gap: 2px;
  }

  .th-hero-report-card span {
    font-size: var(--font-size-13);
    color: #cfe8d9;
    font-weight: var(--text-semibold-weight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .th-hero-report-card strong {
    /* fluide : s'adapte à la case sans déborder ni casser la ligne */
    font-size: clamp(15px, 5vw, var(--font-size-xl));
    color: var(--thh-amount);
    font-weight: var(--font-weight-800);
    white-space: nowrap;
  }

  .th-hero-report-card {
    min-width: 0;
  }

  /* Compte à rebours « Départ dans » (même box que l'arrivée) : chiffres
     tabulaires = largeur fixe, pas de tremblement à chaque seconde */
  .th-hero-countdown {
    font-variant-numeric: tabular-nums;
  }

  /* 2 CTA sous le compte à rebours (mêmes cases que les rapports) —
     libellés provisoires, liens # en attente de validation Xavier */
  .th-hero-cta-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border-radius: 6px;
    padding: 13px 16px;
    font-size: var(--font-size-15);
    font-weight: var(--text-bold-weight);
    min-width: 0;
  }

  .th-hero-cta-card.is-gold {
    background: var(--palette-orange-500);
    color: #2b1d00;
  }

  .th-hero-cta-card.is-gold:hover {
    background: var(--palette-orange-600);
  }

  .th-hero-cta-card.is-light {
    background: var(--color-surface);
    color: #14532d;
  }

  .th-hero-cta-card.is-light:hover {
    background: #e9f2ec;
  }

  /* Pas encore de résultat : bouton PMU doré */
  .th-hero-pmu {
    display: inline-flex;
    align-items: center;
    background: var(--palette-orange-500);
    color: #2b1d00;
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-sm);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
  }

  /* CTA — pastille blanche (sur la photo en desktop, pleine largeur en mobile) */
  .th-hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 var(--space-4) var(--space-4);
    padding: 12px 20px;
    border-radius: 6px;
    /* fond doré — MÊME jaune que « Parier » (topbar) et « Parier sur PMU
       100€ offerts » : tous sur --palette-orange-500 (demande Xavier) */
    background: var(--palette-orange-500);
    color: #2b1d00;
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-md);
  }

  .th-hero-cta:hover {
    background: var(--palette-orange-600);
  }

  .th-hero-cta svg {
    width: 15px;
    height: 15px;
  }

  /* ════════════════════════════════════════════════════════════
   *  HERO Quinté — MOBILE (≤ 900 px) : maquette Xavier du 11/09/2026.
   *  La photo de la discipline (déjà dans la page, jusqu'ici cachée sous
   *  900 px) passe en FOND de la carte sous un voile vert ; pastilles
   *  Quinté+ / R1C4 / météo en tête ; icônes sur les lignes d'info et les
   *  boutons ; boîtes translucides (compte à rebours, arrivée, rapports).
   *  Même ambiance pour les trois états : course à venir (compte à rebours
   *  + 2 boutons), arrivée connue (numéros + rapports Ordre/Désordre),
   *  course annulée.
   *  Le DESKTOP (≥ 901 px, plus bas) n'est PAS concerné : ses règles sont
   *  intactes et les deux plages ne se recouvrent pas.
   *  Version d'avant conservée : _backup/20260911_bloc_quinte_mobile_v1/.
   *
   *  Hooks HTML (vue home-tab-content.php du thème) :
   *   .th-hero-only-mobile    montré ≤ 900 px seulement (icônes, pastilles)
   *   .th-hero-only-desktop   caché ≤ 900 px (textes de repli desktop)
   *   .th-hero-pill           pastille R1C4 / météo (.th-hero-pill-weather)
   *   .th-hero-ico            icône <svg> en ligne (tracés Lucide 24×24)
   *   .th-hero-cta-card-txt   « Parier sur PMU » sur 2 lignes
   *   .th-hero-badge[data-th-short]  « Quinté+ » seul, peint par ::before ;
   *                           -label/-sep/-date = H2 complet, masqué à l'écran
   *                           mais lu et indexé (texte du H2 inchangé)
   *   .th-hero-meta-ref       « (R1C4) » de la ligne Hippodrome, masqué
   * ════════════════════════════════════════════════════════════ */
  .th-hero-only-mobile {
    display: none;
  }

  @media (max-width: 900px) {
    .th-hero {
      /* réglages locaux — une seule valeur à toucher pour changer d'avis */
      --thh-m-inset: var(--thh-m-gutter);            /* marge autour de la carte : la MÊME que les blocs réunion du programme (.th-prg-list) — demande Xavier 11/09 ; 0 = bord à bord */
      --thh-m-radius: var(--radius-lg);              /* coins à peine arrondis (6 px, tokens.css) */
      --thh-m-pad: 14px;                             /* marge intérieure de la carte */
      --thh-m-glass: rgba(10, 46, 30, 0.5);          /* boîtes translucides sur la photo — le nouveau vert (Xavier 2026-10-28) ; retour arrière : rgba(4, 28, 16, 0.45) */
      --thh-m-glass-line: rgba(255, 255, 255, 0.22);
      --thh-m-quinte: var(--palette-red-500d);       /* même rouge que la pastille Quinté+ du programme */
      --thh-m-cta: #0d854d;                          /* bouton du bas (« Voir le pronostic complet ») — assombri le 13/11/2026 pour le texte blanc : 4,7:1 (avant #0f9f5c : 3,4:1 ; Google demande 4,5) */
      --thh-m-cta-hover: #0b7442;
      --thh-m-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); /* lisibilité du texte sur la photo */
      margin: 0 var(--thh-m-inset);
      border-radius: var(--thh-m-radius);
      /* fond de repli (photo absente ou pas encore chargée) — le nouveau vert
         (Xavier 2026-10-28) ; retour arrière :
         linear-gradient(180deg, #16603c 0%, var(--thh-deep) 100%) */
      background: linear-gradient(180deg, #1b764f 0%, #124f35 100%);
    }

    .th-hero-only-mobile {
      display: inline-block;
    }

    .th-hero-only-desktop {
      display: none;
    }

    /* — Photo en fond : couvre toute la carte, cadrée sur le cheval de tête
       (à droite sur les 3 photos), sous un double voile : latéral (le texte
       est à gauche) + vertical (le bas redevient vert plein pour les boutons) */
    .th-hero-media {
      display: block;
      order: 0;
      position: absolute;
      inset: 0;
      height: auto;
      z-index: 0;
      background: #124f35; /* retour arrière : var(--thh-deep) */
      clip-path: none;
      pointer-events: none;
    }

    .th-hero-media img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: 76% 50%;
      clip-path: none;
    }

    .th-hero-media::after {
      content: "";
      position: absolute;
      inset: 0;
      /* le voile dans le nouveau vert #124f35 (Xavier 2026-10-28). Retour
         arrière : linear-gradient(180deg, rgba(6, 34, 20, 0.38) 0%,
         rgba(6, 34, 20, 0.46) 36%, rgba(8, 44, 26, 0.9) 60%, var(--thh-deep)
         100%), linear-gradient(90deg, rgba(6, 34, 20, 0.72) 0%,
         rgba(6, 34, 20, 0.3) 50%, rgba(6, 34, 20, 0) 100%) */
      background:
        linear-gradient(180deg, rgba(18, 79, 53, 0.42) 0%, rgba(18, 79, 53, 0.5) 36%, rgba(18, 79, 53, 0.92) 60%, #124f35 100%),
        linear-gradient(90deg, rgba(18, 79, 53, 0.72) 0%, rgba(18, 79, 53, 0.3) 50%, rgba(18, 79, 53, 0) 100%);
    }

    /* — Contenu au-dessus de la photo : rangées souples ; la 1re porte les
       pastilles (Quinté+ et R1C4 à gauche, météo à droite) */
    .th-hero-content {
      position: relative;
      z-index: 1;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px 8px;
      padding: var(--thh-m-pad) var(--thh-m-pad) 10px;
      text-shadow: var(--thh-m-shadow);
    }

    .th-hero-badge {
      background: var(--thh-m-quinte);
      border-radius: var(--badge-radius);
      padding: 6px 10px;
      font-size: var(--font-size-13);
      /* Casse normale (Xavier 28/09/2026). */
      text-transform: none;
      letter-spacing: 0;
      text-shadow: none;
    }

    /* le H2 reste complet dans la page (texte inchangé pour Google et les
       lecteurs d'écran) ; à l'écran, seule la pastille « Quinté+ », peinte
       depuis l'attribut data-th-short — la 2e déclaration (syntaxe « / "" »)
       lui retire tout nom accessible là où elle est comprise, la 1re sert
       de repli ailleurs */
    .th-hero-badge::before {
      content: attr(data-th-short);
      content: attr(data-th-short) / "";
    }

    .th-hero-badge-label,
    .th-hero-badge-sep,
    .th-hero-badge-date {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip: rect(0 0 0 0);
      clip-path: inset(50%);
      white-space: nowrap;
    }

    .th-hero-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: var(--badge-radius);
      background: var(--thh-m-glass);
      border: 1px solid var(--thh-m-glass-line);
      -webkit-backdrop-filter: blur(6px);
      backdrop-filter: blur(6px);
      color: var(--color-text-inverse);
      font-size: var(--font-size-13);
      font-weight: var(--text-bold-weight);
      line-height: normal;
      text-shadow: none;
    }

    .th-hero-pill-weather {
      margin-left: auto;
    }

    .th-hero-title {
      flex: 0 0 100%;
      /* 24 px maxi (au lieu de 30) : à 390 px il reste 352 px pour le titre,
         soit ~28 lettres — « Super Handicap de la Rentree » tient en entier. */
      font-size: clamp(20px, 6.2vw, 24px);
      line-height: 1.15;
      font-weight: var(--font-weight-800);
      letter-spacing: -0.015em;
      /* UNE SEULE ligne, coupée en « … » : plus de retour à la ligne qui
         pousse la carte (demande Xavier 13/09). La troncature est CSS, donc
         le nom complet reste dans le <h3> pour Google et les lecteurs
         d'écran. min-width: 0 = sans lui, un enfant de flex refuse de
         rétrécir sous son contenu et le « … » n'apparaît jamais. */
      min-width: 0;
      display: block;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .th-hero-meta {
      flex: 0 0 100%;
      gap: 6px 16px;
      color: #eef6f0;
      font-size: var(--font-size-sm);
      font-weight: var(--text-semibold-weight);
    }

    .th-hero-meta-detail {
      column-gap: 18px;
      opacity: 1;
    }

    /* pas de puces entre les infos (chacune a son icône) ; la météo est
       dans sa pastille en haut à droite, le (R1C4) dans la sienne */
    .th-hero-meta-sep,
    .th-hero-meta-item.is-weather,
    .th-hero-meta-ref {
      display: none;
    }

    .th-hero-ico {
      width: 18px;
      height: 18px;
      vertical-align: -4px;
      margin-right: 6px;
      flex: 0 0 auto;
    }

    .th-hero-discipline {
      gap: 8px;
    }

    .th-hero-discipline-icon {
      width: 26px;
    }

    /* — Boîtes translucides : compte à rebours / arrivée / rapports */
    .th-hero-arrivee,
    .th-hero-report-card {
      background: var(--thh-m-glass);
      border-color: var(--thh-m-glass-line);
      border-radius: var(--thh-m-radius);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
    }

    .th-hero-arrivee {
      flex: 0 0 100%;
      padding: 12px 16px;
    }

    .th-hero-arrivee-label {
      letter-spacing: 0.12em;
      color: #dcebe2;
    }

    .th-hero-arrivee-nums {
      font-size: clamp(24px, 6.5vw, 30px); /* repli sans container queries */
      font-size: clamp(24px, calc(96cqw / var(--th-arr-units, 8)), 34px);
    }

    .th-hero-countdown {
      font-size: clamp(30px, 10vw, 40px); /* repli sans container queries */
      font-size: clamp(30px, calc(96cqw / var(--th-arr-units, 8)), 40px);
    }

    .th-hero-reports {
      flex: 0 0 100%;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .th-hero-report-card {
      padding: 10px 12px;
      text-align: center;
    }

    /* — Boutons : PMU (doré, 2 lignes) et partants (translucide), icône à
       gauche. Pas de chevron ici : à 390 px chaque bouton fait ~164 px et
       « Voir les partants » (110 px en 14 px gras) n'y tient sur UNE ligne
       qu'avec une icône de 18 px et 10 px de marge — un chevron le ferait
       passer sur 2 lignes. Sous 380 px, un cran de moins. */
    .th-hero-cta-card {
      justify-content: flex-start;
      text-align: left;
      gap: 8px;
      padding: 8px 10px;
      min-height: 52px;
      border-radius: var(--thh-m-radius);
      font-size: var(--font-size-sm);
      text-shadow: none;
    }

    .th-hero-cta-card .th-hero-ico {
      width: 18px;
      height: 18px;
      margin-right: 0;
    }

    .th-hero-cta-card-txt {
      display: grid;
      gap: 1px;
      min-width: 0;
      line-height: 1.2;
    }

    .th-hero-cta-card-txt small {
      font-size: var(--font-size-xs);
      font-weight: var(--text-semibold-weight);
    }

    @media (max-width: 380px) {
      .th-hero-cta-card {
        font-size: 13px;
      }
    }

    .th-hero-cta-card.is-light {
      background: var(--thh-m-glass);
      border: 1px solid var(--thh-m-glass-line);
      -webkit-backdrop-filter: blur(8px);
      backdrop-filter: blur(8px);
      color: var(--color-text-inverse);
    }

    .th-hero-cta-card.is-light:hover {
      background: rgba(4, 28, 16, 0.62);
    }

    .th-hero-pmu {
      flex: 0 0 100%;
      justify-content: center;
      gap: 10px;
      padding: 13px 16px;
      border-radius: var(--thh-m-radius);
      font-size: var(--font-size-15);
      text-shadow: none;
    }

    /* — Bouton du bas : vert, pleine largeur, icône graphique + chevron */
    .th-hero-cta {
      position: relative;
      z-index: 1;
      margin: 0 var(--thh-m-pad) var(--thh-m-pad);
      padding: 13px 16px;
      border-radius: var(--thh-m-radius);
      background: var(--thh-m-cta);
      color: var(--color-text-inverse);
      font-size: var(--font-size-15);
      box-shadow: none;
    }

    .th-hero-cta:hover {
      background: var(--thh-m-cta-hover);
    }

    .th-hero-cta .th-hero-ico {
      width: 20px;
      height: 20px;
      margin-right: 0;
    }
  }

  /* ════════════════════════════════════════════════════════════
   *  PROGRAMME — barres réunions + accordéon
   * ════════════════════════════════════════════════════════════ */
  .th-prg-title {
    /* Casse normale (Xavier 28/09/2026 : « il faut normal partout »). Les
       capitales portaient le titre : sans elles il faut la taille d'un titre
       de carte du site (17 px, comme les blocs de l'accueil), sinon la ligne
       passe pour du texte courant. */
    text-transform: none;
    letter-spacing: 0;
    font-size: 17px;
    font-weight: var(--font-weight-700, 700);
    color: var(--thh-ink);
    /* paddings mobile : le panneau full-bleed n'a plus de padding propre */
    margin: var(--space-5) 0 var(--space-3);
    padding-inline: var(--space-4);
  }

  .th-prg-list {
    display: grid;
    gap: var(--space-3);
    /* téléphone : même marge latérale que la carte Quinté (--thh-m-gutter) ;
       desktop remet padding: 0 (@media 901px plus bas) */
    padding: 0 var(--thh-m-gutter) var(--space-3);
  }

  .th-prg-group {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dde7df;
    background: var(--color-surface);
  }

  .th-prg-group.is-quinte-group {
    border-color: var(--thh-bar-red);
  }

  .th-prg-group.is-pick5-group {
    border-color: var(--thh-pick5);
  }

  /* Barre réunion : verte (standard) / rouge (Quinté) — texte blanc */
  .th-home .home-program-row-toggle {
    /* le legacy arrondit ce bouton (≠ rayon du groupe) → croissants blancs
       dans les coins ; le groupe overflow:hidden gère seul les coins */
    border-radius: 0;
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    min-height: 47px;
    padding: 6px 14px;
    background: var(--thh-bar-green);
    color: var(--color-text-inverse);
    border: 0;
    text-align: left;
  }

  .th-home .home-program-row-toggle.is-highlighted {
    background: var(--thh-bar-red);
  }

  .th-prg-group.is-pick5-group .home-program-row-toggle {
    background: var(--thh-pick5);
    color: var(--thh-ink);
  }

  .th-home .home-program-col-code {
    font-size: var(--font-size-15);
    font-weight: var(--font-weight-800);
    color: var(--color-text-inverse);
  }

  .th-home .home-program-col-time {
    display: inline-flex;
    align-items: center;
    color: var(--color-text-inverse);
  }

  .th-home .home-program-col-time-icon {
    width: 30px;
    height: auto;
    filter: brightness(0) invert(1);
  }

  .th-prg-group.is-pick5-group .home-program-col-time-icon {
    filter: none;
  }

  .th-home .home-program-col-name {
    color: var(--color-text-inverse);
    font-weight: var(--text-bold-weight);
    font-size: var(--font-size-15);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Pill Quinté+ dans la barre : contour blanc (le rouge plein du défaut
     serait invisible sur la barre rouge) */
  .th-home .home-program-row-toggle .race-pill-quinte {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    color: var(--color-text-inverse);
    border-radius: var(--radius-full);
    font-weight: var(--text-bold-weight);
  }

  .th-home .home-program-col-detail {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }

  .th-prg-group.is-pick5-group .home-program-col-code,
  .th-prg-group.is-pick5-group .home-program-col-name,
  .th-prg-group.is-pick5-group .home-program-col-time {
    color: var(--thh-ink);
  }

  .th-prg-group.is-pick5-group .home-program-col-detail,
  .th-prg-group.is-pick5-group .th-prg-chev {
    color: var(--thh-ink);
  }

  /* Heure : pastille blanche, texte de la couleur de la barre */
  .th-home .home-program-col-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* le legacy impose ~44px de haut à cette pastille → gonflerait la barre */
    min-height: 0;
    height: auto;
    line-height: 1;
    background: var(--color-surface);
    color: var(--thh-bar-green);
    border-radius: 6px;
    padding: 5px 10px;
    font-weight: var(--font-weight-800);
    font-size: var(--font-size-sm);
    white-space: nowrap;
  }

  .th-home .home-program-row-toggle.is-highlighted .home-program-col-status {
    color: var(--thh-bar-red);
  }

  .th-prg-group.is-pick5-group .home-program-col-status {
    color: var(--thh-pick5);
  }

  .th-prg-clock {
    width: 14px;
    height: 14px;
  }

  .th-prg-chev {
    display: inline-flex;
    color: rgba(255, 255, 255, 0.9);
  }

  .th-prg-chev svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-interaction);
  }

  .th-home [data-home-reunion-toggle][aria-expanded="true"] .th-prg-chev svg {
    transform: rotate(180deg);
  }

  /* Badge coin haut-gauche (réunion Quinté+ / Pick5). */
  .th-prg-corner-badge {
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    min-width: 20px;
    height: 15px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    color: var(--thh-bar-red);
    font-size: var(--font-size-10);
    font-weight: var(--font-weight-900);
    border-radius: 0 0 var(--radius-sm) 0;
    line-height: 1;
  }

  .th-prg-corner-badge.is-pick5 {
    background: rgba(255, 255, 255, 0.42);
    color: var(--palette-red-600i);
  }

  /* Courses : lignes alternées, numéros colorés */
  .th-home .home-program-accordion {
    border-top: 0;
  }

  .th-home .home-program-course-row {
    padding: var(--space-3);
    background: var(--color-surface);
  }

  .th-home .home-program-course-row:nth-child(even) {
    background: #f5f8f6;
  }

  .th-home .home-program-course-name-link {
    color: var(--thh-ink);
    font-weight: var(--text-bold-weight);
  }

  .th-home .home-program-course-np {
    color: var(--thh-bar-red);
    font-weight: var(--text-regular-weight);
  }

  .th-home .home-program-course-result-link {
    color: #0d7a43;
    font-weight: var(--font-weight-800);
    letter-spacing: 0.03em;
  }

  .th-home .home-program-course-result-link.is-quinte {
    color: var(--thh-bar-red);
  }

  /* ── Mobile : le bloc COLLE au header (effet app) — supprime la bande
     grise (fond de page dans le margin-top du conteneur) et la bordure/
     l'arrondi haut de la carte qui la laissaient apparaître ── */
  @media (max-width: 979px) {
    [data-theme="hippique"] .layout.layout-homepage {
      margin-top: 0;
    }

    .th-home .home-panel {
      border-top: 0;
      border-top-left-radius: 0;
      border-top-right-radius: 0;
    }

    /* Bandeau H1 : plus de fond gris (c'était le fond de page qui se voyait
       derrière, le bandeau n'a pas de fond propre) → blanc comme le panneau
       en dessous, tout le haut de page d'un seul tenant (Xavier 11/09/2026) */
    .th-home-intro {
      background: var(--color-surface);
    }
  }

  /* ── Mobile (≤979px = breakpoint du défaut) : lignes de courses.
     1. arrivée/heure de départ recalée à DROITE, centrée VERTICALEMENT
        (le défaut la passait en 2e ligne sous le texte) ;
     2. marge code→nom réduite de moitié (8px → 4px) ;
     3. nom trop long tronqué en … — jamais sur l'arrivée, jamais 2 lignes ;
     4. non-partants à la ligne (3e ligne), sans le tiret séparateur. ── */
  @media (max-width: 979px) {
    .th-home .home-program-course-row {
      grid-template-columns: 40px minmax(0, 1fr) auto;
      align-items: center;
      column-gap: 4px;
      row-gap: 0;
    }

    .th-home .home-program-course-end {
      grid-column: auto;
      justify-self: end;
      align-self: center;
      text-align: right;
      /* l'air côté arrivée reste celui d'origine (la colonne code, elle,
         passe à 4px) */
      padding-left: 8px;
    }

    .th-home .home-program-course-title-line {
      flex-wrap: nowrap;
      min-width: 0;
    }

    .th-home .home-program-course-name-link {
      flex: 0 1 auto;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .th-home .home-program-course-np-sep {
      display: none;
    }

    .th-home .home-program-course-np {
      display: block;
      margin-top: 2px;
    }
  }

  /* ════════════════════════════════════════════════════════════
   *  SIDEBAR — Top Pronostics + carte promo TRITURF
   * ════════════════════════════════════════════════════════════ */
  .th-side-picks {
    padding: 0;
    overflow: hidden;
  }

  .th-side-picks .th-side-picks-head {
    margin: 0;
    background: var(--thh-deep);
    color: var(--color-text-inverse);
    padding: var(--space-3) var(--space-4);
    /* Casse normale (Xavier 28/09/2026) : 13 px en capitales se lisait comme
       une étiquette, en casse normale il faut la taille d'un titre de carte. */
    font-size: 15px;
    font-weight: var(--font-weight-700, 700);
    text-transform: none;
    letter-spacing: 0;
    text-align: center;
  }

  .th-side-picks .home-top-picks {
    display: grid;
  }

  .th-side-picks .home-top-pick {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: 0;
    border-top: 1px solid var(--color-border);
    border-radius: 0;
    background: transparent;
  }

  .th-side-picks .home-top-pick:first-child {
    border-top: 0;
  }

  .th-side-pick-label {
    font-weight: var(--text-bold-weight);
    color: var(--thh-ink);
    flex: 1 1 auto;
    min-width: 0;
  }

  .th-side-pick-value {
    color: var(--color-text-muted);
    font-weight: var(--text-semibold-weight);
  }

  .th-side-pick-chev {
    display: inline-flex;
    color: var(--color-text-muted);
  }

  .th-side-pick-chev svg {
    width: 16px;
    height: 16px;
  }

  /* Carte promo TRITURF */
  /* ── Filet historique : la pub de la sidebar (z-index:1) ne devait JAMAIS
     recouvrir les autres cartes. Depuis le 19/08/2026 le chevauchement est
     réglé en amont, par la structure (.rail-flow / .rail-pinned dans
     layout.css) — cette règle n'est plus qu'une ceinture.
     SÉLECTEUR EN DESCENDANT, PAS EN ENFANT DIRECT : les cartes vivent
     désormais dans .rail-pinned, un `>` ne les atteindrait plus. */
  .th-home .home-sidebar .card:not(.home-sidebar-ad) {
    position: relative;
    z-index: 2;
  }

  /* Cartes home sur .card globale (bandeau bonus + cartes sidebar) : rayon
     aligné sur la home (8px = niveau page Résultats) — sinon elles restent au
     --radius global (4px) et détonnent avec le panneau/hero. */
  .th-home .home-bonus-banner,
  .th-home .home-sidebar .card:not(.home-sidebar-ad) {
    border-radius: 6px;
  }

  /* CARTE TRITURF, VERSION B DU 06/11/2026 (partials/blocks/promo-triturf.php,
     choisie par Xavier sur maquettes) : le haut de la page /logiciel/triturf/
     en petit — même photo sous un voile noir, badge rouge collé au
     bord, titre rouge, bouton blanc qui rosit au survol (logiciel-triturf.css,
     .tt-hero*) ; textes ≤ 15 px (règle du menu rouge). Avant : dégradé vert
     « Optimisez vos jeux » (titre 24 px, bouton rouge vers /boutique/).
     PHOTO ALLÉGÉE : fond-carte-colonne.jpg = bg-3.jpg (131 Ko, 1101 × 726) recadrée
     au format de la carte et réduite à 300 × 456 (15 Ko) ; sous le voile, l'écart
     avec l'original est invisible (moins de 1/255 par pixel en moyenne, mesuré à
     2×). Pas de 2× Retina : rien à y gagner sous 82 % de noir. Sur téléphone la
     colonne est cachée, la photo n'est pas téléchargée.
     Le fond de repli #0d0d0d garde le texte blanc lisible si la photo manque.
     La carte entière est cliquable : le ::after du bouton la recouvre — seul
     .th-side-promo est positionné entre les deux, ne rien positionner dedans. */
  .th-side-promo {
    position: relative;
    overflow: hidden;
    padding: 0;
    border-radius: 6px;
    background: #0d0d0d url("/assets/img/logiciel/triturf/fond-carte-colonne.jpg") center / cover no-repeat;
    color: #fff;
  }

  /* La colonne de droite des pages ordinaires est un BLOC, pas une grille :
     chaque carte y porte ses 14 px (comme .side-cmp et .app-colonne). Sans
     eux, la carte touchait « Parier en ligne » juste en dessous (0 px, mesuré
     sur /direct/ ; Xavier 07/11/2026 : « les 2 blocs sont trop près »). Les
     trois autres colonnes sont des grilles à gouttière de 14 px : rien à
     ajouter. */
  .right-col-sidebar .th-side-promo {
    margin-bottom: 14px;
  }

  .th-side-promo-in {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
    background: rgba(0, 0, 0, 0.82);
  }

  .th-side-promo-badge {
    align-self: flex-start;
    margin: 0 0 4px -16px;
    padding: 8px 14px 8px 16px;
    background: #da0034;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.1;
  }

  .th-side-promo-title {
    margin: 0;
    color: #ff3b5c;
    font-size: 15px;
    line-height: 1.3;
    font-weight: 700;
    text-transform: uppercase;
  }

  .th-side-promo-txt {
    margin: 0;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
  }

  .th-side-promo-shot {
    display: block;
    width: 100%;
    height: auto;
    border: 2px solid #fff;
    border-radius: 4px;
  }

  .th-side-promo-btn {
    display: block;
    background: #fff;
    color: #da0034;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    padding: 11px 12px;
  }

  .th-side-promo-btn::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  .th-side-promo-btn:hover,
  .th-side-promo-btn:focus-visible {
    background: #ffdcdc;
    color: #da0034;
    text-decoration: none;
  }

  .th-side-promo-mention {
    margin: 0;
    color: #bdbdbd;
    font-size: 12px;
    line-height: 1.3;
    text-align: center;
  }

  /* ════════════════════════════════════════════════════════════
   *  DESKTOP ≥ 901px
   * ════════════════════════════════════════════════════════════ */
  @media (min-width: 901px) {
    /* Panneau : on restaure la carte blanche du desktop (le full-bleed
       est un parti pris mobile uniquement) */
    .th-home .home-panel {
      margin-inline: 0;
      padding: var(--space-4);
      border-left: 1px solid var(--color-border);
      border-right: 1px solid var(--color-border);
      border-radius: 6px;
    }

    /* Onglets : compacts, alignés à gauche (maquette) — la grille pleine
       largeur est réservée au mobile (segmented control) */
    .th-home .home-day-tabs {
      gap: 6px;
      padding: 0;
      overflow: visible;
    }

    .th-home .home-day-tab {
      flex: 0 0 auto;
      min-width: 0;
      padding: 12px 34px;
      font-size: var(--font-size-15);
    }

    /* les cases du bloc Quinté (Arrivée, Ordre / Désordre) : le vert du bloc,
       deux crans plus foncé (option B de Xavier, 2026-10-28). Le téléphone
       garde les siens. Retour arrière : supprimer cette règle, les cases
       reprennent #0f4d2c (Arrivée) et #0b4124 (Ordre / Désordre) */
    .th-home {
      --thh-box: #14573a;
      --thh-box-deep: #124f35;
    }

    /* Hero : contenu à gauche, photo pleine hauteur à droite avec
       découpe en arc + liseré blanc (maquette) */
    .th-hero {
      display: block;
      /* encadré général plus haut (maquette — ratio ~2.34:1) */
      min-height: 360px;
      border-radius: 0 6px 6px 6px;
    }

    /* Fer à cheval en filigrane (maquette A2, Xavier 02/10/2026) : grand,
       coupé par le haut de la carte, derrière le texte (.th-hero-content
       z-index 1) ; la photo, plus loin dans le flux, le recouvre à droite */
    .th-hero-fer {
      display: block;
      position: absolute;
      left: 40px;
      top: -20px;
      width: 400px;
      height: auto;
      aspect-ratio: 300 / 290;
      opacity: 0.1;
      z-index: 0;
      pointer-events: none;
    }

    /* Séparation en ARC (maquette) : clipPaths SVG définis dans la vue
       (th-hero-curve-outer/inner) — le fond blanc du wrapper, visible entre
       les deux courbes, forme le liseré incurvé. */
    .th-hero-media {
      display: block;
      order: 0;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      width: 47%;
      height: auto;
      background: var(--color-surface);
      clip-path: url(#th-hero-curve-outer);
    }

    .th-hero-media img {
      position: absolute;
      inset: 0;
      height: 100%;
      clip-path: url(#th-hero-curve-inner);
    }

    .th-hero-content {
      position: relative;
      z-index: 1;
      width: 57%;
      padding: 26px 30px;
      gap: 14px;
    }

    /* tailles recalées sur la maquette (titre ~24px, montants ~21px) ;
       les numéros d'arrivée reprennent la GROSSE taille v1 (34px max,
       demande Xavier) en s'adaptant à la largeur réelle de la box */
    .th-hero-arrivee-nums {
      font-size: clamp(22px, 2.1vw, 28px); /* repli sans container queries */
      font-size: clamp(22px, calc(96cqw / var(--th-arr-units, 8)), 34px);
      letter-spacing: 0.05em;
    }

    .th-hero-report-card strong {
      font-size: clamp(15px, 1.6vw, 21px);
    }

    .th-hero-title {
      font-size: clamp(21px, 1.9vw, 24px);
    }

    .th-hero-cta {
      position: absolute;
      z-index: 1;
      right: var(--space-4);
      bottom: var(--space-4);
      margin: 0;
      padding: 11px 22px;
    }

    /* Programme : plus de paddings compensatoires en desktop */
    .th-prg-title {
      padding-inline: 0;
    }

    .th-prg-list {
      padding: 0;
    }

    /* Barre réunion : place pour tout sur une ligne */
    .th-home .home-program-row-toggle {
      grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
      min-height: 50px;
      padding: 6px var(--space-4);
    }

    .th-home .home-program-col-detail {
      justify-self: end;
    }
  }
}

/* ── Exception couche LEGACY : app.css force la taille de h2.home-program-title
   en !important. Pour les déclarations !important, la priorité des couches
   s'INVERSE (legacy bat modules) → impossible de gagner depuis modules.
   Riposte dans la même couche avec une spécificité supérieure.
   (mobile ≤979px : le legacy impose déjà 12px, conforme à la demande) ── */
@layer legacy {
  @media (min-width: 901px) {
    .th-home .home-panel h2.th-prg-title {
      /* 20px legacy -> 16px : une taille de moins (et taille maquette) */
      font-size: var(--font-size-base) !important;
    }
  }
}

/* ── CARTE « TURF FR EN POCHE » (partials/blocks/promo-appli.php) ──────────
   Xavier 06/11/2026, piste B : « B avec les 2 boutons de la même largeur ».
   Fin de la zone qui défile des colonnes de droite, juste au-dessus de
   TRITURF. Le vert de la carte TRITURF d'alors (dégradé #0c3a22 → #14663c,
   marque rouge #ff5560, titre 24 px validé sur l'image, sous-titre #cfe8d9),
   un vrai écran de l'app penché de 7° qui sort du bord droit, les badges
   d'Apple et de Google à 134 px de large tous les deux (celui d'Apple fait
   alors 42 px de haut, celui de Google 40 : l'étirer pour égaliser est
   interdit par Apple). Ses propres classes : rien n'est partagé avec
   .th-side-promo. Le texte passe AU-DESSUS de l'écran (z-index 1). ── */
@layer modules {
  .app-colonne {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    padding: 16px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0c3a22 0%, #14663c 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* La colonne de droite des pages ordinaires est un BLOC, pas une grille :
     chaque carte y porte ses 14 px (comme .side-cmp, components.css). Sans
     eux, la carte toucherait TRITURF (mesuré sur /direct/). Les trois autres
     colonnes sont des grilles à gouttière de 14 px : rien à ajouter. */
  .right-col-sidebar .app-colonne {
    margin-bottom: 14px;
  }

  .app-colonne > :not(.app-colonne-ecran) {
    position: relative;
    z-index: 1;
  }

  .app-colonne-ecran {
    position: absolute;
    top: 44px;
    right: -4px;
    width: 118px;
    height: auto;
    border: 4px solid #0b0f0d;
    border-radius: 18px;
    background: #0b0f0d;
    transform: rotate(7deg);
    box-shadow: -6px 8px 22px rgba(0, 0, 0, 0.45);
  }

  .app-colonne-marque {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ff5560;
    font-size: 13px;
    font-weight: var(--font-weight-800);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .app-colonne-marque svg {
    flex: none;
    width: 18px;
    height: 18px;
  }

  .app-colonne-titre {
    margin: 0;
    font-size: var(--font-size-xl);
    line-height: var(--line-height-110);
    font-weight: var(--font-weight-800);
    text-transform: uppercase;
  }

  .app-colonne-sous {
    margin: 0;
    font-size: var(--font-size-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cfe8d9;
  }

  .app-colonne-magasins {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .app-colonne-magasins a {
    display: block;
    line-height: 0;
  }

  .app-colonne-magasins img {
    display: block;
    width: 134px;
    height: auto;
  }

  /* L'image de Google porte des marges transparentes en haut et en bas
     (646 × 250, badge de 192 px de haut) : on la rogne à la hauteur du badge. */
  .app-colonne-magasins .app-colonne-google img {
    height: 40px;
    object-fit: cover;
  }

  .app-colonne a.app-colonne-lien,
  .app-colonne a.app-colonne-lien:visited {
    margin-top: auto;
    display: inline-block;
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-800);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .app-colonne a.app-colonne-lien:hover {
    color: #cfe8d9;
  }
}
