/* Tech ou Toc : design sobre, pensé d'abord pour le téléphone.
   Couleurs dans :root (mode sombre automatique plus bas), une couleur par rubrique. */
:root {
  --fond: #ffffff;
  --surface: #f4f4f1;
  --texte: #121212;
  --doux: #5a5a5a;
  --ligne: #e3e3de;
  --volt: #d4ff3f;
  --marque-fond: #121212;
  --marque-eclair: #d4ff3f;
  --ia: #6d28d9;
  --tech: #1d4ed8;
  --energie: #0b7a42;
  --business: #b45309;
  --actus: #c81e1e;
  --r: var(--texte);
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #101112; --surface: #1a1b1e; --texte: #ececea; --doux: #a2a29e; --ligne: #2c2d30;
    --marque-fond: #d4ff3f; --marque-eclair: #101112;
    --ia: #b69cff; --tech: #8aadff; --energie: #4fd889; --business: #f6b73c; --actus: #ff7b72;
  }
}
/* Une couleur par rubrique (le nom de la classe = le slug de config.json). */
.r-ia { --r: var(--ia); }
.r-tech { --r: var(--tech); }
.r-energie { --r: var(--energie); }
.r-business-ia { --r: var(--business); }
.r-actus-du-jour { --r: var(--actus); }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.6 var(--police); -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
::selection { background: var(--volt); color: #121212; }
:focus-visible { outline: 3px solid var(--r); outline-offset: 3px; border-radius: 2px; }
.largeur { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.evitement {
  position: absolute; left: -9999px; top: 8px; z-index: 20; padding: 8px 14px;
  background: var(--texte); color: var(--fond); border-radius: 6px;
}
.evitement:focus { left: 16px; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.centre { margin-top: 36px; text-align: center; }
.bouton {
  display: inline-block; padding: 11px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--texte); color: var(--fond); font: inherit; font-weight: 700; text-decoration: none;
}
.bouton:hover { opacity: .85; }

/* ---------------------------------------------------------------- en-tête */
.haut { border-bottom: 1px solid var(--ligne); }
.haut-inner { display: flex; flex-wrap: wrap; align-items: center; column-gap: 32px; padding-top: 12px; padding-bottom: 12px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
  color: var(--texte); text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em;
}
.marque { width: 30px; height: 30px; flex: none; }
.marque rect { fill: var(--marque-fond); }
.marque path { fill: var(--marque-eclair); }
.nav { display: flex; gap: 24px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 8px 0; border-bottom: 3px solid transparent;
  font-weight: 650; font-size: .95rem; white-space: nowrap; text-decoration: none;
}
.nav a:hover { border-bottom-color: var(--r); }
.nav a[aria-current="page"] { border-bottom-color: var(--r); color: var(--r); }
.lien-recherche {
  display: grid; place-items: center; width: 40px; height: 40px; margin: 0 -8px 0 -12px;
  color: var(--texte); border-radius: 50%;
}
.lien-recherche:hover, .lien-recherche[aria-current="page"] { background: var(--surface); }
.lien-recherche svg { width: 22px; height: 22px; }
@media (max-width: 700px) {
  .haut-inner { padding-bottom: 0; }
  .lien-recherche { margin-left: auto; }
  /* Menu sur sa propre ligne ; le fondu à droite montre qu'on peut le faire glisser. */
  .nav {
    order: 3; flex-basis: 100%; margin: 8px 0 0; gap: 20px; padding-right: 24px;
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  }
}

/* ---------------------------------------------------------------- vignettes */
.rubrique {
  margin: 0 0 6px; color: var(--r);
  font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.rubrique a { text-decoration: none; }
.meta { margin: 0; color: var(--doux); font-size: .85rem; }
.grille { display: grid; gap: 36px 28px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.carte { position: relative; padding-top: 14px; border-top: 3px solid var(--r); }
.carte img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: 14px; }
.carte h2, .carte h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 750; }
.carte h2 a, .carte h3 a { text-decoration: none; }
.carte h2 a::after, .carte h3 a::after { content: ""; position: absolute; inset: 0; } /* toute la vignette est cliquable */
.carte:hover h2 a, .carte:hover h3 a {
  text-decoration: underline; text-decoration-color: var(--r); text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.chapo {
  margin: 0 0 10px; color: var(--doux); font-size: .975rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------------------------------------------------------------- accueil */
.accroche {
  max-width: 40ch; margin: 28px 0 24px; color: var(--doux);
  font-size: clamp(1.05rem, .9rem + .8vw, 1.35rem); font-weight: 600; line-height: 1.35; letter-spacing: -0.01em;
}
.une { padding: 20px 0 32px; border-top-width: 4px; border-bottom: 1px solid var(--ligne); }
.une h2 {
  max-width: 24ch; margin-bottom: 14px;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em;
}
.une .chapo { display: block; max-width: 60ch; color: var(--texte); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); }
@media (min-width: 860px) {
  .une:has(img) { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: center; }
  .une img { margin: 0; }
}
.titre-section {
  margin: 44px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--ligne);
  font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
/* À la une + encadré « Actus du jour » : côte à côte sur ordinateur, l'un sous l'autre sur téléphone. */
@media (min-width: 960px) {
  .haut-accueil:has(.actus) { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 48px; align-items: start; }
  .haut-accueil .actus { margin-top: 0; }
}
.actus { margin-top: 28px; padding: 18px 20px 20px; background: var(--surface); border-top: 4px solid var(--r); border-radius: 0 0 10px 10px; }
.actus h2 { margin: 0; color: var(--r); font-size: .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.actus ol { margin: 12px 0 16px; padding: 0; list-style: none; counter-reset: info; }
.actus li {
  display: grid; grid-template-columns: 1.4em 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--ligne);
  counter-increment: info; font-weight: 650; line-height: 1.35;
}
.actus li::before { content: counter(info); color: var(--r); font-weight: 800; }
.actus li a { text-decoration: none; }
.actus li a:hover { text-decoration: underline; text-decoration-color: var(--r); }
.suite { font-weight: 700; text-decoration-color: var(--r); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- recherche */
.recherche { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.recherche input, .recherche select {
  padding: 12px 14px; border: 2px solid var(--ligne); border-radius: 10px;
  background: var(--fond); color: var(--texte); font: inherit;
}
.recherche input { flex: 1 1 260px; min-width: 0; font-size: 1.05rem; }
.recherche input:focus-visible, .recherche select:focus-visible { outline: none; border-color: var(--texte); }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filtres button {
  padding: 6px 14px; border: 1.5px solid var(--ligne); border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--texte); font: inherit; font-size: .9rem; font-weight: 650;
}
.filtres button:hover { border-color: var(--r); }
.filtres button[aria-pressed="true"] { background: var(--r); border-color: var(--r); color: var(--fond); }
.compte { margin: 0 0 20px; color: var(--doux); font-size: .9rem; }

/* ---------------------------------------------------------------- pages de rubrique */
.entete-rubrique { padding: 36px 0 28px; margin-bottom: 32px; border-bottom: 1px solid var(--ligne); }
.entete-rubrique h1 { margin: 4px 0 10px; font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; }
.entete-rubrique h1 + p { max-width: 60ch; margin: 0; color: var(--doux); font-size: 1.05rem; }
.lien-filtre { margin: 14px 0 0; font-size: .9rem; font-weight: 650; }
.lien-filtre a { text-decoration-color: var(--r); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.entete-rubrique + .grille .rubrique { display: none; } /* inutile de répéter la rubrique sur sa propre page */

/* ---------------------------------------------------------------- article */
.article { max-width: 680px; margin: 0 auto; padding-top: 32px; }
.entete h1 {
  margin: 6px 0 16px;
  font-size: clamp(2rem, 1.4rem + 2.8vw, 2.9rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.03em;
}
.entete .meta { padding-bottom: 20px; border-bottom: 1px solid var(--ligne); }
.article figure { margin: 24px 0 0; }
.article figure img { width: 100%; border-radius: 8px; }
.article figcaption { margin-top: 6px; color: var(--doux); font-size: .8rem; }
.corps { font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem); line-height: 1.7; }
.article:not(.page) .corps > p:first-child { margin-top: 24px; font-size: 1.1em; line-height: 1.55; font-weight: 500; } /* le chapeau */
.corps h2 { margin: 1.9em 0 .5em; font-size: 1.45em; font-weight: 750; }
.corps h3 { margin: 1.6em 0 .4em; font-size: 1.15em; }
.corps p, .corps ul, .corps ol { margin: 0 0 1.1em; }
.corps li { margin-bottom: .4em; }
.corps a { text-decoration-color: var(--r); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.corps a:hover { background: var(--surface); }
.corps blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--r); color: var(--doux); }
.essentiel { margin: 28px 0 8px; padding: 18px 22px 6px; background: var(--surface); border-left: 4px solid var(--r); border-radius: 0 10px 10px 0; }
.essentiel h2 { margin: 0 0 10px; color: var(--r); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.essentiel ul { padding-left: 1.1em; font-size: .97em; }
.sources { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--ligne); color: var(--doux); font-size: .9rem; }
.sources h2 { margin: 0 0 8px; color: var(--texte); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.sources ul { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; }
.sources a { text-underline-offset: 3px; }
.methode { margin: 18px 0 0; color: var(--doux); font-size: .85rem; }
.methode a, .entete .meta a { color: inherit; text-underline-offset: 3px; }
.aussi { margin-top: 56px; }
/* Brief « Actus du jour » : chaque info est numérotée automatiquement. */
.brief .corps { counter-reset: info; }
.brief .corps h2 { display: flex; gap: 12px; align-items: flex-start; counter-increment: info; scroll-margin-top: 16px; }
.brief .corps h2::before {
  content: counter(info); flex: none; display: grid; place-items: center; width: 1.6em; height: 1.6em; margin-top: .05em;
  border-radius: 8px; background: var(--r); color: var(--fond); font-size: .8em;
}
table { display: block; overflow-x: auto; width: 100%; border-collapse: collapse; font-size: .9em; }
th, td { padding: 8px 12px; border: 1px solid var(--ligne); text-align: left; }
th { background: var(--surface); }
pre { overflow-x: auto; padding: 14px; background: var(--surface); border-radius: 8px; font-size: .85em; }

/* Barre de lecture en haut de l'écran (navigateurs récents, sans JavaScript). */
.progression { display: none; }
@supports (animation-timeline: scroll()) {
  .progression {
    display: block; position: fixed; inset: 0 0 auto 0; z-index: 10; height: 3px;
    background: var(--r); transform-origin: 0 50%; transform: scaleX(0);
    animation: progression linear both; animation-timeline: scroll(root);
  }
}
@keyframes progression { to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- pied de page */
.bas { margin-top: 72px; background: var(--surface); border-top: 1px solid var(--ligne); color: var(--doux); font-size: .9rem; }
.bas-inner { display: grid; gap: 24px; padding-top: 36px; padding-bottom: 40px; }
@media (min-width: 760px) { .bas-inner { grid-template-columns: 2fr 1fr 1fr; } }
.bas .logo { font-size: 1.1rem; }
.bas .slogan { max-width: 40ch; margin: 10px 0 0; }
.bas nav { display: flex; flex-direction: column; gap: 8px; }
.bas nav a { color: var(--texte); text-decoration: none; }
.bas nav a:hover { text-decoration: underline; }
.copyright { grid-column: 1 / -1; margin: 0; padding-top: 16px; border-top: 1px solid var(--ligne); }
