/*
  Feuille de style commune au blog (toutes langues). Séparée des pages d'accueil,
  qui gardent leur CSS inline : la vitrine doit s'afficher sans aucune requête
  supplémentaire, le blog peut se permettre un fichier mis en cache un an.

  Mêmes jetons de design que l'app et la vitrine.
*/
:root {
  --bg: #0A0A0C; --surface: #141418; --surface-alt: #1C1C22; --border: #2B2B33;
  --text: #F4F4F2; --muted: #8C8C97; --faint: #5E5E68;
  --accent: #CEF23F; --ink: #0A0A0C; --positive: #37E0A0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Space Grotesk', -apple-system, sans-serif; letter-spacing: -.01em; }
a { color: inherit; }

.wrap { max-width: 720px; margin: 0 auto; padding: 40px 24px 0; }

/* ---------- En-tête commune ---------- */
.word { display: flex; align-items: center; gap: 8px; text-decoration: none; }
/* Le logo est un SVG en `currentColor` : la couleur se règle ici. */
.mark { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; display: flex; }
.brand { font-weight: 700; font-size: 17px; }
.brand span { color: var(--accent); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
.topbar nav { font-size: 13.5px; color: var(--muted); display: flex; gap: 18px; }
.topbar nav a { text-decoration: none; }
.topbar nav a:hover { color: var(--text); }

/* ---------- Fil d'Ariane ---------- */
.crumbs { font-size: 12px; color: var(--faint); margin: 0 0 18px; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* ---------- Article ---------- */
article h1 { font-size: clamp(28px, 4.6vw, 40px); line-height: 1.12; font-weight: 700; margin: 0 0 16px; text-wrap: balance; }
.meta { font-size: 12.5px; color: var(--faint); margin: 0 0 32px; }
.lede { font-size: 17.5px; line-height: 1.6; color: var(--text); margin: 0 0 34px; }

article h2 { font-size: 23px; line-height: 1.25; font-weight: 700; margin: 46px 0 14px; text-wrap: balance; }
article h3 { font-size: 17px; line-height: 1.3; font-weight: 700; margin: 30px 0 10px; }
article p { font-size: 16px; line-height: 1.68; color: #D8D8D4; margin: 0 0 18px; }
article strong { color: var(--text); font-weight: 700; }
article a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

article ul, article ol { font-size: 16px; line-height: 1.68; color: #D8D8D4; padding-left: 22px; margin: 0 0 20px; }
article li { margin-bottom: 9px; }
article li::marker { color: var(--accent); }

/* Encadré « à retenir » : la réponse courte, en tête de section. C'est ce que
   les moteurs génératifs citent, et ce que lit un visiteur pressé. */
.answer {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 26px;
}
.answer p { margin: 0; font-size: 15.5px; line-height: 1.6; }
.answer p + p { margin-top: 10px; }

.tablewrap { overflow-x: auto; margin: 0 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
td { color: #D8D8D4; line-height: 1.5; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Appel à l'action en cours d'article */
.cta-box {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; margin: 36px 0;
}
.cta-box h2 { font-size: 18px; margin: 0 0 8px; }
.cta-box p { font-size: 14.5px; margin: 0 0 16px; color: var(--muted); }
.cta {
  display: inline-block; font-weight: 700; font-size: 14.5px; background: var(--accent); color: var(--ink);
  border-radius: 13px; padding: 13px 24px; text-decoration: none;
}
.cta:hover { filter: brightness(1.06); }

/* ---------- Index du blog ---------- */
.postlist { list-style: none; padding: 0; margin: 0 0 56px; border-top: 1px solid var(--border); }
.postlist li { border-bottom: 1px solid var(--border); }
.postlist a { display: block; padding: 22px 0; text-decoration: none; }
.postlist a:hover h2 { color: var(--accent); }
.postlist h2 { font-size: 19px; margin: 0 0 7px; line-height: 1.3; transition: color .15s; }
.postlist p { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin: 0; max-width: 60ch; }

/* ---------- Articles liés ---------- */
.related { border-top: 1px solid var(--border); margin-top: 50px; padding-top: 22px; }
.related h2 { font-size: 15px; margin: 0 0 14px; }
.related ul { list-style: none; padding: 0; margin: 0; font-size: 14.5px; line-height: 1.5; }
.related li { margin-bottom: 10px; }
.related a { color: var(--muted); text-decoration: none; }
.related a:hover { color: var(--accent); }

/* ---------- Pied de page ---------- */
footer { border-top: 1px solid var(--border); margin-top: 50px; padding: 24px 0 12px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
footer .legal { font-size: 12px; color: var(--muted); display: flex; gap: 16px; }
footer .legal a { text-decoration: underline; }
/* « Du même auteur » : pied de page français uniquement (cf. SISTER_SITE). */
.sister { font-size: 12px; color: var(--faint); line-height: 1.6; margin: 10px 0 0; max-width: 72ch; }
.sister a { color: var(--muted); text-decoration: underline; }
.sister a:hover { color: var(--text); }
.langs { font-size: 12px; color: var(--muted); padding-bottom: 56px; line-height: 2; }
.langs a { text-decoration: underline; }

@media (max-width: 560px) {
  .wrap { padding-top: 28px; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
  article h2 { font-size: 21px; }
}

/* ---------- Calculateur public ---------- */
/* Formulaire volontairement nu : trois lignes, un bouton. Chaque champ ajoute
   une occasion de se tromper, et ce n'est pas un tableur. */
.calc { margin: 0 0 20px; }
.calc-row { display: grid; grid-template-columns: 1fr 110px auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.calc input { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font: inherit; font-size: 15px; padding: 11px 12px; width: 100%; min-width: 0; }
.calc input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.calc .calc-amount { text-align: right; font-variant-numeric: tabular-nums; }
.calc-cur { color: var(--muted); font-size: 14px; }
.calc-del { background: none; border: none; color: var(--faint); font-size: 20px; line-height: 1;
  cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.calc-del:hover { color: var(--negative, #FF5470); }
.calc-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.calc .ghost { background: none; border: 1px solid var(--border); border-radius: 12px; color: var(--muted);
  font: inherit; font-size: 13.5px; font-weight: 700; padding: 12px 16px; cursor: pointer; }
.calc .ghost:hover { border-color: var(--accent); color: var(--text); }
.calc button.cta { border: none; cursor: pointer; font: inherit; font-weight: 700; font-size: 14.5px; }
.calc-error { color: #FF5470; font-size: 13.5px; margin: 12px 0 0; min-height: 1em; }
.calc-noscript { color: var(--muted); font-size: 14.5px; line-height: 1.6; }

#calcResult { border-top: 1px solid var(--border); padding-top: 22px; margin-bottom: 28px; outline: none; }
.calc-h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.calc-list { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 9px; }
.calc-list li { font-size: 16px; line-height: 1.45; }
.calc-settled { color: var(--positive); font-size: 16px; margin: 0 0 26px; }
.calc-total { color: var(--muted); font-size: 13.5px; margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Calculateurs spécialisés (loyer, nuits, addition) ----------
   Le calculateur général n'a qu'une forme de ligne : prénom + montant. Ces
   trois-là ont besoin d'un champ unique en tête (le loyer, les prénoms), d'une
   troisième colonne (les nuits) et de pastilles « qui a consommé ». */
.calc-single { margin: 0 0 16px; }
.calc-single label { display: block; font-size: 13px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; margin: 0 0 6px; }
.calc-single input, .calc-single select { background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font: inherit; font-size: 15px; padding: 11px 12px; width: 100%; }
.calc-single input:focus, .calc-single select:focus { outline: 2px solid var(--accent); outline-offset: 1px;
  border-color: transparent; }
.calc-legend { color: var(--muted); font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.calc-row-one { grid-template-columns: 1fr auto; }
.calc-row-three { grid-template-columns: 1fr 78px 110px auto; }
.calc-row-item { grid-template-columns: 1fr 110px auto auto; }
/* En-tête de colonnes : sans elle, trois champs numériques côte à côte ne
   disent pas lequel attend des nuits et lequel attend des euros. */
.calc-head { display: grid; grid-template-columns: 1fr 78px 110px auto; gap: 8px;
  color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; margin: 0 0 6px; }
.calc-head span:nth-child(2), .calc-head span:nth-child(3) { text-align: right; }
.calc-item { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.calc-item:last-child { border-bottom: none; }
.calc-who { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.calc-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
  font-size: 13.5px; color: var(--muted); user-select: none; }
.calc-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.calc-chip:has(input:checked) { border-color: var(--accent); color: var(--text); }
.calc-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Repli pour les navigateurs sans :has() — la pastille reste lisible, elle ne
   montre simplement plus son état par la bordure. */
@supports not selector(:has(*)) {
  .calc-chip input { position: static; opacity: 1; width: auto; height: auto; accent-color: var(--accent); }
}
/* ---------- Générateur de relances ---------- */
.calc-row-relance { grid-template-columns: 1fr 140px; align-items: end; }
.calc-lab { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.calc-sign { margin: 4px 0 0; }
.relance { border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin: 0 0 14px;
  background: var(--surface); }
.relance-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.relance-ton { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; }
.relance-note { color: var(--faint); font-size: 12.5px; }
.relance-texte { font-size: 16.5px; line-height: 1.55; margin: 0 0 14px; }
.relance-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.relance-actions .ghost { background: none; border: 1px solid var(--border); border-radius: 10px;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 8px 13px;
  cursor: pointer; text-decoration: none; }
.relance-actions .ghost:hover { border-color: var(--accent); color: var(--text); }

.calc-keep { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0 0; }
.calc-keep .cta { text-decoration: none; }
.calc-copied { color: var(--positive); font-size: 13px; }

@media (max-width: 480px) {
  .calc-row { grid-template-columns: 1fr 96px auto auto; }
  .calc-actions .cta, .calc-actions .ghost { flex: 1; text-align: center; }
  .calc-row-three, .calc-head { grid-template-columns: 1fr 58px 84px auto; }
  .calc-row-item { grid-template-columns: 1fr 84px auto auto; }
  .calc-keep .cta, .calc-keep .ghost { flex: 1; text-align: center; }
}
