/* ===========================================================
   Observatoire — blog officiel rodrigueparle.fr
   BASE V1-magazine : hero noir, body serif, verdict pull-quote,
   source-quote mono, tables stylées, author-card.
   Aligné sur RODRIGUE_ART_DIRECTION.md.

   Les palettes (palettes/A.css, B.css, C.css, D.css) peuvent
   redéfinir les custom properties si besoin.
   =========================================================== */
/* Fonts are loaded via <link> in PageLayout.astro head with preconnect, in parallel with this stylesheet (no @import — that serializes downloads and causes FOUC). */

:root {
  --bg: #FAFAFA;
  --bg-alt: #F2F0EB;
  --ink: #0E0E0E;
  --ink-soft: #555555;
  --ink-faint: #888888;
  --banner-bg: #0A0A0A;
  --banner-fg: #FFFFFF;
  --rule: #0E0E0E;
  --max-content: 680px;
  --max-wide: 960px;
  --font-display: 'Inter', 'Helvetica Neue', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: 'Source Serif Pro', 'Charter', 'Iowan Old Style', Georgia, serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;

  /* Palette compatibility (overridden in palettes/X.css when used) */
  --paper: var(--bg);
  --paper-tint: var(--bg-alt);
  --accent-1: var(--ink);
  --accent-1-soft: var(--ink-soft);
  --accent-1-pale: var(--ink-faint);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-underline-offset: 5px; }

img { max-width: 100%; height: auto; display: block; }

/* =========================
   HEADER FIXE — banner noir
   ========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--banner-bg);
  color: var(--banner-fg);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  border-bottom: 1px solid var(--banner-bg);
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--banner-fg);
  text-decoration: none;
  min-width: 0;
}
.site-header .brand img { height: 28px; width: auto; filter: invert(1); flex-shrink: 0; }
.site-header .brand:hover span { text-decoration: underline; text-underline-offset: 4px; }
.site-header .brand[aria-current="page"] { opacity: 0.85; cursor: default; }
.site-header nav a {
  color: var(--banner-fg);
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.site-header nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-header nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.site-header .nav-short { display: none; }
@media (max-width: 560px) {
  .site-header { padding: 0 14px; }
  .site-header .brand { font-size: 15px; gap: 8px; }
  .site-header .brand img { height: 22px; }
  .site-header .nav-full { display: none; }
  .site-header .nav-short { display: inline; font-size: 12px; }
}
@media (max-width: 360px) {
  .site-header .brand span { font-size: 13px; letter-spacing: 0.02em; }
}

/* =========================
   HERO — bloc noir avec H1
   ========================= */
.hero {
  background: var(--banner-bg);
  color: var(--banner-fg);
  padding: var(--space-xl) var(--space-md);
}
.hero-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
}
.hero .franchise-tag {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  margin-bottom: var(--space-sm);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
  max-width: 16ch;
  color: var(--banner-fg);
}
.hero .meta {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.hero .meta strong { color: var(--banner-fg); font-weight: 600; }

/* =========================
   ARTICLE BODY
   ========================= */
article.post {
  background: var(--bg);
  padding: var(--space-xl) var(--space-md);
}
article.post .body {
  max-width: var(--max-content);
  margin: 0 auto;
}

article.post .lead {
  font-size: 22px;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: var(--space-lg);
  font-style: italic;
}

article.post p {
  margin-bottom: var(--space-md);
  /* Knuth-Plass total-fit line-breaking when supported (Chrome 117+, Safari 17.4+, Firefox 121+).
     Fallback : algorithme greedy classique. Les vieux navigateurs ignorent silencieusement. */
  text-wrap: pretty;
  /* Césure française aux frontières syllabiques (lang="fr" requis sur <html>). */
  hyphens: auto;
  -webkit-hyphens: auto;
}
article.post .lead {
  text-wrap: pretty;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* Pas d'orphelin/widow sur les titres : balance optimal-fit. */
article.post h1, article.post h2, article.post h3 {
  text-wrap: balance;
}

/* Glue typo des groupes courts : « ... » / "..." / (...) ≤ 32-40 caractères.
   Le post-process Python wrappe automatiquement ces groupes courts dans
   <span class="ws-nowrap">. Les groupes longs restent libres pour éviter
   tout débordement. */
.ws-nowrap {
  white-space: nowrap;
}
article.post h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.2;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  letter-spacing: -0.005em;
}
article.post h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

article.post ul, article.post ol { padding-left: 24px; margin-bottom: var(--space-md); }
article.post li { margin-bottom: 6px; }

/* =========================
   VERDICT-CITATION (phrase-cadeau / pull-quote)
   ========================= */
.verdict {
  border-left: 4px solid var(--ink);
  padding: 20px 0 20px 28px;
  margin: var(--space-lg) 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.35;
  color: var(--ink);
}
.verdict::before { content: ""; }
.verdict cite {
  display: block;
  margin-top: 12px;
  font-style: normal;
  font-size: 13px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* =========================
   IMAGES
   ========================= */
figure {
  margin: var(--space-lg) 0;
  text-align: center;
}
figure img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
figure figcaption {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 12px;
  letter-spacing: 0.02em;
  text-align: center;
}

.figure {
  margin: var(--space-lg) 0;
  text-align: center;
}
.figure img {
  margin: 0 auto;
  border: 1px solid var(--ink);
  background: var(--bg);
}
.figure.specimen img {
  max-width: 360px;
}
.figure.cover img {
  max-width: 100%;
}

figure.inline {
  margin: var(--space-lg) 0;
  text-align: center;
}
figure.inline img {
  max-width: 100%;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 1px 0 var(--ink));
}
figure.inline figcaption {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 12px;
}

/* =========================
   COMPARAISON (Décodage par Contraste)
   ========================= */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
.compare > div {
  background: var(--bg-alt);
  padding: var(--space-md);
  border-left: 3px solid var(--ink);
}
.compare h4 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .compare { grid-template-columns: 1fr; }
}

/* =========================
   TABLES (Décodage par Contraste, etc.)
   ========================= */
.body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0 var(--space-lg);
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 1.5;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
.body table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--ink);
  font-weight: 700;
}
.body table tbody td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid #E8E5DE;
  color: var(--ink);
  vertical-align: top;
}
.body table tbody tr:last-child td { border-bottom: none; }
.body table tbody td:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  width: 38%;
}
.body table tbody td:nth-child(2) {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
}

@media (max-width: 640px) {
  .body table { font-size: 13px; }
  .body table tbody td:first-child { width: 42%; font-size: 10px; }
  .body table tbody td:nth-child(2) { font-size: 15px; }
}

/* =========================
   SOURCE QUOTE (verbatim from offer / report)
   ========================= */
.source-quote {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg-alt);
  padding: 16px 20px;
  margin: var(--space-md) 0;
  border-left: 3px dotted var(--ink);
  color: var(--ink);
}
.source-quote .src {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-top: 8px;
  font-weight: 600;
}

blockquote {
  margin: var(--space-md) 0;
  padding-left: var(--space-md);
  border-left: 3px solid var(--ink);
  font-style: italic;
  color: var(--ink-soft);
}

/* =========================
   FOOTER
   ========================= */
.site-footer {
  background: var(--banner-bg);
  color: var(--ink-faint);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin-top: auto;
  flex-shrink: 0;
}
.site-footer strong { color: var(--banner-fg); font-weight: 600; }
.site-footer a { color: var(--ink-faint); }
.site-footer .small {
  display: block;
  margin-top: var(--space-md);
  font-size: 11px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* =========================
   AUTHOR (Rodrigue LaTaupe) BLOC
   ========================= */
.author-card {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin: var(--space-xl) 0 0;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.author-card .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--bg-alt);
  border: 1px solid var(--ink);
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
.author-card .who { font-family: var(--font-display); }
.author-card .who strong { display: block; font-size: 16px; font-weight: 700; }
.author-card .who span { font-size: 13px; color: var(--ink-faint); }

/* =========================
   STRONG / EM (in-prose)
   ========================= */
strong { font-weight: 700; color: var(--ink); }
em { font-style: italic; }

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-header { padding: 0 var(--space-sm); }
  .site-header nav a { font-size: 12px; }
  .hero { padding: var(--space-lg) var(--space-sm); }
  article.post { padding: var(--space-lg) var(--space-sm); }
  .verdict { font-size: 20px; padding: 16px 0 16px 22px; }
  article.post .lead { font-size: 19px; }
}

/* =========================
   PRINT
   ========================= */
@media print {
  body { font-size: 11pt; }
  .site-header, .site-footer { display: none; }
  .hero { background: white !important; color: black !important; padding: 0; }
  .hero h1 { color: black !important; }
  .verdict { border-color: black; color: black; }
  a { text-decoration: none; color: black; }
}

/* =========================
   ABBR — légende interactive mots techniques
   Markdown : <abbr title="explication courte">terme</abbr>
   Desktop  : tooltip natif au hover (cursor:help)
   Mobile   : .tooltip-open révèle un panneau cliquable (toggle JS)
   ========================= */
abbr[title] {
  text-decoration: none;
  border-bottom: 1px dotted var(--ink, #0E0E0E);
  cursor: help;
  position: relative;
}
abbr[title].tooltip-open::after {
  content: attr(title);
  display: block;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 6px;
  background: var(--ink, #0E0E0E);
  color: var(--paper, #FAFAFA);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  font-family: var(--font-body, inherit);
  font-style: normal;
  max-width: 320px;
  width: max-content;
  z-index: 20;
  box-shadow: 0 2px 0 var(--ink, #0E0E0E);
}
@media (max-width: 720px) {
  abbr[title].tooltip-open::after { font-size: 13px; max-width: 260px; }
}
