/* ==========================================================================
   Module SOREC — le bloc « Courses du Maroc » de l'accueil + les pages /maroc/.
   Couche `modules` (bat legacy/components/base, cf. docs/CSS_ARCHITECTURE.md).
   Chargée SEULEMENT avec le bloc ou sur une page /maroc/ (extraCssFiles).

   Hooks BEM stables (pour le designer) :
     .sorec                 le bloc de l'accueil (option A validée par Xavier le 28/09/2026)
     .sorec-band            le bandeau vert « SOREC · Courses du Maroc »
     .sorec-row--jour / --demain   la ligne du Quinté+ du jour / de demain
     .sorec-cta             le bouton orange « ★ Quinté+ »
     .sorec-prog            la ligne « Programme du jour | Programme de demain »
     .sorec-test            le bandeau du mode test (admin seulement)
     .sorec-accueil         l'image sous le bloc Quinté+ (--ma / --af)
     .mk-*                  les pages /maroc/ (programme, course, cheval, publicité)

   TÉLÉPHONE SEULEMENT (décision Xavier 28/09/2026) : le bloc (et l'image) est caché au-delà
   de 900 px — le même seuil que le bloc Quinté+ de l'accueil (hippique.home.css).
   Réduire la fenêtre d'un ordinateur suffit à le voir.
   Couleurs SOREC (rouge du logo, ocre des boutons) : variables locales au module,
   à repointer d'un seul endroit.
   ========================================================================== */
@layer modules {
  .sorec,
  .sorec-accueil,
  .mk-pub {
    --sorec-rouge: #6e1712;
    --sorec-rouge-2: #5d130f;
    --sorec-clair: #ad554c;
    --sorec-clair-2: #9d4a42;
    --sorec-kick: #f6b684;
    --sorec-cta: #eea062;
    --sorec-cta-texte: #2b1a00; /* texte foncé sur l'ocre : contraste 7,9:1 (blanc : 2,1:1, sous le minimum de 4,5:1 — audit Codex 29/09/2026) */
    --sorec-vert: #166b3c;
    --sorec-gouttiere: var(--thh-m-gutter, 5px);
  }

  /* ---------- le bloc de l'accueil ---------- */
  .sorec {
    display: none;
    margin: 6px var(--sorec-gouttiere) 2px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--sorec-rouge);
    color: #fff;
    font-family: inherit;
    line-height: 1.25;
  }

  .sorec a {
    color: #fff;
    text-decoration: none;
  }

  .sorec svg {
    flex: 0 0 auto;
    display: inline-block;
    vertical-align: middle;
  }

  .sorec-band {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    background: var(--sorec-vert);
  }

  .sorec-tile {
    flex: 0 0 38px;
    height: 24px;
    border-radius: 4px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sorec-band-t {
    flex: 1;
    min-width: 0;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sorec-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 7px 10px 7px 12px;
  }

  .sorec-row--jour {
    background: var(--sorec-rouge);
  }

  .sorec-row--demain {
    background: var(--sorec-clair);
  }

  .sorec-txt {
    flex: 1;
    min-width: 0;
  }

  .sorec-kick {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--sorec-kick);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sorec-line {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
    white-space: nowrap;
  }

  /* Le nom de la course reste ENTIER ; c'est le lieu/heure qui se raccourcit
     en « … » si la ligne est trop longue (Xavier 28/09/2026). */
  .sorec-line b {
    flex: 0 0 auto;
    font-size: 17px;
    font-weight: 700;
  }

  .sorec-where {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sorec-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: var(--sorec-cta);
    color: var(--sorec-cta-texte);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .sorec-cta svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
  }

  .sorec-prog {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    background: var(--sorec-rouge-2);
  }

  .sorec-prog--seul {
    grid-template-columns: minmax(0, 1fr);
  }

  .sorec-prog a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
  }

  .sorec-prog a + a {
    border-left: 1px solid rgba(255, 255, 255, 0.16);
  }

  .sorec-prog svg {
    width: 15px;
    height: 15px;
  }

  /* Le bandeau du mode test : visible à toutes les largeurs — sur ordinateur
     il explique pourquoi le bloc n'est pas là. */
  .sorec-test {
    margin: 6px var(--sorec-gouttiere) 0;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: #fff4d6;
    border: 1px solid #f2c777;
    color: #7a4b00;
    font-size: 13.5px;
    font-weight: 600;
  }

  .sorec-test a {
    color: #7a4b00;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  /* ---------- l'image de l'accueil, SOUS le bloc Quinté+ (Xavier 29/09/2026) ----------
     Une image par zone (Maroc en arabe, reste de l'Afrique en français), toute
     la largeur de la carte Quinté+ : la même marge latérale qu'elle — 5 px avec
     le thème hippique (--thh-m-gutter, posé par .th-home), aucune sans thème,
     où la carte prend toute la largeur (audit Codex 29/09/2026). */
  .sorec-accueil {
    display: none;
    margin: 8px var(--thh-m-gutter, 0px) 0;
  }

  .sorec-accueil-lien {
    display: block;
    line-height: 0;
  }

  .sorec-accueil-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
  }

  @media (max-width: 900px) {
    .sorec,
    .sorec-accueil {
      display: block;
    }

    .sorec-accueil[hidden] {
      display: none;
    }
  }

  @media (min-width: 901px) {
    .sorec-test::after {
      content: " Le bloc SOREC n’apparaît que sur téléphone : réduisez la fenêtre pour le voir.";
      font-weight: 500;
    }
  }
}

/* ==========================================================================
   Les pages /maroc/ (programme, course, cheval). Le haut de page vient de
   course-day.css (page Programme du site), la fiche de fiche-cheval.css ;
   ici seulement ce qui est propre au module (mk-*).
   ========================================================================== */
@layer modules {
  .layout-sorec .mk-top {
    margin-bottom: var(--space-2);
  }

  .mk-jours {
    margin-top: var(--space-3);
  }

  /* « Hier · Aujourd'hui · Demain · 29/09/2026 » tient sur un téléphone de 360 px : la barre glissait de 4 px avec
     un écart de 12 px (audit du 01/10/2026, mesuré police Arimo chargée) ; 8 px sous 400 px */
  @media (max-width: 400px) {
    .mk-jours .course-day-tabs { gap: var(--space-2); }
  }

  /* ---------- publicité SOREC 300×250 ---------- */
  .mk-pub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: var(--space-2) 0;
    padding: var(--space-3) 0 var(--space-2);
    background: var(--color-surface-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .mk-pub-lien {
    display: block;
    line-height: 0;
  }

  .mk-pub-img {
    display: block;
    width: 300px;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
  }

  .mk-pub-mention {
    font-size: 11.5px;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  /* ---------- programme : un panneau par réunion ---------- */
  .mk-panel {
    margin-bottom: var(--space-2);
    padding: var(--space-4);
  }

  .mk-panel-meta {
    margin: 0 0 var(--space-2);
    padding: var(--space-2) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    font-size: 13.5px;
    color: var(--color-text);
  }

  .mk-vide {
    padding: var(--space-4);
  }

  .mk-vide-t {
    margin: 0 0 var(--space-2);
    font-size: 17px;
  }

  .mk-vide-p {
    margin: 0 0 var(--space-2);
    color: var(--color-text-muted);
    font-size: 14.5px;
  }

  .mk-vide-liens {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  /* ---------- course : le bandeau ---------- */
  .mk-hero .course-hero-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    flex-wrap: wrap;
  }

  .mk-compte {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #dff3e6;
    color: #12351f;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
  }

  .mk-compte svg {
    width: 14px;
    height: 14px;
  }

  .mk-hero-ico {
    width: 15px;
    height: 15px;
  }

  /* ---------- titres de sections ---------- */
  .mk-h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 var(--space-3);
    font-size: 17px;
    font-weight: 700;
  }

  .mk-h2 svg {
    width: 19px;
    height: 19px;
  }

  .mk-h2-n {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--color-text-muted);
  }

  /* ---------- les cartes ---------- */
  .mk-partants,
  .mk-courses,
  .mk-next {
    margin-bottom: var(--space-2);
    padding: var(--space-4);
  }

  .mk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
  }

  .mk-table th {
    padding: 7px 5px;
    border-bottom: 2px solid #14663c;
    background: var(--color-surface-soft);
    font-size: 11px;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .mk-table td {
    padding: 7px 5px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
  }

  .mk-table td + td,
  .mk-table th + th {
    border-left: 1px solid var(--color-border);
  }

  .mk-td-place {
    width: 34px;
    font-weight: 700;
  }

  .mk-td-nom {
    font-weight: 700;
    text-transform: uppercase;
  }

  .mk-tr-np td {
    color: var(--color-text-muted);
  }

  .mk-tr-moi td {
    background: #fff1cf;
    color: #7a5200;
    font-weight: 700;
  }

  .mk-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    border-radius: var(--radius-md);
    background: #1d2540;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
  }

  /* ---------- partants ---------- */
  .mk-partants {
    padding: var(--space-4) var(--space-3);
  }

  .mk-partants-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding: 0 4px;
  }

  .mk-partant {
    display: flex;
    gap: 10px;
    padding: 10px 6px 11px 4px;
    border-top: 1px solid var(--color-border);
  }

  .mk-partant:nth-child(even) {
    background: #eef7f1;
  }

  /* le non-partant : la ligne rouge des partants du site, recopiée de race-shared.css (.partants-row-np,
     .partants-mobile-card-np pour la pastille du numéro, .partants-inline-np, .partants-np-pill) — Xavier,
     21/11/2026 : « fais comme le site turf ! pour les NP une ligne rouge comme ça » (avant : la carte pâlie) */
  .mk-partant.is-np,
  .mk-partant.is-np:nth-child(even) {
    background: var(--color-danger);
    color: var(--color-text-inverse);
  }

  .mk-partant.is-np .mk-num {
    background: var(--color-surface);
    color: var(--color-danger);
  }

  .mk-partant.is-np .mk-partant-nom,
  .mk-partant.is-np .mk-lbl-j,
  .mk-partant.is-np .mk-lbl-e {
    color: var(--color-text-inverse);
  }

  .mk-partant.is-np .mk-partant-meta {
    color: var(--palette-white-a95);
  }

  .mk-partant-cas {
    position: relative;
    flex: 0 0 54px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
  }

  .mk-partant-cas img {
    width: 46px;
    height: 46px;
    object-fit: contain;
  }


  .mk-partant-main {
    flex: 1;
    min-width: 0;
  }

  .mk-partant-top {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .mk-partant-nom {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: #131d33;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mk-partant-meta {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 12px;
    color: #788299;
    white-space: nowrap;
  }

  /* « NP » à côté du nom : la pastille orange du site (.partants-inline-np) */
  .mk-np {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--palette-orange-500d);
    color: var(--color-text-inverse);
    font-size: var(--font-size-11);
    line-height: var(--text-tight-height);
    font-weight: var(--text-extrabold-weight);
    text-transform: uppercase;
  }

  /* « NP » à la place de la cote : la pastille blanche du site (.partants-np-pill) */
  .mk-np-pill {
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-danger);
    font-size: var(--font-size-sm);
    font-weight: var(--text-extrabold-weight);
    letter-spacing: 0.06em;
  }

  .mk-partant-l {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 12.5px;
  }

  .mk-lbl-j {
    color: #d52038;
    font-weight: 700;
  }

  .mk-lbl-e {
    color: #15622c;
    font-weight: 700;
  }

  /* les cotes (le chef d'orchestre, api.php) : les valeurs de la carte des partants du site
     (.partants-mobile-cote, .partants-favori-label de race-shared.css) */
  .mk-partant-cote {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--color-danger);
    font-size: 17px;
    line-height: var(--text-tight-height);
    font-weight: var(--text-extrabold-weight);
    white-space: nowrap;
  }

  .mk-partant-cote.is-favori {
    color: var(--palette-green-800l);
  }

  .mk-partant-favori {
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--palette-green-800l);
    text-transform: uppercase;
    font-size: var(--font-size-10);
    font-weight: var(--text-bold-weight);
    letter-spacing: 0.06em;
  }

  /* la musique sur UNE ligne, même longue : c'est elle qui défile de côté, jamais la page (Xavier 02/10/2026 : « la
     musique doit pas avoir de retour à la ligne ! ça doit être sur la même ligne même si on doit scroller la musique
     horizontalement ») ; sans barre de défilement, comme une rangée de l'appli */
  .mk-mus-liste {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 7px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .mk-mus-liste::-webkit-scrollbar {
    display: none;
  }

  .mk-mus-liste > * {
    flex: 0 0 auto;
  }

  .mk-mus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 19px;
    padding: 0 5px;
    border-radius: 7px;
    font-size: 9.5px;
    font-weight: 700;
  }

  .mk-mus--gagne { background: #1d883d; color: #fff; }
  .mk-mus--place { background: #4a90d9; color: #fff; }
  .mk-mus--autre { background: #e9ecef; color: #616b7f; }
  .mk-mus--annee { background: #fff; border: 1px dashed #f4b729; color: #bf8600; }
  .mk-mus-vide { color: #616b7f; font-weight: 700; line-height: 19px; }
  .mk-mus-lib { font-size: 12px; font-weight: 700; line-height: 19px; color: #616b7f; margin-right: 2px; }

  .mk-mus-liste--grande .mk-mus {
    min-width: 34px;
    height: 21px;
    font-size: 10.5px;
  }

  /* ---------- fiche cheval ---------- */
  .mk-fiche {
    padding: var(--space-4);
  }

  .mk-music {
    margin-top: var(--space-3);
  }

  .mk-next-eb {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: #14663c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mk-next-b {
    display: flex;
    gap: 12px;
  }

  .mk-next-date {
    flex: 0 0 62px;
    align-self: flex-start;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    overflow: hidden;
    text-align: center;
  }

  .mk-next-date b {
    display: block;
    padding: 4px 0;
    background: #166b3c;
    color: #fff;
    font-size: 22px;
  }

  .mk-next-date span {
    display: block;
    padding-top: 3px;
    font-size: 13px;
    font-weight: 700;
  }

  .mk-next-date em {
    display: block;
    padding-bottom: 4px;
    font-size: 12px;
    font-style: normal;
    color: var(--color-text-muted);
  }

  .mk-next-t {
    min-width: 0;
  }

  .mk-next-n {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .mk-next-n b {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mk-next-ch {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
  }

  .mk-next-ch span {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
  }

  .mk-next-go {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    margin-top: var(--space-3);
    border-radius: var(--radius-md);
    background: #1f5f36;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
  }

  .mk-crs {
    margin: 0 calc(-1 * var(--space-4)) var(--space-2);
    border-top: 8px solid var(--color-surface-canvas);
  }

  .mk-crs-h {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px var(--space-4);
    background: #eef7f1;
    border-left: 4px solid #166b3c;
    color: #166b3c;
  }

  .mk-crs-h > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }

  .mk-crs-t {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
  }

  .mk-crs-t b {
    font-size: 15px;
    line-height: 1.2;
  }

  .mk-crs-t span {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .mk-crs-rank {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 3px 8px;
    border: 2px solid #ef4444;
    border-radius: var(--radius-md);
    background: #fff;
    color: #dc2626;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
  }

  .mk-crs-rank--gagne { border-color: #1d883d; color: #1d883d; }
  .mk-crs-rank--place { border-color: #f4b729; color: #bf8600; }
  .mk-crs-rank--np { border-color: var(--color-border-strong); color: var(--color-text-muted); }

  .mk-crs-rank sup {
    font-size: 10px;
  }

  .mk-crs .mk-table {
    width: calc(100% - 2 * var(--space-4));
    margin: 0 var(--space-4);
  }

  .mk-crs-desc {
    margin: var(--space-2) var(--space-4);
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--color-surface-soft);
    font-size: 12.5px;
    color: var(--color-text-muted);
    line-height: 1.4;
  }

  .mk-crs-lien {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 4px var(--space-4) var(--space-3);
    color: #14663c;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }

  .mk-crs-lien svg {
    width: 16px;
    height: 16px;
  }
}

@layer modules {
  .mk-pub[hidden] {
    display: none;
  }
}

/* Les boutons et pastilles de course-day.css lisent --cd-accent : sur la page
   Programme il est posé par .layout-course-day ; ici, on le pose nous-mêmes
   (vert du thème), sinon le bouton « Partants » est blanc sur blanc. */
@layer modules {
  .layout-sorec {
    --cd-accent: #166b3c;
    --cd-accent-soft: #e9f5ee;
    --cd-accent-strong: #0f4a2b;
  }

  /* Toutes les pages du Maroc : leur première carte collée au header, comme la page course du site
     (.layout.layout-course) — sans les 14 px de .layout, qui faisaient une bande grise (Xavier 30/09/2026 pour la
     course, 02/10/2026 pour la réunion : « y a encore du gris entre le fil d'Ariane et le header ! ») */
  .layout.layout-sorec {
    margin-top: 0;
  }

  /* … et, collée au header, ses coins du haut DROITS : arrondis, ils laissaient voir le fond gris contre le vert du
     header (Xavier 02/10/2026 : « faut virer ces merdes d'arrondis ! ») */
  .layout-sorec .mk-top,
  .layout-sorec .mk-hero {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

/* ==========================================================================
   L'analyse du Quinté+ marocain, sous les partants (Xavier 29/09/2026) :
   .mkq-analyse (photo, texte, signature), .mkq-prono (4 groupes, favori,
   coup de cœur, « Jouer ce pronostic »), .mkq-video. Maquettes validées
   (téléphone et ordinateur) ; le texte va jusqu'au bord de la carte.
   ========================================================================== */
@layer modules {
  .mkq {
    margin-top: var(--space-2);
    padding: var(--space-4) var(--space-3);
  }

  .mkq .mk-partants-head {
    margin-bottom: 4px;
  }

  /* — l'analyse — */
  .mkq-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 4px 0 var(--space-3);
    border-radius: var(--radius-lg);
  }

  /* le sous-titre en LÉGENDE de la photo (Xavier 15/11/2026) : collé sous elle, centré, plus petit que le texte,
     comme dans les journaux ; la marge du bas de la photo passe sous la légende */
  .mkq-figure {
    margin: 4px 0 var(--space-3);
  }

  .mkq-figure .mkq-photo {
    margin: 0;
  }

  .mkq-legende {
    margin: 6px 0 0;
    padding: 0 4px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--color-text-muted);
    text-align: center;
    overflow-wrap: anywhere;
  }

  .mkq-texte {
    padding: 0 4px;
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text, #1f2937);
    overflow-wrap: anywhere;
  }

  .mkq-texte h3 {
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #166b3c;
  }

  .mkq-texte h3:first-child {
    margin-top: 0;
  }

  .mkq-texte p {
    margin: 0 0 12px;
  }

  .mkq-texte a {
    color: #166b3c;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
  }

  .mkq-signature {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 14px 4px 0;
    padding-top: 10px;
    border-top: 1px solid var(--color-border);
    font-size: 13.5px;
    color: var(--color-text-muted);
  }

  .mkq-signature span:first-child {
    font-weight: 700;
    font-style: italic;
    color: var(--color-text, #1f2937);
  }

  /* — le pronostic — */
  .mkq-groupe {
    margin: 14px 0 6px;
    padding: 7px 12px;
    border-radius: var(--radius-md);
    background: #e9f5ee;
    color: #166b3c;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .mkq-cheval {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .mkq-cheval:has(+ .mkq-groupe),
  .mkq-cheval:has(+ .mkq-duo),
  .mkq-cheval:last-child {
    border-bottom: 0;
  }

  .mkq-cheval img {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    object-fit: contain;
  }

  .mkq-cheval div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .mkq-cheval b {
    font-size: 15.5px;
    font-weight: 800;
  }

  .mkq-cheval b span {
    font-weight: 600;
    color: var(--color-text-muted);
  }

  .mkq-cheval div > span {
    font-size: 15px;
    line-height: 1.4;
    color: var(--color-text-muted);
  }

  .mkq-np {
    margin-left: 6px;
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
    color: #b42318;
  }

  .mkq-duo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-top: 16px;
  }

  .mkq-tuile {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
  }

  .mkq-tuile-t {
    margin: 0;
    padding: 7px 10px;
    background: #166b3c;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: center;
    text-transform: uppercase;
  }

  .mkq-tuile--coeur .mkq-tuile-t {
    background: #d52038;
  }

  .mkq-tuile-c {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px 12px;
    text-align: center;
  }

  .mkq-tuile-c img {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .mkq-tuile-c b {
    font-size: 14.5px;
    font-weight: 800;
  }

  .mkq-jouer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    margin-top: 14px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    background: #d52038;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
  }

  .mkq-jouer:hover {
    background: #b91c30;
    color: #fff;
  }

  .mkq-jouer svg {
    width: 22px;
    height: 22px;
  }

  /* — la vidéo — */
  .mkq-video-cadre {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #111;
  }

  .mkq-video-cadre iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }

  /* — la rédaction : les pages à un seul message (réservé aux journalistes, rien à montrer) — */
  .mkq-message p {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.5;
  }

  .mkq-message-lien {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-md);
    background: #166b3c;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
  }

  .mkq-message-lien:hover {
    background: #0f5a31;
    color: #fff;
  }

  /* ordinateur : la photo et la vidéo ne prennent pas tout l'écran ; le texte, lui, va jusqu'au bord */
  @media (min-width: 901px) {
    .mkq-photo {
      max-height: 420px;
    }

    .mkq-video-cadre {
      max-width: 880px;
      margin: 0 auto;
    }

    .mkq-duo,
    .mkq-jouer {
      max-width: 680px;
      margin-left: auto;
      margin-right: auto;
    }
  }
}

/* ==========================================================================
   Les pages du Maroc à la STRUCTURE de l'ancien turf-fr.com (Xavier 30/09/2026,
   « on a un deal de présentation » ; maquettes v2 validées le 01/10/2026) : la
   réunion (une carte par course), le haut de la page d'une course (course
   précédente / suivante), ses onglets, MR TURF et l'ordinateur présentés comme
   l'ancien site, les Stats, les Rapports, la page du Quinté, la fiche cheval.
   ========================================================================== */
@layer modules {
  /* ---------- la réunion : une carte par course ---------- */
  .mk-rc {
    position: relative;
    padding: 0;
    overflow: hidden;
    margin-bottom: var(--space-2);
  }

  /* la course du Quinté, comme l'ancien site (Xavier, 01/10/2026) : l'étiquette en haut à gauche de la photo, ROUGE
     écrite en blanc, du rouge du logo Quinté+ (Xavier, 02/10/2026 : « pastille rouge écriture blanche ») … */
  .mk-rc-tag {
    position: absolute;
    z-index: 2;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--palette-red-500e);
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-decoration: none;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.25);
  }

  .mk-rc-tag:hover,
  .mk-rc-tag:focus-visible {
    background: #b10f2e;
    color: #fff;
  }

  /* la pastille du départ (en bas à droite de la photo, la place de l'arrivée) : les chiffres ne bougent pas en tournant */
  .mk-rc-badge--depart b {
    font-variant-numeric: tabular-nums;
  }

  /* … et l'encadré : Produits, Allocation, Distance, Partants, sur 2 colonnes au téléphone, sur une ligne sur ordinateur */
  .mk-rc-resume {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 14px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
  }

  .mk-rc-resume > div {
    min-width: 0;
    padding: 9px 12px;
    border-bottom: 1px solid var(--color-border);
  }

  .mk-rc-resume > div:nth-child(odd) {
    border-right: 1px solid var(--color-border);
  }

  .mk-rc-resume > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .mk-rc-resume dt {
    margin: 0 0 2px;
    color: var(--color-text-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .mk-rc-resume dd {
    margin: 0;
    color: #131d33;
    font-size: 15px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  /* l'ordinateur (la même page, plus large ; les visiteurs du Maroc sont au téléphone, mais elle doit rester propre) */
  @media (min-width: 900px) {
    .mk-rc-resume {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mk-rc-resume > div {
      border-right: 1px solid var(--color-border);
      border-bottom: 0;
    }

    .mk-rc-resume > div:last-child {
      border-right: 0;
    }
  }

  /* la photo : une vraie image, chargée à la demande (en fond, les 8 d'une réunion partaient d'un coup) */
  .mk-rc-photo {
    position: relative;
    display: block;
    height: 150px;
    overflow: hidden;
    background-color: #1f5f36;
  }

  .mk-rc-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mk-rc-badge {
    position: absolute;
    z-index: 1;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: 999px;
    background: #fff;
    color: #14663c;
    font-size: 13.5px;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }

  .mk-rc-badge svg {
    width: 15px;
    height: 15px;
  }

  .mk-rc-tete {
    padding: 12px 14px 8px;
  }

  .mk-rc-titre {
    margin: 0 0 9px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
  }

  .mk-rc-titre a {
    color: #131d33;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .mk-reunion-t {
    margin: var(--space-4) 4px var(--space-2);
    font-size: 17px;
    font-weight: 800;
    text-transform: uppercase;
  }

  /* les paris : les pastilles des pages course du site (race-shared.css), en entier sur une ou deux lignes */
  .mk-paris {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .mk-paris .course-pari-pill {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 24px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: 11.5px;
  }

  .mk-paris .course-pari-pill-label {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }

  .mk-rc-partants {
    padding: 0 8px;
  }

  .mk-rc-actions,
  .mk-quinte-etat {
    display: flex;
    gap: 10px;
    padding: 12px 14px 16px;
  }

  .mk-quinte-etat {
    flex-wrap: wrap;
    align-items: center;
    padding: 4px 0 0;
  }

  .mk-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
  }

  .mk-action svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

  .mk-action--prono {
    background: #14663c;
    color: #fff;
  }

  .mk-action--parier {
    background: #c62828;
    color: #fff;
  }

  .mk-quinte-etat .mk-action {
    flex: 0 0 auto;
  }

  /* ---------- la course : le haut de l'ancien site ---------- */
  .mk-nav {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 6px;
    margin: 10px 0 4px;
  }

  .mk-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.28);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
  }

  .mk-nav-btn svg {
    width: 16px;
    height: 16px;
  }

  .mk-nav-btn.is-vide {
    visibility: hidden;
  }

  .mk-nav-t {
    text-align: center;
    min-width: 0;
  }

  .mk-nav-t span {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  .mk-nav-t .course-hero-title {
    margin: 3px 0 0;
    font-size: 20px;
    line-height: 1.15;
  }

  .mk-hero-meta {
    justify-content: center;
    text-align: center;
    margin: 6px 0 0;
  }

  .mk-hero-bas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
  }

  .mk-arr {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: #fff;
    color: #14663c;
    font-size: 13.5px;
    font-weight: 700;
  }

  .mk-arr b {
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .mk-arr svg {
    width: 15px;
    height: 15px;
  }

  .mk-arr--clair {
    background: #e9f5ee;
  }

  /* ---------- les onglets ---------- */
  /* les onglets et leur contenu ne font qu'UN bloc blanc : ni marge, ni coins arrondis à la jonction, ni ombre
     (l'ombre de la carte des onglets dessinait une bande grise sur le contenu) — Xavier, 01/10/2026 : « enlève le
     gris entre les onglets et le contenu dessous des partants, pronostics, stats » */
  .mk-onglets {
    display: flex;
    padding: 0;
    margin-bottom: 0;
    overflow: hidden;
    scroll-margin-top: 76px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
  }

  .mk-onglets + .card {
    margin-top: 0;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }

  .mk-onglet {
    flex: 1;
    padding: 14px 4px 11px;
    border-bottom: 3px solid transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
  }

  .mk-onglet.is-on {
    color: #14663c;
    border-bottom-color: #14663c;
    background: #f3faf6;
  }

  .mk-panneau {
    padding: var(--space-4) var(--space-3);
    margin-bottom: var(--space-2);
  }

  .mk-titre {
    margin: 18px 0 12px;
  }

  .mk-panneau > .mk-titre:first-child {
    margin-top: 0;
  }

  .mk-note {
    margin: 8px 0;
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.4;
  }

  .mk-note--centre {
    text-align: center;
  }

  /* ---------- MR TURF et l'ordinateur : la présentation de l'ancien site (bandes vertes, lignes grises) ---------- */
  .mk-pronos {
    padding: var(--space-3);
  }

  .mk-bande {
    margin: 0 0 6px;
    padding: 9px 12px;
    border-radius: 6px;
    background: var(--palette-green-600);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.3;
    text-align: center;
    text-transform: uppercase;
  }

  .mk-bande:not(:first-child) {
    margin-top: 18px;
  }

  .mk-lp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
    margin: 0 0 4px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #eceef1;
  }

  .mk-lp-l {
    color: #5f6570;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-align: right;
    text-transform: uppercase;
  }

  .mk-lp-n {
    color: var(--palette-green-600);
    font-size: 16px;
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  .mk-ordi-n {
    margin: 12px 0 6px;
    color: var(--palette-green-600);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
  }

  /* ---------- le Quinté : le début de l'analyse et le lien vers sa page ---------- */
  .mk-suite {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
    color: #166b3c;
    font-size: 15px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .mk-suite svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
  }

  .mkq-prono > .mkq-groupe:first-child {
    margin-top: 0;
  }

  .mk-partants--onglet {
    padding-top: var(--space-2);
  }

  .mk-extrait .mkq-texte p:last-child {
    margin-bottom: 8px;
  }

  /* le haut de l'article, comme l'ancien site : le titre dans la bande verte, la photo, puis « Partager sur
     Facebook » à gauche et le sous-titre (Xavier 01/10/2026, « 2A ») */
  .mk-extrait-titre {
    margin-bottom: var(--space-3);
    overflow-wrap: anywhere; /* un titre fait d'un seul long mot passe à la ligne au lieu d'être coupé (audit du 2A) */
  }

  .mk-article-tete {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    margin: 0 4px var(--space-3);
  }

  .mk-partage-fb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 6px;
    background: #1877f2;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
  }

  .mk-partage-fb:hover,
  .mk-partage-fb:focus-visible {
    background: #0f64d3;
    color: #fff;
  }

  .mk-partage-fb svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
  }

  /* « Partager sur / Facebook » sur deux lignes, comme le bouton de l'ancien site : le sous-titre garde la place */
  .mk-partage-fb span {
    font-size: 11.5px;
    line-height: 1.2;
    text-align: left;
  }

  .mk-sous-titre {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: #3f4a5c;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.35;
    text-align: center;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }

  /* ---------- Stats ---------- */
  .mk-histo-l {
    padding: 10px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .mk-histo-t {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }

  .mk-histo-t b {
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mk-histo-t span:last-child {
    margin-left: auto;
    color: #788299;
    font-size: 12px;
    white-space: nowrap;
  }

  .mk-histo-cas {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    object-fit: contain;
  }

  .mk-histo-ap {
    margin: 6px 0 0;
    color: var(--color-text-muted);
    font-size: 12.5px;
    line-height: 1.4;
  }

  /* les gains (dernière case) en plus large : « 2 477 000 » sortait de sa case à 360 et 390 px (audit du 01/10/2026) */
  .mk-histo-c {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.6fr);
    gap: 4px;
    margin: 8px 0 4px;
  }

  .mk-histo-c span {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text-muted);
    font-size: 11px;
  }

  .mk-histo-c b {
    color: #131d33;
    font-size: 14px;
    white-space: nowrap;
  }

  .mk-pab {
    font-size: 12px;
  }

  .mk-pab th,
  .mk-pab td {
    padding: 6px 4px;
  }

  .mk-ligne {
    padding: 10px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .mk-ligne-t b {
    display: block;
    font-size: 13.5px;
  }

  .mk-ligne-t span {
    color: var(--color-text-muted);
    font-size: 12.5px;
  }

  .mk-ligne-o {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
  }

  .mk-ligne-c {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
  }

  .mk-ligne-sep {
    color: var(--color-text-muted);
    font-size: 11px;
  }

  /* ---------- Rapports ---------- */
  .mk-rapport {
    margin-top: 12px;
  }

  .mk-rapport thead tr:first-child th {
    background: #1d2540;
    color: #fff;
    text-align: center;
  }

  .mk-numplus {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #fff;
    color: #1d2540;
    font-size: 11px;
    font-weight: 800;
    vertical-align: 1px;
  }

  /* ---------- la fiche cheval ---------- */
  .mk-fiche .fc-head-id {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mk-fiche-cas {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    flex: 0 0 auto;
  }

  .mk-fiche-par {
    margin: 2px 0 0;
    color: var(--color-text-muted);
    font-size: 13.5px;
  }

  .mk-carriere {
    margin-top: 12px;
  }

  .mk-crs-table {
    font-size: 12px;
  }

  .mk-crs-table th,
  .mk-crs-table td {
    padding: 6px 4px;
  }

  @media (min-width: 900px) {
    .mk-rc-photo {
      height: 200px;
    }

    .mk-nav {
      grid-template-columns: 90px minmax(0, 1fr) 90px;
    }

    .mk-nav-t .course-hero-title {
      font-size: 28px;
    }

    /* « Pronostic » et « Parier sur e-sorec » au CENTRE de la carte (Xavier, 01/10/2026 : « les boutons doivent être centrés ») */
    .mk-rc-actions {
      justify-content: center;
    }

    .mk-rc-actions .mk-action {
      flex: 0 0 auto;
      min-width: 220px;
    }
  }

  @media (max-width: 768px) {
    .mk-rc-actions .mk-action {
      font-size: 12.5px;
      padding: 0 8px;
    }

    .mk-rc-actions .mk-action--parier svg {
      display: none;
    }

    /* la carte a 12 px de marge intérieure sur téléphone : l'article la reprend exactement (il dépassait de 4 px) */
    .layout-sorec .mk-courses .mk-crs {
      margin-left: calc(-1 * var(--space-3));
      margin-right: calc(-1 * var(--space-3));
    }
  }
}
