/* ==========================================================================
   mcp-ticket · tk-base.css
   Mise en page propre aux gabarits du thème (zones, titres de page, texte long,
   éléments d'en-tête et de pied absents du design system). Jetons uniquement :
   aucune couleur en dur. Chargé juste après ticket.css.
   ========================================================================== */

/* ---------- Zones ---------- */
.tk-main { display: block; min-height: 50vh; padding-bottom: var(--sp-12); }
.tk-main--page > .tk-page > .entry-content,
.tk-main--fiche .entry-content { display: block; }

/* L'en-tête collant ne doit jamais masquer une ancre (#ca-grid, #avis, #lettre-A, #offre-x…). */
:where(#ca-grid, #avis, #faq, #conditions, #newsletter, [id^="lettre-"], [id^="offre-"], [id^="ca-part-"], #cercle-vertueux) { scroll-margin-top: 96px; }

/* ---------- Titre de page (seulement quand le contenu n'a pas de H1) ---------- */
.tk-page__head { padding-top: var(--sp-10); padding-bottom: var(--sp-5); }
.tk-page__title { font-size: var(--fs-2xl); font-weight: var(--fw-title); font-stretch: var(--wd-display); letter-spacing: var(--tr-display); }

/* ---------- Article ---------- */
.tk-article__head { padding-top: var(--sp-8); padding-bottom: var(--sp-4); }
.tk-article__title { font-size: var(--fs-2xl); font-weight: var(--fw-title); font-stretch: var(--wd-display); letter-spacing: var(--tr-display); max-width: 24ch; }
.tk-postnav { margin-top: var(--sp-10); }
.tk-postnav .nav-links { display: grid; gap: var(--sp-3); }
@media (min-width: 768px) { .tk-postnav .nav-links { grid-template-columns: 1fr 1fr; } .tk-postnav .nav-next { text-align: right; } }
.tk-postnav a { display: block; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; font-weight: 700; }
.tk-postnav .label { display: block; margin-bottom: 4px; color: var(--muted); }

/* ---------- Texte long saisi dans l'éditeur (pages légales, articles) ----------
   :where() garde une spécificité nulle : toute règle d'extrait l'emporte. */
/* Le CONTENEUR prend la largeur large du site (comme le conteneur d'Astra) ; seuls les enfants
   directs de TEXTE sont ramenés à la colonne de lecture (760 px). Avant, le conteneur entier était
   limité à 760 px dès qu'aucune racine d'extrait connue n'était présente : la grille 2 colonnes
   des articles (.ca-art de 101 : 1fr + 330 px + 54 px) tombait à ~330 px de lecture, et les pages
   classement, niveaux, méthode, à propos, signalement, publication, connexion, newsletter étaient
   resserrées. Les racines d'extrait (div, section…) gardent leurs propres largeurs.
   Les racines qui occupaient déjà toute la largeur, sans marge du thème, restent exclues. */
.tk-content:where(:not(:has(> .ca-wrap, > .cad-wrap, > .ca-dash, > .ca-prof, > .ca-hub, > .ca-top, > .ca-msg-wrap, > .cb2, > .ca-annu))) {
  max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter);
}
/* Meilleures offres (.ca-top, 415), baromètre (.cb2, 482) et annuaire des marques (.ca-annu, 194) n'ont pas de marge
   latérale à eux : sous Astra, le conteneur la donnait. Ils gardent leur largeur et reçoivent la gouttière (20/10/2026). */
/* Résultats de recherche (.ca-src de 154, imprimé directement dans <main>) : même gouttière. */
.tk-main--search > .ca-src { padding-inline: var(--gutter); box-sizing: border-box; }
.tk-content > :is(.ca-top, .cb2, .ca-annu),
.tk-content:has(> :is(.ca-top, .cb2, .ca-annu)) > :where(p, h2, h3, h4, h5, h6, ul, ol, dl, table, blockquote, figure, pre, hr, details) { padding-inline: var(--gutter); box-sizing: border-box; }
:where(.tk-content) > :where(p, h2, h3, h4, h5, h6, ul, ol, dl, table, blockquote, figure, pre, hr, details) {
  max-width: var(--container-narrow); margin-inline: auto;
}
.tk-content :where(p, ul, ol, table, figure, blockquote, pre) { margin-block: 0 1em; }
/* Une adresse ou un mot très long passe à la ligne au lieu d'élargir la page (Confidentialité, 360 px, 20/10/2026). */
.tk-content :where(p, li, dd) { overflow-wrap: break-word; }
.tk-content :where(h2) { margin-block: 1.6em .5em; font-size: var(--fs-xl); }
.tk-content :where(h3) { margin-block: 1.3em .4em; font-size: var(--fs-lg); }
.tk-content :where(ul, ol) { padding-left: 1.25em; }
.tk-content :where(a:not([class])) { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; }
.tk-content :where(img, svg) { display: inline-block; vertical-align: middle; }
.tk-content :where(figure img) { display: block; }

/* ---------- Commentaires d'articles ---------- */
.tk-comments { margin-top: var(--sp-10); }
.tk-comments__list { list-style: none; padding: 0; display: grid; gap: var(--sp-4); }

/* ---------- Archives de secours ---------- */
.tk-archive { padding-top: var(--sp-8); }
.tk-archive__list { list-style: none; margin: var(--sp-5) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.tk-archive__list a { display: flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; font-weight: 700; }

/* ---------- Menu mobile : panneau Catégories (remplace celui de 115) ---------- */
.tk-mcats { margin-top: var(--sp-4); border-top: 1px dashed var(--line-2); padding-top: var(--sp-3); }
.tk-mcats > summary { display: flex; align-items: center; min-height: var(--tap); cursor: pointer; list-style: none; }
.tk-mcats > summary::-webkit-details-marker { display: none; }
.tk-mcats > summary::after { content: "+"; margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-md); }
.tk-mcats[open] > summary::after { content: "−"; }
.tk-mcats__list a { display: flex; justify-content: space-between; gap: var(--sp-2); }

/* ---------- En-tête et barre basse de l'extrait 115 ----------
   Sur téléphone (≤ 782 px), la barre basse de 115 a un onglet « Recherche » qui ouvre la recherche
   du thème (tk-theme.js) : la loupe de l'en-tête s'efface pour laisser la place au bouton « Publier ».
   Sans cette barre (115 retiré un jour), la loupe revient ; sur les plus petits écrans, seul le nom
   du logo s'efface alors (la pastille ✓ reste, le lien garde son nom complet). */
@media (max-width: 782px) { body.tk-has-navmob .hdr .msearch-btn { display: none; } }
@media (max-width: 430px) { body:not(.tk-has-navmob) .hdr .logo__word { display: none; } }

/* ---------- Pied : badge Répertoire Claude, note de lancement ---------- */
.tk-claude { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); font-size: var(--fs-xs); color: inherit; text-decoration: none; opacity: .85; }
.tk-claude:hover { opacity: 1; text-decoration: underline; }
.tk-claude__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* Le même badge dans le contenu de la page Assistants IA (remplace un badge aux couleurs écrites dans la page, or et
   bleu nuit en !important) : pastille au dégradé d'accent, texte à l'encre de l'accent (5,8:1 Soleil, 17:1 Matrix). */
body.tk-site .entry-content .tk-badge-claude-p { margin: 18px 0 8px; }
body.tk-site .entry-content a.tk-badge-claude { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; background: var(--accent-fill, var(--accent)); color: var(--on-accent); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.2; box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
body.tk-site .entry-content a.tk-badge-claude:hover { text-decoration: underline; text-underline-offset: .2em; }
body.tk-site .entry-content .tk-badge-claude__dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
body.tk-site .entry-content .tk-badge-claude__sub { font-weight: 500; font-size: 13px; }
.ftr .ca-footer-note { margin: var(--sp-4) 0 0; font-size: var(--fs-xs); color: var(--ftr-muted); }


/* ---------- Assistant « Trouve ton code » (étape 5) : le bouton en bas à droite ----------
   Le panneau a sa propre feuille (tk-assistant.css), chargée à la demande avec son script (inc/assistant.php).
   Le bouton reste masqué ([hidden]) tant que tk-theme.js ne l'a pas branché. Sur téléphone, il se pose au-dessus de la
   barre du bas de l'extrait 115 (64 px). Sous le menu du thème (--z-menu) et les fenêtres des extraits. */
.tk-ast { position: fixed; z-index: 55; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
.tk-ast[hidden] { display: none; }
.tk-ast__btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; margin: 0; padding: 0 20px 0 14px; border-radius: var(--r-pill);
  border: 1.5px solid var(--tk-ink); background: var(--accent-fill, var(--accent)); background-origin: border-box; color: var(--on-accent);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .45); cursor: pointer;
  font-family: var(--font-sans); font-size: var(--fs-sm); font-weight: var(--fw-strong); font-stretch: var(--wd-title); line-height: 1; letter-spacing: 0; text-transform: none;
  transition: transform var(--dur-1), background var(--dur-1);
}
.tk-ast__ic { width: 30px; height: 21px; flex: none; }
.tk-ast__ic .t { fill: currentColor; }
.tk-ast__ic .c { stroke: var(--accent); }
@media (hover: hover) and (pointer: fine) { .tk-ast__btn:hover { background: var(--accent-fill-hover, var(--accent-hover)); transform: translateY(-1px); } }
.tk-ast__btn:active { transform: translateY(1px); }
.tk-ast__btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.tk-ast__btn[aria-busy="true"] { cursor: progress; }
@media (max-width: 782px) {
  body.tk-has-navmob .tk-ast { bottom: calc(64px + 12px + env(safe-area-inset-bottom)); }
  .tk-ast__btn { min-height: 48px; padding: 0 16px 0 12px; }
  .tk-ast.is-open .tk-ast__btn { visibility: hidden; }
}
/* Ordinateur et tablette : un rond de 48 px, le libellé en bulle au survol ou au clavier (retouche de Kevinoo, 21/10 :
   le bouton ne doit plus masquer un ticket). À partir de 1280 px, le rond tient dans la marge de droite, à côté du
   contenu (1136 px au centre) : il ne chevauche jamais rien et reste affiché. En dessous, il n'apparaît qu'après
   défilement (tk-theme.js). */
@media (min-width: 783px) {
  .tk-ast { right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .tk-ast__btn { position: relative; justify-content: center; width: 48px; height: 48px; min-height: 48px; padding: 0; border-radius: 50%; }
  .tk-ast__ic { width: 26px; height: 18px; }
  .tk-ast__lib {
    position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%); padding: 8px 12px; border-radius: var(--r-md);
    background: var(--surface-inverse); color: var(--ink-inverse); white-space: nowrap; font-size: var(--fs-sm); line-height: 1.2;
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--dur-1), visibility 0s linear var(--dur-1);
  }
  .tk-ast__btn:is(:hover, :focus-visible) .tk-ast__lib { opacity: 1; visibility: visible; transition: opacity var(--dur-1), visibility 0s; }
  .tk-ast.is-open .tk-ast__lib { opacity: 0; visibility: hidden; }
}
/* Sous 1280 px, le bouton reste caché au premier écran et s'efface en descendant (tk-theme.js) : il ne cache ni le texte
   ni les boutons « Copier » des tickets ; il revient quand on remonte, une fois le premier écran passé. */
.tk-ast { transition: transform var(--dur-2), opacity var(--dur-2), visibility 0s; }
.tk-ast.tk-ast--cache { transform: translateY(24px); opacity: 0; visibility: hidden; transition: transform var(--dur-2), opacity var(--dur-2), visibility 0s linear var(--dur-2); }
@media (prefers-reduced-motion: reduce) { .tk-ast, .tk-ast.tk-ast--cache { transform: none; transition: none; } }
@media (prefers-reduced-motion: reduce) { .tk-ast__btn { transition: none; } .tk-ast__btn:hover, .tk-ast__btn:active { transform: none; } }
@media print { .tk-ast { display: none; } }

/* Survol du menu principal : plus de fond surligné (demande de Kevinoo, 20/10/2026). La page en cours garde son trait
   à l'accent, le clavier garde son contour de focus. */
body.tk-site .hdr .nav__link:hover { background: none; }

/* ---------- Titres : le dégradé est dans l'écriture, plus de surligneur (décision de Kevinoo, 20/10/2026) ----------
   La bande de couleur derrière les mots-clés des titres (accueil, fiches, blog, profils, espace membre) et le H1 des
   formulaires (« Publier un code de parrainage ») passent en lettres dégradées (background-clip: text), aux couleurs
   du thème et du mode. Contraste de chaque teinte sur le fond de la page, au moins 4,5:1 même pour les petits titres
   (« Bonjour … » de l'espace membre, titres sur téléphone ; 21/10 : fin du Soleil clair foncée, #d9480f faisait 4,1) :
   Soleil clair #b3340a 5,8 → #c2410c 4,9 · Soleil sombre #ff6a2b 6,6 → #ffc21a 11,6 ·
   Matrix clair #14532d 8,0 → #1a7f37 4,5 · Matrix sombre #d7ff3a 17,3 → #3dffa0 15,2.
   Sans background-clip: text (ou en contraste forcé) : la première teinte, pleine. Aucun texte ne change. */
:root { --tk-titre-a: #b3340a; --tk-titre-b: #c2410c; }
:root[data-theme="dark"] { --tk-titre-a: #ff6a2b; --tk-titre-b: #ffc21a; }
:root[data-skin="matrix"] { --tk-titre-a: #14532d; --tk-titre-b: #1a7f37; }
:root[data-skin="matrix"][data-theme="dark"] { --tk-titre-a: #d7ff3a; --tk-titre-b: #3dffa0; }
/* Étoiles et petites icônes à l'accent posées sur une surface claire : en Matrix clair, le vert acide ne se voit pas sur
   blanc (1,0:1) ; elles passent à l'encre. Partout ailleurs, l'accent du thème (orange en Soleil, vert en Matrix sombre). */
:root { --tk-accent-ico: var(--accent); }
:root[data-skin="matrix"][data-theme="light"] { --tk-accent-ico: var(--ink); }
body.tk-site :is(.ca-hero-title .ca-ht-key, .caf-h1 .caf-h1-gain, .ca-news-h1 .ca-ht-acc, .ca-prof-h1 span, .ca-dash-welcome span, .ca-form-page .ca-legal-hero h1) {
  padding: 0; border-radius: 0; box-shadow: none; background: none; color: var(--tk-titre-a); -webkit-text-fill-color: currentColor;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  body.tk-site :is(.ca-hero-title .ca-ht-key, .caf-h1 .caf-h1-gain, .ca-news-h1 .ca-ht-acc, .ca-prof-h1 span, .ca-dash-welcome span, .ca-form-page .ca-legal-hero h1) {
    background-image: linear-gradient(100deg, var(--tk-titre-a) 0%, var(--tk-titre-b) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
}
@media (forced-colors: active) {
  body.tk-site :is(.ca-hero-title .ca-ht-key, .caf-h1 .caf-h1-gain, .ca-news-h1 .ca-ht-acc, .ca-prof-h1 span, .ca-dash-welcome span, .ca-form-page .ca-legal-hero h1) { background: none; -webkit-text-fill-color: CanvasText; color: CanvasText; }
}
/* « Publier un code de parrainage » (et les autres formulaires) : taille raisonnable, comme le titre de l'accueil */
body.tk-site.tk-lot-formulaires .ca-form-page .ca-legal-hero h1 { font-size: clamp(1.625rem, 1.1rem + 1.7vw, 2.5rem); line-height: 1.06; }
/* Titre du blog : même taille raisonnable que celui de l'accueil */
body.tk-site.tk-lot-editorial .ca-news-h1 { max-width: 28ch; font-size: clamp(1.5rem, 1.05rem + 1.6vw, 2.5rem); line-height: 1.06; }

/* ---------- Fil d'Ariane des pages du menu et des catégories (inc/fil.php, Kevinoo 23/10/2026) ----------
   « Accueil > Page » : maison + chevron, petit et discret, juste au-dessus du titre. Même largeur que le contenu. */
.tk-fil { width: 100%; max-width: var(--container); margin: 0 auto; padding: var(--sp-3) var(--gutter) 0; }
.tk-fil__l { display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-xs); line-height: 1.3; color: var(--muted); }
.tk-fil__i { display: inline-flex; align-items: center; gap: 2px; min-width: 0; }
.tk-fil__a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 4px; color: var(--muted); text-decoration: none; }
.tk-fil__a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
@media (hover: hover) and (pointer: fine) { .tk-fil__a:hover { color: var(--ink); } }
.tk-fil__courant { padding: 0 4px; color: var(--ink-2); font-weight: var(--fw-strong); overflow-wrap: anywhere; }
.tk-fil :is(.tk-fil__maison, .tk-fil__sep) { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tk-fil__sep { opacity: .7; }

/* ---------- Application installable (inc/pwa.php, assets/js/tk-pwa.js) ----------
   Emplacements vides et cachés ([hidden]) : rien ne s'affiche tant que le navigateur ne propose pas
   l'installation (ou sur iPhone, avec l'aide). Classes propres au thème : aucune règle existante n'est reprise. */
.tk-app__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.tk-app__btn:hover { border-color: currentColor; }
.tk-app__btn .ic { width: 18px; height: 18px; flex: none; }
.tk-app__ios { margin-top: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-sm); max-width: 36ch; }
.tk-app__ios p { margin: 0; }
.tk-app__partage { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: 600; }
.tk-app__partage .ic { width: 16px; height: 16px; }
.tk-app--pied { font-size: var(--fs-xs); --line: var(--f-line); }
.tk-app--menu { grid-column: 1 / -1; font-size: var(--fs-sm); }
.tk-app--menu .tk-app__btn { width: 100%; }
.tk-app--menu .tk-app__ios { max-width: none; }
