/* BacklogPress : styles de base provisoires, sobres (noir et blanc).
   Le vrai système graphique (couleurs, polices) viendra avec les maquettes :
   il suffira alors de changer surtout les variables ci-dessous. */
:root {
  --text: #1a1a1a;
  --bg: #ffffff;
  --muted: #555555;
  --line: #dddddd;
  --soft: #f4f4f2;
  --accent: #1a1a1a;
  --accent-text: #ffffff;
  --radius: 0;
  --wide: 72rem;
  --narrow: 42rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; }

/* Texte lu par les lecteurs d'écran mais invisible à l'œil. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Lien « Aller au contenu », visible seulement au clavier. */
.skip-link { position: absolute; left: -999px; top: 0; padding: 0.5rem 1rem; background: var(--accent); color: var(--accent-text); z-index: 10; }
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid #2b6cb0; outline-offset: 2px; }

/* Repère visible des informations encore manquantes. */
mark.todo { background: #ffe066; color: #000; font-weight: 700; padding: 0 0.2em; }

/* Emplacement d'image pas encore fournie : case grise + nom du fichier attendu. */
.img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 0.5rem;
  background: repeating-linear-gradient(45deg, #ececea, #ececea 10px, #e2e2df 10px, #e2e2df 20px);
  border: 1px dashed #999;
  color: #444; font-size: 0.8rem; text-align: center; overflow-wrap: anywhere;
}
.img-placeholder span { background: rgba(255, 255, 255, 0.85); padding: 0.15rem 0.4rem; }

/* --- En-tête : logo centré, langues à droite --- */
.site-header { border-bottom: 1px solid var(--line); }
.site-header__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1rem;
}
.logo {
  grid-column: 2;
  font-weight: 800; font-size: 1.6rem; letter-spacing: 0.02em;
  text-decoration: none;
}
.logo img { max-height: 3.5rem; width: auto; }
/* Langues calées sur le bord droit du contenu (même largeur que <main>). */
.lang-switch { grid-column: 3; justify-self: end; }
.lang-switch a { margin-left: 0.75rem; color: var(--muted); }
.lang-switch a:first-child { margin-left: 0; }
.lang-switch a[aria-current="true"] { color: var(--text); font-weight: 700; text-decoration: none; }

/* --- Mise en page générale --- */
main { max-width: var(--wide); margin: 0 auto; padding: 2rem 1rem 3rem; }
.section { padding: 3rem 0 1rem; }
.section-title { text-align: center; font-size: 1.7rem; font-weight: 800; margin: 0 0 1.5rem; }
.section-intro { max-width: var(--narrow); margin: 0 auto 1.5rem; text-align: center; color: var(--muted); }
.section-more { text-align: center; margin-top: 1.5rem; font-weight: 700; }
.page-header { text-align: center; margin-bottom: 1.5rem; }
.page-header h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0.5rem 0; }
.eyebrow { margin: 0; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.box { padding: 1.5rem; background: var(--soft); border: 1px solid var(--line); }
.box h3 { margin-top: 0; }
.grid-2 + .section-intro { margin-top: 1.5rem; }

/* --- Boutons et étiquettes --- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 1.25rem 0; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.4rem;
  border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover, .btn:focus-visible { background: var(--bg); color: var(--accent); }
.btn--secondary { background: var(--bg); color: var(--accent); }
.btn--secondary:hover { background: var(--accent); color: var(--accent-text); }
.btn--large { width: 100%; padding: 1rem; font-size: 1.15rem; }
.btn--disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn--disabled:hover, .btn:disabled:hover { background: var(--accent); color: var(--accent-text); }

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--text);
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.perks { padding-left: 1.25rem; text-align: left; }
.perks li { margin-bottom: 0.35rem; }

/* --- Pied de page : bloc pleine largeur, fond sombre (comme Third Éditions) --- */
.site-footer {
  --footer-bg: #1a1a1a;
  --footer-text: #f4f4f2;
  --footer-muted: #c4c4c0;   /* contraste 10:1 sur le fond */
  --footer-line: #3a3a3a;
  padding: 0 1rem 1.5rem;
  color: var(--footer-muted);
  background: var(--footer-bg);
}
.site-footer a { color: var(--footer-text); }
.site-footer__cols, .site-footer__nav, .site-footer__copy { max-width: calc(var(--wide) - 2rem); margin-left: auto; margin-right: auto; }
.site-footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding-top: 2.5rem; margin-bottom: 2rem; }
.site-footer__name { margin: 0; color: var(--footer-text); font-weight: 800; font-size: 1.2rem; }
.site-footer__title { margin: 0 0 0.5rem; color: var(--footer-text); font-size: 1.1rem; }
.social-list { margin: 0; padding: 0; list-style: none; }
.social-list li { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.social-list svg { flex: none; color: var(--footer-text); }
.site-footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; padding-top: 1.5rem; border-top: 1px solid var(--footer-line); }
.site-footer__copy { text-align: center; }
.site-footer .form-note { color: var(--footer-muted); }
/* Newsletter (accueil) : en haut du pied de page, séparée par un trait. */
.footer-newsletter { max-width: var(--narrow); margin: 0 auto; padding: 3rem 0 2.5rem; text-align: center; border-bottom: 1px solid var(--footer-line); color: var(--footer-text); }
.footer-newsletter__title { margin: 0 0 0.5rem; font-size: 1.6rem; }
.footer-newsletter p { margin: 0 0 1.25rem; }
.footer-newsletter .form-note { margin: 0.75rem 0 0; }
.site-footer .inline-form input[type="email"] { border-color: var(--footer-text); }
.site-footer .btn { background: var(--footer-text); color: var(--footer-bg); border-color: var(--footer-text); }
.site-footer .btn:hover, .site-footer .btn:focus-visible { background: var(--footer-bg); color: var(--footer-text); }
.site-footer :focus-visible { outline-color: #8cc4ff; }

.form-note { font-size: 0.85rem; color: var(--muted); }


/* --- Onglets (classements du Panthéon sur téléphone) --- */
.tabs { margin: 0 0 1rem; }
.tabs__list { display: flex; flex-wrap: wrap; border-bottom: 2px solid var(--text); }
.tabs__list [role="tab"] {
  padding: 0.75rem 1.25rem; border: 0; background: none;
  font: inherit; font-weight: 700; color: var(--muted); cursor: pointer;
}
.tabs__list [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-text); }
.tabs__panel { padding: 1.5rem 0; max-width: 50rem; }
.js .tabs__heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --- Accueil --- */
/* Chaque carnet sur un fond crème. */
/* Un seul carnet (accueil anglais) : centré, même largeur qu'un carnet sur deux. */
.grid-2 > .logbook:only-child { grid-column: 1 / -1; justify-self: center; width: min(100%, calc(50% - 0.75rem)); }
@media (max-width: 40rem) { .grid-2 > .logbook:only-child { width: 100%; } }
.logbook { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1.25rem; align-items: start; padding: 1.25rem; background: #f5efe3; }
.logbook__cover { border: 1px solid var(--line); }
.logbook__title { margin: 0.5rem 0; font-size: 1.3rem; }
.logbook__body p { margin: 0 0 0.75rem; }
.logbook__body .actions { margin: 1rem 0 0.75rem; }
.actions--center { justify-content: center; }
.inline-form { display: flex; gap: 0.5rem; max-width: 30rem; margin: 0 auto; }
.inline-form input[type="email"] { flex: 1; min-width: 0; padding: 0.75rem; font: inherit; border: 2px solid var(--text); }

/* --- Panthéon --- */
.hashtag { font-size: 1.3rem; font-weight: 800; }
.ranking { width: 100%; border-collapse: collapse; }
.ranking th, .ranking td { padding: 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
.ranking-empty { padding: 2rem 1rem; text-align: center; background: var(--soft); font-style: italic; }
.badge { display: inline-block; white-space: nowrap; margin: 0.1rem 0; padding: 0.1rem 0.5rem; border: 1px solid var(--text); font-size: 0.8rem; font-weight: 700; }
.badge--platine { background: var(--accent); color: var(--accent-text); }
.badges-list dt { margin-top: 0.75rem; }
.badges-list dd { margin: 0.25rem 0 0; }
/* Sur grand écran, les deux classements sont côte à côte, sans onglets. */
@media (min-width: 48rem) {
  .tabs--split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
  .tabs--split .tabs__list { display: none; }
  .tabs--split .tabs__panel[hidden] { display: block; }
  .js .tabs--split .tabs__heading { position: static; width: auto; height: auto; clip: auto; }
}

/* --- Pages de texte (légales) : colonne étroite, plus facile à lire --- */
.text-page { max-width: var(--narrow); margin: 0 auto; }
.text-page h1 { font-size: 1.9rem; }
.text-page h2 { font-size: 1.3rem; margin-top: 2.25rem; }
.text-page h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.text-page ul { padding-left: 1.25rem; }
.text-page li { margin-bottom: 0.35rem; }
.text-page a { overflow-wrap: anywhere; }
.updated { margin-top: 2.5rem; color: var(--muted); font-size: 0.95rem; }
/* Page 404 : carte crème centrée, grand « 404 » rouge, un bouton. */
.notfound { max-width: 34rem; margin: 1.5rem auto 0; padding: 2.5rem 1.5rem 3rem; background: #f5efe3; text-align: center; }
.notfound .notfound__code { margin: 0; font-size: clamp(4.5rem, 18vw, 7rem); font-weight: 800; line-height: 1; letter-spacing: 0.04em; color: #b23a2e; }
.notfound h1 { margin: 0.75rem 0 0.5rem; font-size: 1.7rem; }
.notfound p { margin: 0 0 1.75rem; }

/* --- Page autonome (Bonus, Démo) --- */
.standalone { background: var(--soft); }
.standalone main { max-width: 34rem; padding-top: 2.5rem; }
.standalone__box { padding: 2rem; background: var(--bg); border: 1px solid var(--line); text-align: center; }
.standalone__logo { margin: 0 0 1rem; font-weight: 800; font-size: 1.4rem; }
.standalone__logo img { max-height: 3rem; width: auto; margin: 0 auto; }
.standalone__box h1 { font-size: 1.9rem; margin: 0 0 0.75rem; }
.standalone__img { margin: 1.25rem 0; }
.standalone__subtitle { font-size: 1.1rem; margin-bottom: 0.25rem; }
.standalone__section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.standalone__section p { margin: 0 0 1rem; }
.standalone .form-note { margin: 0.75rem 0 0; }
a.btn--large { display: block; text-align: center; }
.standalone .perks { display: inline-block; margin-top: 0.25rem; }
/* Gros bouton de téléchargement direct du PDF. */
.standalone__download { margin: 1.5rem 0 0.5rem; }
/* Newsletter facultative : le formulaire garde le style de Kit (bloc <style> du code Kit). */
.kit-newsletter__title { font-size: 1.05rem; line-height: 1.4; margin: 0 0 1rem; }
.kit-newsletter .formkit-form { margin: 0 auto; }
/* Le code Kit annonce une largeur de 700-800 px (min-width="…") et ajoute alors
   56 px vides au-dessus du champ, même sur téléphone : on les retire ici,
   sans toucher au code Kit (« !important » car son style est chargé après le nôtre). */
.kit-newsletter .formkit-form [data-style="clean"] { padding: 0 !important; }
/* Message « Merci ! » affiché quand l'adresse contient ?inscrit=1. */
.kit-newsletter__thanks { padding: 0.9rem 1rem; border: 2px solid var(--text); background: var(--soft); font-weight: 700; }
/* Bouton principal des pages Bonus et Démo : rouge, coins arrondis, effet « touche »
   (bord bas plus foncé qui disparaît quand on clique, comme un bouton enfoncé). */
.btn--cta {
  --cta: #b23a2e;          /* blanc sur ce rouge : contraste 6:1 */
  --cta-hover: #9a3127;
  --cta-edge: #7a251d;
  border: 0; border-radius: 4px;
  background: var(--cta); color: #fff;
  box-shadow: 0 4px 0 var(--cta-edge);
  margin-bottom: 4px;
  transition: background-color 0.15s ease, transform 0.05s ease, box-shadow 0.05s ease;
}
.btn--cta:hover, .btn--cta:focus-visible { background: var(--cta-hover); color: #fff; }
.btn--cta:active { transform: translateY(4px); box-shadow: 0 0 0 var(--cta-edge); }
.btn--cta:disabled, .btn--cta:disabled:hover { background: var(--cta); color: #fff; transform: none; }
.standalone__footer { padding: 1.5rem 1rem 2.5rem; font-size: 0.85rem; color: var(--muted); }
.standalone__footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; }

/* --- Téléphone --- */
@media (max-width: 40rem) {
  .site-header__top { padding: 1rem 1rem 0.25rem; }
  .logo { font-size: 1.3rem; }
  .grid-2, .site-footer__cols { grid-template-columns: 1fr; gap: 1.5rem; }
  .logbook { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .inline-form { flex-direction: column; }
  .tabs__list [role="tab"] { flex: 1 1 auto; padding: 0.6rem 0.75rem; }
  /* Classement : une petite fiche par entrée (rang à gauche, nom, date et badges dessous). */
  .ranking thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ranking tr { display: grid; grid-template-columns: 2.5rem 1fr; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .ranking td { padding: 0.1rem 0; border: 0; }
  .ranking td:nth-child(1) { grid-row: span 3; font-size: 1.3rem; font-weight: 800; }
  .ranking td:nth-child(2) { font-weight: 700; }
  .ranking td:nth-child(3) { color: var(--muted); font-size: 0.95rem; }
  .ranking td:empty { display: none; }
  .standalone__box { padding: 1.25rem; }
}
