/* ============================================================================
   Actu Propfirm — refonte éditoriale type Google News (2026-08-05)
   D'après la maquette Claude Design « Actu Propfirm Mobile.dc.html ».

   Deux principes, pour que ce fichier serve de base au reste du parc VDL :
   - tout ce qui fait l'identité du site est une VARIABLE (accent, polices),
     injectée par base.html depuis site.yaml — le reste est réutilisable tel quel ;
   - thème clair/sombre par variables CSS, choix du visiteur en localStorage.
   ============================================================================ */

/* --- Tokens ---------------------------------------------------------------- */

:root {
  /* --primary / --primary-dark / --secondary : injectés par base.html */
  --serif: var(--font-display, "Newsreader"), Georgia, "Times New Roman", serif;
  --sans: var(--font-body, "IBM Plex Sans"), system-ui, -apple-system, sans-serif;
  --mono: var(--font-meta, "IBM Plex Mono"), ui-monospace, "SF Mono", monospace;

  --bg: #fdfdfc;
  --surface: #ffffff;
  --fg: #16161a;
  --muted: #70707a;
  --line: #e7e6e2;
  --chip: #f3f2ef;
  --stripe: #eceae5;
  --accent: var(--primary, #4a4a52);
  --accent-soft: color-mix(in oklab, var(--primary, #4a4a52) 9%, white);

  --wrap: 760px;
  --radius: 8px;
  --radius-lg: 10px;
}

/* Palette sombre : appliquée soit par choix explicite du visiteur (data-theme),
   soit par la préférence système tant qu'il n'a rien choisi. */
:root[data-theme="dark"] {
  --bg: #111113;
  --surface: #17171a;
  --fg: #f3f2ef;
  --muted: #9b9ba3;
  --line: #2b2b30;
  --chip: #1f1f23;
  --stripe: #232327;
  --accent: color-mix(in oklab, var(--primary, #9aa0c0) 45%, white);
  --accent-soft: color-mix(in oklab, var(--primary, #9aa0c0) 30%, #111113);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --surface: #17171a;
    --fg: #f3f2ef;
    --muted: #9b9ba3;
    --line: #2b2b30;
    --chip: #1f1f23;
    --stripe: #232327;
    --accent: color-mix(in oklab, var(--primary, #9aa0c0) 45%, white);
    --accent-soft: color-mix(in oklab, var(--primary, #9aa0c0) 30%, #111113);
  }
}

/* --- Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--fg); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.3px;
  text-wrap: pretty;
  margin: 0;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }
.text-muted { color: var(--muted); }

.mono, .cat, .kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.cat { color: var(--accent); display: block; margin-bottom: 6px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* --- En-tête --------------------------------------------------------------- */

.site-head {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-head-bar {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

.brand { display: flex; align-items: center; gap: 9px; color: var(--fg); }
.brand img { width: 24px; height: 24px; border-radius: 5px; }
.brand-name { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -0.2px; }

.head-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer; padding: 0;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 15px; height: 15px; }

.tabs {
  max-width: var(--wrap); margin: 0 auto;
  display: flex; gap: 20px;
  overflow-x: auto;
  padding: 0 18px 9px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { width: 0; height: 0; }

.tab {
  flex: none;
  padding: 2px 0 6px;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover { color: var(--fg); }
.tab[aria-current] { font-weight: 600; color: var(--fg); border-bottom-color: var(--accent); }

/* --- Navigation basse (mobile) --------------------------------------------- */

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav.has-saved { grid-template-columns: repeat(4, 1fr); }

.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.1px;
}
.bottom-nav a[aria-current] { color: var(--accent); }
.bottom-nav svg { width: 18px; height: 18px; }

@media (max-width: 899px) { body { padding-bottom: 70px; } }
@media (min-width: 900px) { .bottom-nav { display: none; } }

/* --- Fil d'actualité ------------------------------------------------------- */

.feed { max-width: var(--wrap); margin: 0 auto; padding: 18px 18px 34px; }

.feed-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.feed-head h1, .feed-head h2 {
  font-size: 15px; font-weight: 600; letter-spacing: 0.3px;
  text-transform: uppercase; color: var(--muted);
}

.feed-intro {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: pretty;
}

.lead { display: block; color: inherit; margin-bottom: 26px; }
.lead .thumb { height: 186px; margin-bottom: 12px; }
.lead h2, .lead h3 { font-size: 25px; line-height: 1.2; margin-bottom: 8px; letter-spacing: -0.4px; }
.lead p { margin: 0 0 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }

.byline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.byline strong { color: var(--fg); font-weight: 600; }

.thumb {
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, var(--stripe) 0 8px, var(--chip) 8px 16px);
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.feed-section { margin-bottom: 26px; }
.feed-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 9px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.feed-section-head h2 { font-size: 18px; letter-spacing: -0.2px; }
.feed-section-head a { font-family: var(--sans); font-size: 12px; font-weight: 600; }

.entry-list { display: flex; flex-direction: column; gap: 16px; }

.entry {
  display: grid; grid-template-columns: 1fr 84px; gap: 12px;
  align-items: start; color: inherit;
}
.entry h3, .entry h4 { font-size: 16.5px; line-height: 1.28; margin-bottom: 7px; letter-spacing: -0.2px; }
.entry .byline { font-size: 11.5px; }
.entry .thumb { height: 70px; border-radius: 6px; }

.stack { display: flex; flex-direction: column; gap: 20px; }
.entry-lg {
  display: block; color: inherit;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.entry-lg .thumb { height: 150px; margin-bottom: 11px; }
.entry-lg h2, .entry-lg h3 { font-size: 19px; line-height: 1.25; margin-bottom: 7px; letter-spacing: -0.3px; }
.entry-lg p { margin: 0 0 9px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* --- Cartes, formulaires --------------------------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--surface);
}
.card h2, .card h3 { font-size: 18px; margin-bottom: 6px; }
.card > p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--muted); }

.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field-row input {
  flex: 1; min-width: 180px;
  border: 1px solid var(--line);
  background: var(--bg); color: var(--fg);
  border-radius: 7px; padding: 10px 12px;
  font: 400 13px var(--sans); outline: none;
}
.field-row input:focus { border-color: var(--accent); }

.btn {
  display: inline-block;
  flex: none; border: 0;
  background: var(--fg); color: var(--bg);
  border-radius: 7px; padding: 10px 16px;
  font: 600 13px var(--sans);
  cursor: pointer;
}
.btn:hover { background: var(--accent); color: #fff; }

/* --- Recherche ------------------------------------------------------------- */

.searchbar {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line);
  background: var(--chip);
  border-radius: 999px;
  padding: 11px 15px;
  margin-bottom: 20px;
}
.searchbar svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.searchbar input {
  flex: 1; min-width: 0;
  border: 0; background: transparent; color: var(--fg);
  font: 400 14px var(--sans); outline: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface); color: var(--fg);
  border-radius: 999px; padding: 8px 13px;
  font: 500 12.5px var(--sans);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 22px; text-align: center;
}
.empty p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--muted); }

/* --- Article --------------------------------------------------------------- */

.article { max-width: var(--wrap); margin: 0 auto; padding: 16px 18px 34px; }

.back { display: inline-block; color: var(--muted); font: 500 13px var(--sans); padding: 0 0 16px; }
.back:hover { color: var(--accent); }

.article-head h1 { font-size: 29px; line-height: 1.16; letter-spacing: -0.6px; margin-bottom: 12px; }

.article-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.article-meta a { color: var(--muted); }
.article-meta a:hover { color: var(--accent); }

.save-btn {
  flex: none;
  border: 1px solid var(--line);
  background: transparent; color: var(--muted);
  border-radius: 999px; padding: 7px 12px;
  font: 600 11.5px var(--sans);
  cursor: pointer; white-space: nowrap;
}
.save-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }

.article-lede { margin: 20px 0; font-family: var(--serif); font-size: 18px; line-height: 1.5; }
.article-cover { border-radius: var(--radius); margin-bottom: 24px; }

/* Corps rédactionnel produit par le générateur (markdown → HTML) */
.prose { font-size: 15px; line-height: 1.62; }
.prose > p { margin: 0 0 16px; text-wrap: pretty; }
.prose h2 { font-size: 22px; line-height: 1.25; margin: 28px 0 12px; }
.prose h3 { font-size: 18px; margin: 22px 0 10px; }
.prose ul, .prose ol { margin: 0 0 20px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.prose li { font-size: 14.5px; line-height: 1.55; }
.prose img { border-radius: var(--radius); margin: 20px 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose strong { font-weight: 600; }

/* Résumé « Pas le temps de lire ? » : bordure d'accent (cf. maquette) */
.summary { border-left: 2px solid var(--accent); padding: 2px 0 2px 15px; margin: 0 0 26px; }
.summary-label {
  font-family: var(--mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 10px;
}
.summary ul { margin: 0; padding-left: 17px; gap: 9px; }
.summary li { font-size: 14.5px; line-height: 1.5; }

/* Citation chiffrée en exergue */
.prose blockquote {
  margin: 0 0 20px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 15px;
  font-size: 14px; line-height: 1.55;
  border: 0;
}
.prose blockquote p { margin: 0 0 8px; }
.prose blockquote p:last-child { margin: 0; }

/* Tableau : défilable plutôt que débordant sur petit écran */
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 13.5px; }
.prose th, .prose td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.prose thead th {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.table-scroll { overflow-x: auto; margin: 0 0 24px; }
.table-scroll table { margin: 0; }

/* FAQ en accordéon natif (<details>) : le texte des réponses reste dans le HTML
   source, donc lisible par un crawler ou un agent même replié. */
.faq { border-top: 1px solid var(--line); margin-bottom: 28px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item > summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 15px 0; cursor: pointer;
  font: 600 14.5px var(--sans); line-height: 1.4;
  list-style: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
/* La question est un vrai <h3> (sémantique pour les lecteurs et les agents), mais
   elle se présente comme la ligne de l'accordéon, pas comme un titre de section. */
.faq-item > summary h3 {
  margin: 0; font: inherit; letter-spacing: 0; color: inherit;
}
.faq-item > summary::after {
  content: "+"; flex: none; color: var(--muted);
  font-weight: 400; font-size: 17px; line-height: 1.2;
}
.faq-item[open] > summary::after { content: "\2212"; }
.faq-item > div { padding: 0 0 16px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.faq-item > div p { margin: 0; }

/* Bloc auteur */
.author-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px; margin-bottom: 28px;
  background: var(--surface);
}
.author-card img, .author-card .avatar {
  width: 52px; height: 52px; flex: none; border-radius: 999px;
  background: repeating-linear-gradient(135deg, var(--stripe) 0 5px, var(--chip) 5px 10px);
}
.author-card .name { font: 600 15px var(--sans); margin-bottom: 2px; }
.author-card .role { font-family: var(--mono); font-size: 11.5px; color: var(--accent); margin-bottom: 9px; }
.author-card p { margin: 0 0 9px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.author-card .credential { font-size: 12px; color: var(--muted); }

/* Articles connexes */
.related-label {
  font-family: var(--mono);
  font-size: 11px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.related { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; }
.related a { display: block; color: inherit; }
.related h3 { font-size: 17px; line-height: 1.28; margin-bottom: 6px; }
.related p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* --- Pages éditoriales simples (contact, mentions, à propos) ---------------- */

.page { max-width: var(--wrap); margin: 0 auto; padding: 18px 18px 34px; }
.page h1 { font-size: 29px; line-height: 1.16; letter-spacing: -0.5px; margin-bottom: 14px; }
.page h2 { font-size: 20px; margin: 26px 0 10px; }
.page p { margin: 0 0 15px; font-size: 15px; line-height: 1.62; }
.page ul { margin: 0 0 18px; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.form-stack { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.form-stack input, .form-stack textarea, .form-stack select {
  border: 1px solid var(--line);
  background: var(--bg); color: var(--fg);
  border-radius: 7px; padding: 11px 12px;
  font: 400 14px var(--sans); outline: none;
}
.form-stack input:focus, .form-stack textarea:focus { border-color: var(--accent); }
.form-stack textarea { min-height: 150px; resize: vertical; }
.flash { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.flash-ok { background: var(--accent-soft); }
.flash-err { background: var(--chip); color: var(--fg); }

/* --- Pied de page ---------------------------------------------------------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 8px; }
.site-footer-inner {
  max-width: var(--wrap); margin: 0 auto;
  padding: 18px 18px 28px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11.5px; color: var(--muted);
}
.footer-brand { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--fg); }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent); }

/* --- Confort de lecture au-delà du mobile ---------------------------------- */

@media (min-width: 700px) {
  .lead .thumb { height: 300px; }
  .lead h2, .lead h3 { font-size: 32px; }
  .article-head h1 { font-size: 38px; }
  .page h1 { font-size: 34px; }
  .prose { font-size: 16.5px; }
  .prose h2 { font-size: 26px; }
  .entry { grid-template-columns: 1fr 120px; }
  .entry .thumb { height: 90px; }
  .entry-lg .thumb { height: 220px; }
}

@media (prefers-reduced-motion: no-preference) {
  .feed, .article, .page { animation: fadeUp 0.25s ease both; }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
  }
}
