/*
 * Blog : thème « Tunisie HUB » (code « classique ») de la page d'un article et de la liste du blog.
 * Vues : Views/blog/article-classique.php (article) et Views/blog/index.php (liste).
 *
 * Feuille CSS simple (pas de Tailwind) : aucune recompilation (bin\build-css.bat) n'est nécessaire.
 * Chargée par layouts/_article_theme.php quand le thème de l'article est « classique » (thème par défaut, et thème de la liste).
 * Maquette d'origine : docs/apercus/blog-preview3.html.
 *
 * COULEURS : aucune couleur en dur, sauf le blanc du texte posé sur un bouton ou une pastille de couleur. Tout vient des variables de la
 * charte (css/main.css) et de la palette choisie (css/modules/palettes.css, sélecteurs data-palette). Palette et mode sombre
 * s'appliquent donc sans aucune règle ici.
 *   --th-page    fond de la page : le fond du site légèrement teinté par la couleur douce de la palette
 *   --th-surface fond des cartes (sommaire, informations, questions) : le fond du site
 *   --th-link    couleur des textes et liens colorés : foncée en mode clair, claire en mode sombre
 *
 * TYPOGRAPHIE : Plus Jakarta Sans (titres et texte), comme le reste du site (chargée par _article_theme.php).
 * En arabe : Noto Sans Arabic.
 *
 * SENS D'ÉCRITURE : propriétés logiques (inline-start, inline-end…), donc l'arabe (dir="rtl") fonctionne sans règle dédiée.
 * Exceptions réglées plus bas : l'espacement des lettres, qui coupe les lettres arabes, et les capitales, qui n'existent pas.
 *
 * Classes : « article-* », les mêmes que le thème Rétro (article-retro.css). Une seule des deux feuilles est chargée par page.
 * Les cartes partagées (css/modules/blocks.css) lisent les variables --article-* : elles sont reliées à la charte juste dessous.
 *
 * Points de rupture (mobile d'abord) : 35rem (téléphone), 51.25rem (le sommaire passe sous le titre).
 */

[x-cloak] { display: none !important; }

body.article-shell {
  --th-page: color-mix(in srgb, var(--accent-soft) 30%, var(--bg));
  --th-surface: var(--bg);
  --th-text: color-mix(in srgb, var(--fg) 86%, var(--bg));
  --th-link: var(--titre-bleu);
  --th-shadow: 0 .75rem 2rem color-mix(in srgb, var(--accent-dark) 9%, transparent);

  /* Cartes partagées (blocks.css) : les noms « green » / « sand » sont historiques, ils désignent ici la couleur d'accent. */
  --article-ink: var(--fg);
  --article-muted: var(--muted);
  --article-paper: var(--th-page);
  --article-white: var(--th-surface);
  --article-line: var(--border);
  --article-green: var(--th-link);
  --article-green-soft: var(--accent-soft);
  --article-orange: var(--orange);
  --article-sand: var(--card-bg);
  --article-shadow: var(--th-shadow);

  min-height: 100vh;
  margin: 0;
  background: var(--th-page);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

html { scroll-padding-top: 5.75rem; }

.article-shell *, .article-shell *::before, .article-shell *::after { box-sizing: border-box; }

/* Focus clavier : le bleu garde les actions (charte). */
.article-shell a:focus-visible, .article-shell button:focus-visible, .article-shell summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ en-tête du site */
.article-site-header {
  position: sticky;
  z-index: 50;
  inset-block-start: env(safe-area-inset-top, 0px);
  border-block-end: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
}
.article-header-inner {
  display: flex;
  width: min(70rem, calc(100% - 2.5rem));
  min-height: 4.25rem;
  align-items: center;
  justify-content: space-between;
  margin-inline: auto;
}
.article-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--fg);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
}
.article-brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: .5625rem;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  letter-spacing: 0;
}
.article-brand-name span { color: var(--th-link); }
.article-header-links { display: flex; align-items: center; gap: 1.6rem; }
.article-header-links a { color: var(--muted); font-size: .8125rem; font-weight: 600; text-decoration: none; transition: color .16s; }
.article-header-links a:hover { color: var(--th-link); }
.article-header-links .article-join {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  padding: .5rem 1rem;
  border-radius: .5625rem;
  background: var(--accent);
  color: #fff;
  transition: transform .16s, background-color .16s;
}
.article-header-links .article-join:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 86%, black); color: #fff; }
.article-menu-button {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: .5625rem;
  background: var(--th-surface);
  color: var(--fg);
  cursor: pointer;
}
.article-mobile-nav {
  position: absolute;
  inset-block-start: 100%;
  inset-inline: 1rem;
  padding: .6rem;
  border: 1px solid var(--border);
  border-radius: .75rem;
  background: var(--th-surface);
  box-shadow: var(--th-shadow);
}
.article-mobile-nav a { display: block; padding: .7rem .65rem; border-radius: .4375rem; color: var(--muted); font-size: .875rem; font-weight: 600; text-decoration: none; }
.article-mobile-nav a:hover { background: var(--accent-soft); color: var(--th-link); }

/* ------------------------------------------------------------ bandeau du titre */
.article-hero {
  position: relative;
  overflow: hidden;
  padding: 3rem 1.25rem 2.75rem;
  border-block-end: 1px solid var(--border);
  background: linear-gradient(115deg, var(--bg) 0%, color-mix(in srgb, var(--accent-soft) 70%, var(--bg)) 100%);
}
/* Petit trait orange en haut à l'extrémité du bandeau : seul décor, discret (charte). */
.article-hero::before { content: ""; position: absolute; inset-block-start: 0; inset-inline-start: 0; width: min(17.5rem, 40vw); height: 3px; background: var(--orange); }
.article-hero-inner { position: relative; width: min(70rem, 100%); margin-inline: auto; }

.article-breadcrumbs { margin: 0 0 1.6rem; }
.article-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .75rem; }
.article-breadcrumbs li { display: inline-flex; align-items: center; gap: .55rem; }
.article-breadcrumbs li + li::before { content: "›"; color: var(--orange-puce); }
[dir="rtl"] .article-breadcrumbs li + li::before { content: "‹"; }
.article-breadcrumbs a { color: inherit; text-decoration: none; }
.article-breadcrumbs a:hover { color: var(--th-link); text-decoration: underline; }
.article-breadcrumbs [aria-current] { color: var(--fg); font-weight: 600; }

.article-eyebrow, .article-kicker {
  color: var(--th-link);
  font-size: .6875rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.article-eyebrow { display: inline-flex; align-items: center; gap: .55rem; }
.article-eyebrow::before { content: ""; width: 1.25rem; height: 2px; background: var(--orange); }
.article-hero h1 {
  max-width: 50rem;
  margin: .85rem 0 .9rem;
  color: var(--fg);
  font-family: var(--font-titles);
  font-size: clamp(2.1rem, 5.3vw, 3.5rem);
  font-weight: var(--titre-poids);
  letter-spacing: -.03em;
  line-height: 1.12;
}
.article-hero-summary { max-width: 41rem; margin: 0; color: var(--muted); font-size: 1.0625rem; line-height: 1.7; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-block-start: 1.6rem; color: var(--muted); font-size: .75rem; font-weight: 550; }
.article-author { display: inline-flex; align-items: center; gap: .65rem; line-height: 1.35; }
.article-avatar {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--th-link);
  font-size: .6875rem;
  font-weight: 800;
}
.article-author strong { color: var(--fg); }
.article-meta-dot { color: var(--orange-puce); }
.article-cover {
  display: block;
  width: min(100%, 62.5rem);
  max-height: 28.75rem;
  margin: 2.1rem auto 0;
  border: 1px solid var(--border);
  border-radius: 1.125rem;
  object-fit: cover;
  box-shadow: var(--th-shadow);
}

/* ------------------------------------------------------------ page : sommaire + article */
.article-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 44.5rem);
  justify-content: center;
  align-items: start;
  gap: clamp(2.1rem, 6vw, 4.6rem);
  width: min(70rem, 100%);
  margin-inline: auto;
  padding: 2.9rem 1.25rem 5rem;
}
.article-layout--without-toc { grid-template-columns: minmax(0, 44.5rem); }

.article-toc {
  position: sticky;
  inset-block-start: 6rem;
  padding: 1rem .8rem;
  border: 1px solid var(--border);
  border-radius: .6875rem;
  background: var(--th-surface);
}
.article-toc-title { margin: 0; padding-inline: .5rem; color: var(--muted); font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.article-toc ol { display: grid; gap: .15rem; margin: .6rem 0 0; padding: 0; list-style: none; }
.article-toc a { display: block; padding: .45rem .5rem; border-radius: .4375rem; color: var(--muted); font-size: .8125rem; line-height: 1.45; text-decoration: none; }
.article-toc a:hover { background: var(--accent-soft); color: var(--th-link); }

/* Sommaire replié des petits écrans (<details>, sans JavaScript). */
.article-toc-mobile { display: none; }
.article-toc-mobile > summary { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem .95rem; border: 1px solid var(--border); border-radius: .625rem; background: var(--th-surface); cursor: pointer; list-style: none; }
.article-toc-mobile > summary::-webkit-details-marker { display: none; }
.article-toc-mobile .article-toc-title { padding: 0; color: var(--th-link); }
.article-toc-mobile-icon { color: var(--orange-puce); font-size: 1.25rem; line-height: 1; }
.article-toc-mobile-icon::before { content: "+"; }
.article-toc-mobile[open] .article-toc-mobile-icon::before { content: "−"; }
.article-toc-mobile[open] > summary { border-end-start-radius: 0; border-end-end-radius: 0; }
.article-toc-mobile nav { padding: .4rem; border: 1px solid var(--border); border-block-start: 0; border-radius: 0 0 .625rem .625rem; background: var(--th-surface); }
.article-toc-mobile ol { display: grid; gap: .15rem; margin: 0; padding: .3rem; list-style: none; }
.article-toc-mobile a { display: block; padding: .55rem .5rem; border-radius: .4375rem; color: var(--muted); font-size: .875rem; line-height: 1.45; text-decoration: none; }
.article-toc-mobile a:hover { background: var(--accent-soft); color: var(--th-link); }

/* ------------------------------------------------------------ corps de l'article */
.article-body { min-width: 0; color: var(--th-text); font-size: 1rem; line-height: 1.8; }
.article-intro {
  margin: 0 0 1.7rem;
  padding: 1.05rem 1.25rem;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--orange);
  border-start-end-radius: .5625rem;
  border-end-end-radius: .5625rem;
  background: var(--th-surface);
  color: var(--th-text);
  font-size: 1.0625rem;
  line-height: 1.8;
}
.article-intro > :first-child { margin-block-start: 0; }
.article-intro > :last-child { margin-block-end: 0; }
.article-intro p { margin: 0 0 .8em; }
.article-intro ul { list-style: disc; }
.article-intro ol { list-style: decimal; }
.article-intro ul, .article-intro ol { padding-inline-start: 1.4rem; }
.article-intro a, .article-rich-content a { color: var(--th-link); text-decoration: underline; text-underline-offset: 2px; }

.article-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 0 0 2.8rem; }
.article-fact { min-height: 5.5rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: .625rem; background: var(--th-surface); }
.article-fact-label { display: block; color: var(--muted); font-size: .6875rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.article-fact strong { display: block; margin-block-start: .4rem; color: var(--th-link); font-size: 1.1875rem; font-weight: 750; line-height: 1.2; }

.article-section { margin: 0 0 2.7rem; scroll-margin-block-start: 5.4rem; }
.article-section .article-kicker { display: flex; align-items: center; gap: .55rem; margin-block-end: .5rem; }
.article-section .article-kicker::before { content: ""; width: 1.05rem; height: 2px; background: var(--orange); }
.article-section h2 {
  margin: 0 0 .8rem;
  color: var(--fg);
  font-family: var(--font-titles);
  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: var(--titre-poids);
  letter-spacing: -.02em;
  line-height: 1.25;
}

.article-rich-content { color: var(--th-text); font-size: 1rem; line-height: 1.8; }
.article-rich-content > :first-child { margin-block-start: 0; }
.article-rich-content > :last-child { margin-block-end: 0; }
.article-rich-content p { margin: 0 0 1em; }
.article-rich-content h3, .article-rich-content h4 { margin: 1.6em 0 .5em; color: var(--fg); font-family: var(--font-titles); font-size: 1.15rem; font-weight: 700; line-height: 1.35; }
/* Sous-intertitre (h4, 23/11/2026) : un cran sous l'intertitre h3. */
.article-rich-content h4 { margin-top: 1.3em; font-size: 1.025rem; }
/* La remise à zéro de Tailwind retire les puces et les numéros : on les rétablit pour le texte riche. */
.article-rich-content ul { list-style: disc; }
.article-rich-content ol { list-style: decimal; }
.article-rich-content ul, .article-rich-content ol { padding-inline-start: 1.4rem; }
.article-rich-content li { margin: .35rem 0; }
.article-rich-content li::marker { color: var(--orange-puce); }
.article-rich-content blockquote { margin: 1.25rem 0; padding: .75rem 1rem; border-inline-start: 3px solid var(--orange); border-start-end-radius: .625rem; border-end-end-radius: .625rem; background: var(--th-surface); }
.article-rich-content img { max-width: 100%; height: auto; border-radius: .75rem; }
.article-rich-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.article-rich-content th, .article-rich-content td { padding: .65rem .8rem; border: 1px solid var(--border); text-align: start; }
.article-rich-content th { background: var(--accent-soft); color: var(--fg); }

/* ------------------------------------------------------------ questions fréquentes */
.article-faq { display: grid; gap: .5rem; }
.article-faq-item { overflow: hidden; border: 1px solid var(--border); border-radius: .5625rem; background: var(--th-surface); }
.article-faq-item > summary { list-style: none; }
.article-faq-item > summary::-webkit-details-marker { display: none; }
.article-faq-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  color: var(--fg);
  font-size: .9375rem;
  font-weight: 650;
  cursor: pointer;
}
.article-faq-button:hover { color: var(--th-link); }
/* Chevron dessiné en CSS : il se retourne à l'ouverture. */
.article-faq-symbol { flex: none; color: var(--th-link); }
.article-faq-symbol::before { content: ""; display: block; width: .5rem; height: .5rem; margin-block-end: .25rem; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); transition: transform .16s; }
.article-faq-item[open] .article-faq-symbol::before { margin-block: .25rem 0; transform: rotate(-135deg); }
.article-faq-answer { padding: 0 1rem 1rem; color: var(--muted); font-size: .875rem; line-height: 1.75; }

/* ------------------------------------------------------------ ressources (liens externes) */
.article-resources { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.article-resource { border: 1px solid var(--border); border-radius: .5625rem; background: var(--th-surface); }
.article-resource-link { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; align-items: baseline; padding: .8rem 1rem; color: var(--fg); text-decoration: none; }
.article-resource-link:hover .article-resource-title { color: var(--th-link); text-decoration: underline; }
.article-resource-type { grid-row: 1 / span 2; padding: .1rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--fg); font-size: .75rem; font-weight: 650; white-space: nowrap; }
.article-resource-title { font-size: .9375rem; font-weight: 650; overflow-wrap: anywhere; }
.article-resource-host { color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.article-resource-description { margin: 0; padding: 0 1rem .8rem; color: var(--muted); font-size: .875rem; line-height: 1.7; }
.article-resource-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------ pied de l'article et du site */
.article-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; padding-block-start: 1.1rem; border-block-start: 1px solid var(--border); color: var(--muted); font-size: .75rem; }
.article-footer a { color: var(--th-link); font-weight: 700; text-decoration: none; }
.article-footer a:hover { text-decoration: underline; }
.article-site-footer { padding: 1.4rem 1.25rem; border-block-start: 1px solid var(--border); background: var(--th-surface); color: var(--muted); font-size: .75rem; }
.article-site-footer-inner { display: flex; width: min(70rem, 100%); flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem; margin-inline: auto; }
.article-site-footer-inner p { margin: 0; }
.article-site-footer a { color: var(--muted); text-decoration: none; }
.article-site-footer a:hover { color: var(--th-link); text-decoration: underline; }
.article-footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }

/* ------------------------------------------------------------ arabe : ni capitales ni lettres serrées, police dédiée */
html[lang="ar"] body.article-shell { font-family: 'Noto Sans Arabic', var(--font-body); }
html[lang="ar"] .article-hero h1, html[lang="ar"] .article-section h2, html[lang="ar"] .article-rich-content h3, html[lang="ar"] .article-rich-content h4 { font-family: 'Noto Sans Arabic', var(--font-titles); letter-spacing: 0; }
html[lang="ar"] .article-hero h1 { line-height: 1.35; }
html[lang="ar"] .article-eyebrow, html[lang="ar"] .article-kicker, html[lang="ar"] .article-toc-title, html[lang="ar"] .article-fact-label, html[lang="ar"] .article-brand { letter-spacing: 0; text-transform: none; }

/* ------------------------------------------------------------ petits écrans */
@media (max-width: 51.25rem) {
  .article-layout, .article-layout--without-toc { grid-template-columns: minmax(0, 44.5rem); }
  .article-toc { display: none; }
  .article-toc-mobile { display: block; margin-block-end: 1.5rem; }
  .article-menu-button { display: inline-flex; }
  .article-header-links { display: none; }
}
@media (max-width: 35rem) {
  .article-header-inner { width: calc(100% - 2rem); min-height: 3.875rem; }
  .article-hero { padding: 2rem 1rem 2.1rem; }
  .article-hero-summary { font-size: 1rem; }
  .article-layout { padding: 1.7rem 1rem 3.5rem; }
  .article-intro { font-size: 1rem; }
  .article-facts { grid-template-columns: 1fr; gap: .4rem; margin-block-end: 2.1rem; }
  .article-fact { display: flex; min-height: 0; align-items: center; justify-content: space-between; gap: .6rem; padding: .65rem .8rem; }
  .article-fact strong { margin: 0; text-align: end; }
  .article-section { margin-block-end: 2.1rem; }
  .article-site-footer-inner { justify-content: center; text-align: center; }
  .article-footer-links { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .article-header-links a, .article-header-links .article-join, .article-faq-symbol::before { transition: none; }
  .article-header-links .article-join:hover { transform: none; }
}

/* Espacement : listes et blocs qui suivent un contenu riche (le reset Tailwind supprime les marges). */
.article-rich-content ul, .article-rich-content ol { margin: 0 0 1em; }
.article-rich-content + .article-block { margin-block-start: 1.25rem; }
