/*
Theme Name: Ronald DAIZO v5
Theme URI: https://ronalddaizo.com/
Author: Ronald DAIZO
Author URI: https://ronalddaizo.com/
Description: Theme one-page sur-mesure pour un profil communication et projets digitaux. Menu a ancres, portfolio filtrable, deux themes (sombre et clair), et tout le contenu modifiable depuis l'administration via l'ecran "Contenu du site".
Version: 5.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ronald-daizo-v5
Tags: one-page, portfolio, dark-mode, custom-colors, translation-ready, accessibility-ready
*/

/* =============================================================================
   THÈME "SIGNAL" - Ronald DAÏZO
   Thème sur-mesure. CSS natif, aucun framework.
   Un seul accent (bleu signal), un seul rayon de bord, deux modes (sombre/clair).
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Typographie */
  --ff-display: "Sora", ui-sans-serif, system-ui, sans-serif;
  --ff-body: "Outfit", ui-sans-serif, system-ui, sans-serif;

  /* Rayons : règle unique -> surfaces et contrôles = --r, micro-étiquettes = pilule */
  --r: 12px;
  --r-sm: 8px;
  --r-pill: 999px;

  /* Rythme */
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4.5rem, 8vw, 8rem);
  --nav-h: 100px;  /* barre haute, demandée pour donner sa place à l'emblème */

  /* Courbes */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 180ms var(--ease);
  --t: 320ms var(--ease);
}

/* --- Mode sombre (thème de marque, défaut) -------------------------------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #080c15;
  --bg-alt:        #0b1120;
  --surface:       #0f1829;
  --surface-hover: #131f34;

  --line:          rgba(255, 255, 255, 0.085);
  --line-strong:   rgba(255, 255, 255, 0.17);

  --text:   #e9eef9;
  --text-2: #9eadc6;
  --text-3: #74839c;

  --accent:        #7ea2ff;   /* texte, icônes, filets : contraste >= 7:1 sur --bg */
  --accent-solid:  #5b86ff;   /* fonds pleins (boutons) */
  --accent-ink:    #07101f;   /* texte posé sur --accent-solid : contraste 7,5:1 */
  --accent-soft:   rgba(91, 134, 255, 0.13);
  --accent-line:   rgba(126, 162, 255, 0.28);

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 44px rgba(2, 6, 16, 0.5);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.06), 0 28px 64px rgba(2, 6, 16, 0.62);

  /* Voiles posés sur les images : jamais de mix-blend-mode, qui écrase les photos */
  --scrim: linear-gradient(to top, rgba(8, 12, 21, 0.72), rgba(8, 12, 21, 0.06) 42%, transparent 66%);
  --media-tint: linear-gradient(165deg, rgba(91, 134, 255, 0.14), rgba(8, 12, 21, 0.46));
}

/* --- Mode clair ----------------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:            #f6f7fb;
  --bg-alt:        #ffffff;
  --surface:       #ffffff;
  --surface-hover: #ffffff;

  --line:          rgba(12, 22, 44, 0.1);
  --line-strong:   rgba(12, 22, 44, 0.22);

  --text:   #0d1526;
  --text-2: #4d5b73;
  --text-3: #5f6c83;   /* 4,98:1 sur --bg : passe AA pour les petits textes */

  --accent:        #2250d6;
  --accent-solid:  #2250d6;
  --accent-ink:    #ffffff;   /* contraste 5,8:1 */
  --accent-soft:   rgba(34, 80, 214, 0.075);
  --accent-line:   rgba(34, 80, 214, 0.22);

  --shadow-card: 0 1px 2px rgba(13, 21, 38, 0.04), 0 14px 36px rgba(13, 21, 38, 0.07);
  --shadow-lift: 0 2px 4px rgba(13, 21, 38, 0.05), 0 26px 56px rgba(13, 21, 38, 0.11);

  --scrim: linear-gradient(to top, rgba(13, 21, 38, 0.3), transparent 52%);
  --media-tint: linear-gradient(165deg, rgba(34, 80, 214, 0.08), rgba(13, 21, 38, 0.16));
}

/* -----------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 1rem;
  line-height: 1.7;
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--t), color var(--t);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--ff-display); font-weight: 600; }
p { margin: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

::selection { background: var(--accent-solid); color: var(--accent-ink); }

/* Lien d'évitement clavier */
.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 200;
  transform: translateY(-140%);
  padding: 0.7rem 1.1rem;
  background: var(--accent-solid);
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform var(--t-fast);
}
.skip:focus { transform: translateY(0.75rem); }

/* -----------------------------------------------------------------------------
   3. PRIMITIVES DE MISE EN PAGE
   -------------------------------------------------------------------------- */
/* La gouttière intègre les marges de sécurité (encoche, coins arrondis,
   barre gestuelle) pour que rien ne passe sous le châssis en paysage. */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px))
                  max(var(--gutter), env(safe-area-inset-right, 0px));
}

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section > .wrap { position: relative; }

/* Ancre : compense la barre de navigation collante */
[id] { scroll-margin-top: calc(var(--nav-h) + 1.5rem); }

/* --- Titres de section ---------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
}

.s-title {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  line-height: 1.07;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.s-intro {
  margin-top: 1.1rem;
  max-width: 56ch;
  color: var(--text-2);
  font-size: 1.0625rem;
}

.s-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }

/* --- Boutons -------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  white-space: nowrap;
  padding: 0.8rem 1.4rem;
  border-radius: var(--r);
  border: 1px solid transparent;
  font-family: var(--ff-body);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background-color var(--t-fast), border-color var(--t-fast),
              color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.btn i { font-size: 1.15em; }

.btn--primary {
  background: var(--accent-solid);
  color: var(--accent-ink);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.btn--primary:active { transform: translateY(0) scale(0.985); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--ghost:active { transform: translateY(0) scale(0.985); }

.btn--sm { padding: 0.5rem 0.95rem; font-size: 0.875rem; }
.btn--lg { padding: 1rem 1.9rem; font-size: 1rem; }

/* --- Étiquettes ----------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.tag--mute {
  background: transparent;
  color: var(--text-2);
  border-color: var(--line);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }

/* -----------------------------------------------------------------------------
   4. NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background-color var(--t);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .nav { background: var(--bg); }
}
.nav[data-stuck="true"] { border-bottom-color: var(--line); }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.nav__brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  margin-right: auto;
}
.nav__brand b {
  font-family: var(--ff-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.nav__brand span {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --- Logo : une version par thème, la bonne est affichée automatiquement.
   L'emblème est carré et contient déjà le nom : il porte seul la signature
   dans le menu, et s'affiche plus grand dans le pied de page. --- */
/* Les fichiers sont recadrés au plus près du dessin : la hauteur réglée ici
   est exactement celle de l'emblème visible, sans marge perdue. */
.brand__logo { height: 84px; width: auto; }
.foot__id .brand__logo { height: 140px; margin-bottom: 0.6rem; }
.brand__logo--dark { display: none; }
:root[data-theme="light"] .brand__logo--light { display: none; }
:root[data-theme="light"] .brand__logo--dark { display: block; }
@media (max-width: 639px) {
  .brand__logo { height: 62px; }
  .foot__id .brand__logo { height: 104px; }
}
@media (max-width: 400px) {
  .brand__logo { height: 54px; }
}

.nav__links { display: flex; align-items: center; gap: 0.25rem; }
.nav__link {
  position: relative;
  padding: 0.45rem 0.7rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast), background-color var(--t-fast);
}
.nav__link:hover { color: var(--text); background: var(--accent-soft); }
.nav__link[aria-current="true"] { color: var(--text); }
.nav__link[aria-current="true"]::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav__tools { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 1.125rem;
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }

.nav__burger { display: none; }

/* Barre de progression de lecture (amélioration progressive, CSS pur) */
.nav__progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  background: var(--accent);
  transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .nav__progress {
      animation: nav-progress linear forwards;
      animation-timeline: scroll(root block);
    }
  }
}
@keyframes nav-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* --- Panneau mobile ------------------------------------------------------- */
.menu {
  position: fixed;
  inset: var(--nav-h) 0 0;
  z-index: 99;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.5rem var(--gutter) 2.5rem;
  background: var(--bg);
  border-top: 1px solid var(--line);
  overflow-y: auto;
}
.menu[data-open="true"] { display: flex; }
.menu a:not(.btn) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.menu a:not(.btn) i { color: var(--text-3); font-size: 1rem; }
.menu .btn { margin-top: 1.5rem; }

@media (max-width: 1023px) {
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
}

/* -----------------------------------------------------------------------------
   5. ACCUEIL (split asymétrique)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100dvh - var(--nav-h));
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(3rem, 6vw, 5rem);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42rem 28rem at 78% 18%, var(--accent-soft), transparent 70%),
    radial-gradient(34rem 24rem at 4% 92%, var(--accent-soft), transparent 68%);
}
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(70% 60% at 50% 35%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 35%, #000 0%, transparent 100%);
  opacity: 0.55;
}
/* La trame est plus contrastée sur fond clair : on l'allège */
:root[data-theme="light"] .hero__bg::after { opacity: 0.3; }

.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem 0.35rem 0.7rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
@media (prefers-reduced-motion: no-preference) {
  .pill__dot { animation: dot-pulse 2.4s ease-in-out infinite; }
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.72); }
}

.hero__name {
  margin-top: 1.5rem;
  font-size: clamp(3rem, 8.5vw, 5.75rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.hero__name span { display: block; }
.hero__name span:last-child { color: var(--accent); }

.hero__deck {
  margin-top: 1.4rem;
  font-family: var(--ff-display);
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text);
  max-width: 24ch;
}
.hero__sub {
  margin-top: 0.85rem;
  max-width: 46ch;
  color: var(--text-2);
  font-size: 1rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* --- Portrait ------------------------------------------------------------- */
.hero__photo {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-lift);
  aspect-ratio: 4 / 5;
  max-height: min(62vh, 620px);
  margin-inline-start: auto;
  width: 100%;
}
.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}
.hero__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim);
  pointer-events: none;
}

/* -----------------------------------------------------------------------------
   6. BANDEAU CHIFFRES (rail de métriques, sans cartes)
   -------------------------------------------------------------------------- */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-block: 1px solid var(--line);
}
.figures__item {
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1rem, 2vw, 2rem);
  border-inline-start: 1px solid var(--line);
}
.figures__item:first-child { border-inline-start: 0; padding-inline-start: 0; }
.figures__val {
  font-family: var(--ff-display);
  /* Le palier haut tient compte du chiffre le plus large une fois son unite
     et son exposant ajoutes : au-dela, la valeur se casse sur deux lignes
     dans sa colonne. */
  font-size: clamp(1.95rem, 3.3vw, 2.9rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.045em;
  /* Ni le chiffre, ni son unite, ni son exposant ne doivent se separer. */
  white-space: nowrap;
}
.figures__val sup.figures__unit {
  font-size: 0.45em;
  font-weight: 500;
  top: -0.75em;
  color: var(--accent);
}
/* Unité posée sur la ligne de base (symboles monétaires) */
.figures__val span.figures__unit {
  margin-left: 0.2em;   /* espace avant le symbole, usage typographique français */
  font-size: 0.52em;
  font-weight: 500;
  color: var(--accent);
}
/* Le "+" qui suit une unité sur la ligne de base a besoin d'air */
.figures__val span.figures__unit + sup.figures__unit { margin-left: 0.08em; }
.figures__lbl {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-3);
  max-width: 22ch;
}

/* -----------------------------------------------------------------------------
   7. PROFIL (prose + fiche latérale)
   -------------------------------------------------------------------------- */
.profil {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: start;
}
.profil__prose { max-width: 62ch; }
.profil__prose .s-title { margin-bottom: 1.75rem; }
.profil__prose p + p { margin-top: 1.1rem; }
.profil__prose p { color: var(--text-2); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
}
.profil__card { padding: clamp(1.5rem, 3vw, 2rem); position: sticky; top: calc(var(--nav-h) + 2rem); }
.profil__card h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 1.25rem;
}
.profil__info { display: grid; gap: 0; }
.profil__info > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.profil__info > div:first-child { border-top: 0; padding-top: 0; }
.profil__info dt, .profil__info > div > span:first-child { color: var(--text-3); }
.profil__info > div > span:last-child { color: var(--text); font-weight: 500; }

.profil__tags { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.profil__tags h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.9rem;
}

/* -----------------------------------------------------------------------------
   8. PORTFOLIO (carte vedette + grille bento)
   -------------------------------------------------------------------------- */
.pf__bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.pf__filter {
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
}
.pf__filter:hover { color: var(--text); border-color: var(--line-strong); }
.pf__filter[aria-pressed="true"] {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: var(--accent-ink);
}

.pf__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.6vw, 1.25rem);
}

.pj {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-column: span 2;
  overflow: hidden;
  /* (largeurs réelles posées par .pj--w2 / --w3 / --w6, voir plus bas) */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color var(--t-fast), transform var(--t), box-shadow var(--t);
}
.pj:hover {
  border-color: var(--accent-line);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.pj[hidden] { display: none; }

/* Largeurs : la dernière rangée est toujours complète, jamais de trou */
.pj--w2 { grid-column: span 2; }
.pj--w3 { grid-column: span 3; }
.pj--w6 { grid-column: span 6; }

/* Carte vedette : pleine largeur, média et texte côte à côte */
.pj--featured { grid-column: span 6; flex-direction: row; }
.pj--featured .pj__media { width: 46%; height: auto; aspect-ratio: auto; }
.pj--featured .pj__body { flex: 1; padding: clamp(1.75rem, 3vw, 2.75rem); justify-content: center; }
.pj--featured .pj__title { font-size: clamp(1.35rem, 2.3vw, 1.85rem); }
.pj--featured .pj__desc { max-width: 52ch; }

/* En mode filtré, toutes les cartes reprennent la même taille */
.pf__grid[data-filtered="true"] .pj { grid-column: span 2; }
.pf__grid[data-filtered="true"] .pj--featured { flex-direction: column; }
.pf__grid[data-filtered="true"] .pj--featured .pj__media { width: 100%; aspect-ratio: 3 / 2; }
.pf__grid[data-filtered="true"] .pj--featured .pj__body { padding: 1.5rem; }
.pf__grid[data-filtered="true"] .pj--featured .pj__title { font-size: 1.0625rem; }

.pj__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--bg-alt);
  flex: none;
}
.pj__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}
.pj:hover .pj__media img { transform: scale(1.04); }
.pj__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--media-tint);
  opacity: 1;
  transition: opacity var(--t);
  pointer-events: none;
}
.pj:hover .pj__media::after { opacity: 0.55; }

/* Couverture conçue, utilisée tant qu'aucune capture réelle n'est fournie
   (champ "image" vide dans content.js). Ce n'est pas une fausse capture
   d'interface : c'est une vignette de marque, à remplacer en une ligne. */
.pj__media--cover {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 1.5rem;
  background:
    radial-gradient(130% 100% at var(--cx, 20%) var(--cy, 15%), var(--accent-soft), transparent 64%),
    linear-gradient(var(--ca, 150deg), var(--surface-hover), var(--bg-alt));
}
.pj__media--cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    var(--ca, 150deg), var(--line) 0 1px, transparent 1px 14px);
  opacity: 0.7;
}
.pj__media--cover::after { content: none; }
.pj__media--cover i { position: relative; font-size: 1.75rem; color: var(--accent); }
.pj__media--cover b {
  position: relative;
  font-family: var(--ff-display);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-2);
}
.pj--featured .pj__media--cover { aspect-ratio: auto; min-height: 15rem; }

.pj__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem;
}
.pj__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-3);
}
.pj__meta b { color: var(--accent); font-weight: 600; }
.pj__title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.pj__desc { color: var(--text-2); font-size: 0.9rem; line-height: 1.65; }
.pj__foot { margin-top: auto; padding-top: 0.5rem; }
.pj__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}
.pj__link i { transition: transform var(--t-fast); }
.pj:hover .pj__link i { transform: translateX(3px); }
.pj__src { font-size: 0.8125rem; color: var(--text-3); margin-top: 0.9rem; display: block; }

.pf__empty {
  grid-column: 1 / -1;
  padding: 3.5rem 1.5rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  text-align: center;
  color: var(--text-3);
}
.pf__empty[hidden] { display: none; }

/* -----------------------------------------------------------------------------
   9. PARCOURS (frise verticale, gouttière d'années)
   -------------------------------------------------------------------------- */
.xp { display: grid; gap: 0; }
.xp__row {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr) minmax(0, 15rem);
  gap: clamp(1.5rem, 3vw, 3rem);
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  transition: background-color var(--t-fast);
}
.xp__row:first-child { border-top: 0; padding-top: 0; }
.xp__when {
  font-family: var(--ff-display);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.xp__badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.6rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  font-family: var(--ff-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.xp__org {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.xp__role {
  margin-top: 0.4rem;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.xp__desc { margin-top: 0.75rem; color: var(--text-2); font-size: 0.9375rem; max-width: 62ch; }
.xp__side { align-self: center; }

/* -----------------------------------------------------------------------------
   10. EXPERTISES (onglets verticaux)
   -------------------------------------------------------------------------- */
.exp {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}
.exp__tabs { display: grid; gap: 0.35rem; }
.exp__tab {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--r);
  text-align: left;
  color: var(--text-2);
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.exp__tab i { font-size: 1.3rem; color: var(--text-3); transition: color var(--t-fast); }
.exp__tab span {
  font-family: var(--ff-display);
  font-size: 0.9875rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.exp__tab:hover { background: var(--accent-soft); color: var(--text); }
.exp__tab[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  box-shadow: var(--shadow-card);
}
.exp__tab[aria-selected="true"] i { color: var(--accent); }

.exp__panel {
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-card);
}
.exp__panel[hidden] { display: none; }
.exp__panel > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.4rem;
}
.exp__panel h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.exp__panel > p { margin-top: 0.7rem; color: var(--text-2); font-size: 0.9375rem; max-width: 46ch; }
.exp__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.6rem 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.exp__list li {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text-2);
}
.exp__list li::before {
  content: "";
  flex: none;
  width: 0.75rem;
  height: 1px;
  margin-top: 0.7rem;
  background: var(--accent);
}

/* -----------------------------------------------------------------------------
   11. FORMATION (rail horizontal à accroche)
   -------------------------------------------------------------------------- */
.edu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.6vw, 1.25rem);
}
.edu__item {
  display: flex;
  flex-direction: column;
  padding-top: 1.5rem;
  border-top: 2px solid var(--line);
  transition: border-color var(--t-fast);
}
.edu__item:hover { border-top-color: var(--accent); }
.edu__level {
  font-family: var(--ff-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.edu__year { margin-top: 0.2rem; font-size: 0.8125rem; color: var(--text-3); }
.edu__title {
  margin-top: 1rem;
  font-family: var(--ff-display);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.edu__school { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-2); }

/* -----------------------------------------------------------------------------
   11 bis. SECTIONS PERSONNALISÉES

   Les sections ajoutées depuis l'administration. Trois dispositions :
   texte seul, texte avec visuel à droite, texte avec visuel à gauche.
   -------------------------------------------------------------------------- */

.cs { display: grid; gap: clamp(2rem, 4vw, 4rem); align-items: center; }

.cs--texte { grid-template-columns: minmax(0, 1fr); }
.cs--texte .cs__text { max-width: 62ch; }

.cs--image-droite { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
.cs--image-gauche { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }

.cs__text .s-title { margin-bottom: 0; }
.cs__text .eyebrow + .s-title { margin-top: 0; }

.cs__body { margin-top: 1.5rem; color: var(--text-2); font-size: 1.0625rem; line-height: 1.8; }
.cs__body p + p { margin-top: 1.1rem; }

.cs__media {
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.cs__media img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4 / 3; }

@media (max-width: 900px) {
  .cs--image-droite,
  .cs--image-gauche { grid-template-columns: minmax(0, 1fr); }
  /* Sur une colonne, le visuel passe toujours après le texte. */
  .cs--image-gauche .cs__media { order: 2; }
  .cs__media img { aspect-ratio: 16 / 10; }
}

/* -----------------------------------------------------------------------------
   12. CONTACT
   -------------------------------------------------------------------------- */
.contact { text-align: center; }
.contact .eyebrow { justify-content: center; }
.contact__title {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.contact__intro {
  max-width: 48ch;
  margin: 1.25rem auto 0;
  color: var(--text-2);
  font-size: 1.0625rem;
}
.contact .btn { margin-top: 2.25rem; }

.channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 54rem;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  border-block: 1px solid var(--line);
}
.channels a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1.75rem 1rem;
  border-inline-start: 1px solid var(--line);
  transition: background-color var(--t-fast);
}
.channels a:first-child { border-inline-start: 0; }
.channels a:hover { background: var(--accent-soft); }
.channels i { font-size: 1.25rem; color: var(--accent); margin-bottom: 0.3rem; }
.channels small {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
}
.channels b { font-size: 0.9375rem; font-weight: 500; letter-spacing: -0.01em; }

/* -----------------------------------------------------------------------------
   13. PIED DE PAGE
   -------------------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding-block: 2.25rem;
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.foot__id b {
  display: block;
  font-family: var(--ff-display);
  font-size: 0.9375rem;
  font-weight: 600;
}
.foot__id span { font-size: 0.8125rem; color: var(--text-3); }
.foot__meta { font-size: 0.8125rem; color: var(--text-3); }
.foot__top {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  transition: color var(--t-fast);
}
.foot__top:hover { color: var(--accent); }

/* -----------------------------------------------------------------------------
   14. APPARITIONS AU DÉFILEMENT
   -------------------------------------------------------------------------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  transition-delay: var(--d, 0ms);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

/* -----------------------------------------------------------------------------
   15. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .hero { min-height: 0; }
  .hero__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero__photo { order: -1; max-width: 22rem; margin-inline: 0; max-height: none; }
  .hero__deck, .hero__sub { max-width: 40ch; }

  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures__item:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
  .figures__item:nth-child(n + 3) { border-top: 1px solid var(--line); }

  .profil { grid-template-columns: 1fr; }
  .profil__card { position: static; }

  .pf__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pj--w2, .pj--w3 { grid-column: span 2; }
  .pj--w6, .pj--featured { grid-column: span 4; }
  .pf__grid[data-filtered="true"] .pj { grid-column: span 2; }

  .xp__row { grid-template-columns: 9rem minmax(0, 1fr); }
  .xp__side { grid-column: 2; align-self: start; }

  .exp { grid-template-columns: 1fr; }
  .exp__tabs {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .exp__tab { scroll-snap-align: start; white-space: nowrap; }
  .exp__tab[aria-selected="true"] { box-shadow: none; }

  .edu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  :root { --nav-h: 78px; }

  /* La baseline ferait passer la marque sur deux lignes */
  .nav__brand span { display: none; }
  .nav__inner { gap: 0.6rem; }

  .hero__photo { max-width: 100%; max-height: 42vh; aspect-ratio: 5 / 4; }
  .hero__cta { display: grid; }
  .hero__cta .btn { width: 100%; }

  .figures { grid-template-columns: 1fr; }
  .figures__item {
    border-inline-start: 0;
    padding-inline: 0;
    border-top: 1px solid var(--line);
  }
  .figures__item:first-child { border-top: 0; }
  .figures__lbl { max-width: none; }

  .pf__grid { grid-template-columns: 1fr; }
  .pj, .pj--w2, .pj--w3, .pj--w6,
  .pf__grid[data-filtered="true"] .pj { grid-column: 1 / -1; }
  .pj--featured { flex-direction: column; }
  .pj--featured .pj__media { width: 100%; aspect-ratio: 3 / 2; }
  .pj--featured .pj__media--cover { min-height: 0; }
  .pj--featured .pj__body { padding: 1.5rem; }
  .pj--featured .pj__title { font-size: 1.0625rem; }

  .xp__row { grid-template-columns: 1fr; gap: 0.75rem; }
  .xp__side { grid-column: 1; }

  .edu { grid-template-columns: 1fr; }

  .channels { grid-template-columns: 1fr; }
  .channels a { border-inline-start: 0; border-top: 1px solid var(--line); }
  .channels a:first-child { border-top: 0; }

  .foot__inner { flex-direction: column; align-items: flex-start; }
}

/* -----------------------------------------------------------------------------
   15 bis. PETITS ÉCRANS, ÉCRANS COURTS ET APPAREILS PLIANTS

   Cibles vérifiées :
     320 x 790   écran de couverture Galaxy Z Fold (cas le plus étroit)
     466 x 678   iPhone Duo replié
     626 x 890   iPhone Duo déplié
     720 x 619   Galaxy Z Fold déplié (format quasi carré, très peu haut)
   -------------------------------------------------------------------------- */

/* Portfolio sur deux colonnes dès 540 px : profite de la largeur des écrans
   de pliants dépliés sans attendre le palier tablette. */
@media (min-width: 540px) and (max-width: 639px) {
  .pf__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj, .pj--w2, .pj--w3, .pj--w6,
  .pf__grid[data-filtered="true"] .pj { grid-column: span 1; }
  .pj--featured { grid-column: 1 / -1; }
  .edu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .channels a { border-inline-start: 1px solid var(--line); border-top: 0; }
  .channels a:first-child { border-inline-start: 0; }
}

/* Écrans très étroits : on resserre sans jamais déborder. */
@media (max-width: 400px) {
  :root { --gutter: 1.1rem; }
  .nav__inner { gap: 0.45rem; }
  .nav__tools { gap: 0.35rem; }
  .icon-btn { width: 34px; height: 34px; }
  .btn--sm { padding: 0.45rem 0.7rem; font-size: 0.8125rem; }
  .hero__name { font-size: clamp(2.5rem, 13vw, 3rem); }
  .hero__deck { font-size: 1rem; }
  .figures__val span.figures__unit { margin-left: 0.14em; }
  .pf__bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: none; }
  .pf__bar::-webkit-scrollbar { display: none; }
  .pf__filter { flex: none; }
  .profil__info > div { grid-template-columns: 1fr; gap: 0.1rem; }
}

/* Écrans courts (pliant déplié en paysage, petit portable) : on rend
   la hauteur au contenu plutôt qu'aux marges. */
@media (max-height: 700px) and (min-width: 640px) {
  :root { --section-y: clamp(2.75rem, 5vh, 4rem); }
  .hero { min-height: 0; padding-block: 2.5rem 3rem; }
  .hero__photo { max-height: 52vh; }
}

/* Pliants dépliés au format quasi carré : la colonne de texte du héros
   reste lisible et la photo ne mange pas tout l'écran. */
@media (min-width: 640px) and (max-width: 1023px) and (max-aspect-ratio: 13 / 10) {
  .hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; }
  .hero__photo { order: 0; max-width: none; max-height: 46vh; aspect-ratio: 4 / 5; }
  .hero__name { font-size: clamp(2.75rem, 7vw, 4rem); }
}

/* Appareil plié en deux, contenu réparti sur les deux panneaux :
   les colonnes sont calées sur les segments et l'écart reprend
   exactement la largeur de la charnière, donc rien n'est coupé.
   Non vérifiable en émulation : à contrôler sur l'appareil réel. */
@media (horizontal-viewport-segments: 2) {
  :root {
    --seg-1: env(viewport-segment-width 0 0, 50%);
    --seg-2: env(viewport-segment-width 1 0, 50%);
    --hinge: calc(env(viewport-segment-left 1 0, 50%) - env(viewport-segment-right 0 0, 50%));
  }
  .wrap { max-width: none; padding-inline: 0; }
  .wrap > *, .hero__grid > *, .profil > *, .exp > * { padding-inline: 1.25rem; }

  .hero__grid, .profil, .exp, .pf__grid, .figures, .edu, .channels {
    grid-template-columns: var(--seg-1) var(--seg-2);
    column-gap: var(--hinge);
  }
  .hero__grid > *, .profil > *, .exp > * { padding-inline: 1.25rem; }
  .pj, .pj--w2, .pj--w3, .pj--w6, .pf__grid[data-filtered="true"] .pj { grid-column: span 1; }
  .pj--featured { grid-column: span 1; flex-direction: column; }
  .pj--featured .pj__media { width: 100%; aspect-ratio: 3 / 2; }
  .pj--featured .pj__media--cover { min-height: 0; }
  .pj--featured .pj__body { padding: 1.5rem; }
  .pj--featured .pj__title { font-size: 1.0625rem; }
  .figures__item:nth-child(odd) { border-inline-start: 0; padding-inline-start: 1.25rem; }
  .channels a { border-inline-start: 0; }
}

/* Même intention pour les navigateurs qui n'implémentent que l'ancienne
   syntaxe (Surface Duo, anciens Samsung Internet). */
@media (spanning: single-fold-vertical) {
  .wrap { max-width: none; }
  .pj--featured { flex-direction: column; }
  .pj--featured .pj__media { width: 100%; aspect-ratio: 3 / 2; }
}

/* -----------------------------------------------------------------------------
   16. PRÉFÉRENCES UTILISATEUR
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html.js [data-reveal] { opacity: 1; transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media print {
  .nav, .menu, .foot__top, .pf__bar, .ed { display: none !important; }
  body { background: #fff; color: #000; }
}

/* -----------------------------------------------------------------------------
   17. MODE ÉDITION (?edit=1) - outil d'auteur, pas de rendu public
   -------------------------------------------------------------------------- */
.ed {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 150;
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(80vh, 40rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
  font-size: 0.875rem;
}
.ed__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}
.ed__head b { font-family: var(--ff-display); font-size: 0.9375rem; margin-right: auto; }
.ed__body { padding: 1rem; overflow-y: auto; display: grid; gap: 1rem; }
.ed__body[hidden] { display: none; }
.ed__group > h4 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.6rem;
}
.ed__switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
}
.ed__switch input { accent-color: var(--accent-solid); width: 1rem; height: 1rem; }
.ed__switch span { margin-right: auto; }
.ed__switch button {
  display: inline-flex;
  width: 1.6rem;
  height: 1.6rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
}
.ed__switch button:hover { color: var(--accent); border-color: var(--accent-line); }
.ed__list { display: grid; gap: 0.35rem; }
.ed__actions { display: grid; gap: 0.5rem; }
.ed__note { color: var(--text-3); font-size: 0.8125rem; line-height: 1.5; }

html.editing [data-edit] {
  outline: 1px dashed var(--accent-line);
  outline-offset: 3px;
  border-radius: 2px;
}
html.editing [data-edit]:focus {
  outline: 2px solid var(--accent);
  background: var(--accent-soft);
}


/* =============================================================================
   CORRECTIFS WORDPRESS
   ========================================================================== */

/* La barre d'administration est fixee en haut : le menu colle se place dessous. */
body.admin-bar .nav { top: 32px; }
body.admin-bar .menu { inset: calc(var(--nav-h) + 32px) 0 0; }

@media screen and (max-width: 782px) {
  body.admin-bar .nav { top: 46px; }
  body.admin-bar .menu { inset: calc(var(--nav-h) + 46px) 0 0; }
}

/* WordPress peut injecter une marge haute sur html : on la neutralise
   pour le calcul de hauteur du premier ecran. */
body.admin-bar .hero { min-height: calc(100dvh - var(--nav-h) - 32px); }

@media screen and (max-width: 782px) {
  body.admin-bar .hero { min-height: 0; }
}

/* Repli affiche si JavaScript est desactive. */
.rd-noscript {
  max-width: 40rem;
  margin: 4rem auto;
  padding: 0 1.5rem;
  line-height: 1.7;
}
.rd-noscript h1 { font-size: 1.75rem; }
.rd-noscript a { color: var(--accent); }

/* =============================================================================
   PAGES ET ARTICLES WORDPRESS

   Le site one-page occupe la page d'accueil. Les pages, articles, archives
   et resultats de recherche gardent leur contenu, mis en forme ici avec la
   meme palette et la meme typographie.
   ========================================================================== */

.rd-page { padding-top: clamp(3rem, 6vw, 5rem); }

.rd-list { display: grid; gap: 0; }

.rd-item {
  padding-block: clamp(1.75rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
  max-width: 62ch;
}
.rd-item:first-child { border-top: 0; padding-top: 0; }

.rd-item__date {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

.rd-item__title {
  margin-top: 0.5rem;
  font-family: var(--ff-display);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.rd-item__title a { transition: color var(--t-fast); }
.rd-item__title a:hover { color: var(--accent); }

.rd-item__excerpt { margin-top: 0.7rem; color: var(--text-2); font-size: 0.9375rem; }
.rd-item__excerpt p { margin: 0; }

/* --- Article seul ------------------------------------------------------- */
.rd-article { max-width: 46rem; }

.rd-article__media {
  margin: 0 0 2rem;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
}
.rd-article__media img { width: 100%; height: auto; display: block; }

.rd-prose { color: var(--text-2); font-size: 1.0625rem; line-height: 1.8; }
.rd-prose > * + * { margin-top: 1.1rem; }
.rd-prose h2,
.rd-prose h3,
.rd-prose h4 {
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-top: 2.25rem;
}
.rd-prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.rd-prose h3 { font-size: 1.25rem; }
.rd-prose h4 { font-size: 1.0625rem; }
.rd-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 0.2em; }
.rd-prose strong { color: var(--text); font-weight: 600; }
.rd-prose ul,
.rd-prose ol { padding-left: 1.3rem; }
.rd-prose ul { list-style: disc; }
.rd-prose ol { list-style: decimal; }
.rd-prose li + li { margin-top: 0.4rem; }
.rd-prose img,
.rd-prose iframe,
.rd-prose video {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  display: block;
}
.rd-prose blockquote {
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  color: var(--text);
  font-style: normal;
}
.rd-prose code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.875em;
  padding: 0.12em 0.4em;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.rd-prose pre {
  padding: 1.25rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow-x: auto;
}
.rd-prose pre code { background: none; color: var(--text-2); padding: 0; }
.rd-prose table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.rd-prose th,
.rd-prose td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); text-align: left; }
.rd-prose th { color: var(--text); font-weight: 600; }
.rd-prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2rem; }

/* --- Pagination --------------------------------------------------------- */
.navigation.pagination { margin-top: 3rem; }
.navigation.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 0.9rem;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.navigation.pagination .page-numbers:hover { color: var(--text); border-color: var(--line-strong); }
.navigation.pagination .page-numbers.current {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: var(--accent-ink);
  font-weight: 600;
}
.navigation.pagination .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
