/* style.css — Magazine Madame, thème « Le carnet bleu ».
   Un magazine papier remis à plat : grands titres serif, filets fins, numéros de rubrique, encre bleue.
   Toutes les couleurs, polices et espacements viennent de tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--creme); color: var(--encre);
  font-family: var(--police-texte); font-size: var(--t-m); line-height: 1.65;
  font-feature-settings: "kern", "liga";
  overflow-x: clip;
}
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--cobalt-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 1px; }
h1, h2, h3, h4 { font-family: var(--police-titre); font-weight: 400; line-height: 1.1; letter-spacing: -0.005em; margin: 0; text-wrap: balance; }
p { margin: 0 0 var(--e-4); }
button { font: inherit; }

.evitement { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--cobalt); color: var(--sur-cobalt); padding: var(--e-3) var(--e-4); }
.evitement:focus { left: var(--e-4); top: var(--e-4); }

.conteneur { width: 100%; max-width: var(--largeur); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.etroit { max-width: calc(var(--largeur-texte) + 5rem); }
.num { font-family: var(--police-titre); font-variant-numeric: lining-nums; color: var(--cobalt); }

/* ---------- En-tête : bandeau, titre de une, sommaire numéroté ---------- */
.tete { border-bottom: 1px solid var(--filet-fort); background: var(--creme); }
.tete-filet { border-bottom: 1px solid var(--filet); font-size: var(--t-xs); letter-spacing: 0.04em; color: var(--encre-douce); }
.tete-filet-in { display: flex; justify-content: space-between; gap: var(--e-4); padding-block: var(--e-2); }
.tete-filet p { margin: 0; text-transform: uppercase; }
.tete-filet a { color: var(--encre); font-weight: 600; text-decoration: none; }
.tete-filet a:hover { color: var(--cobalt); text-decoration: underline; }
.tete-marque { display: flex; justify-content: center; padding-block: var(--e-5) var(--e-4); }
.marque { display: inline-block; }
.marque img { width: clamp(170px, 30vw, 260px); }
.tete-nav { border-top: 1px solid var(--filet); }
.tete-nav ol { list-style: none; margin: 0; padding: 0; display: flex; justify-content: flex-start; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tete-nav ol::-webkit-scrollbar { display: none; }
.tete-nav li { flex: 0 0 auto; }
.tete-nav li > * { display: flex; align-items: baseline; gap: 0.45em; padding: var(--e-3) var(--e-4); color: var(--encre); text-decoration: none; font-size: var(--t-s); font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.tete-nav li .num { font-size: 1.05em; font-weight: 400; }
.tete-nav a:hover { color: var(--cobalt); }
.tete-nav a[aria-current="page"] { border-bottom-color: var(--cobalt); color: var(--cobalt); }

@media (max-width: 699px) {
  .tete-filet { display: none; }
  .tete-marque { padding-block: var(--e-4) var(--e-3); }
  .tete-nav a, .tete-nav li > * { padding-inline: var(--e-3); }
}
@media (min-width: 1000px) { .tete-nav ol { justify-content: center; } }

/* ---------- Fil d'Ariane ---------- */
.ariane ol { list-style: none; margin: 0 0 var(--e-5); padding: 0; display: flex; flex-wrap: wrap; gap: 0.3em 0; font-size: var(--t-xs); color: var(--encre-douce); }
.ariane li + li::before { content: "/"; margin-inline: 0.55em; color: var(--filet); }
.ariane a { color: var(--encre-douce); }

/* ---------- Une (accueil) ---------- */
.une { position: relative; border-bottom: 1px solid var(--filet-fort); }
.une-media { position: relative; overflow: hidden; background: var(--rose); }
.une-media picture, .une-media img, .une-media video { width: 100%; height: 100%; }
.une-media img, .une-media video { object-fit: cover; object-position: 55% 50%; aspect-ratio: 4 / 5; max-height: 54vh; }
.une-lumiere { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, rgba(255, 244, 222, 0.22) 0%, rgba(255, 244, 222, 0) 38%, rgba(20, 30, 80, 0.06) 100%); }
.une-texte { position: relative; }
.une-carte { background: var(--creme); padding: var(--e-5) 0 var(--e-6); }
.une .surtitre { margin-bottom: var(--e-3); }
.une h1 { font-size: var(--t-3xl); line-height: 0.98; }
.une .chapo { margin-top: var(--e-4); }
.une-signe { font-size: var(--t-s); color: var(--encre-douce); margin: var(--e-4) 0 0; }

@media (min-width: 860px) {
  .une { min-height: min(86vh, 760px); display: grid; }
  .une-media { grid-area: 1 / 1; }
  .une-media img, .une-media video { aspect-ratio: auto; height: min(86vh, 760px); max-height: none; }
  .une-texte { grid-area: 1 / 1; align-self: end; pointer-events: none; padding-bottom: var(--e-7); }
  .une-carte { pointer-events: auto; max-width: 34rem; padding: var(--e-6) var(--e-6) var(--e-5); box-shadow: 10px 10px 0 var(--cobalt); }
}

@media (prefers-reduced-motion: no-preference) {
  .media-anime img { animation: mm-matin 26s ease-in-out infinite alternate; transform-origin: 62% 58%; will-change: transform; }
  .une-lumiere { animation: mm-lumiere 12s ease-in-out infinite alternate; }
  @keyframes mm-matin { from { transform: scale(1.06) translate3d(-1.2%, 0.6%, 0); } to { transform: scale(1.0) translate3d(0, 0, 0); } }
  @keyframes mm-lumiere { from { transform: translate3d(-3%, 0, 0); opacity: 0.75; } to { transform: translate3d(3%, 0, 0); opacity: 1; } }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--e-7); }
.section + .section { border-top: 1px solid var(--filet); }
.section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e-4); flex-wrap: wrap; margin-bottom: var(--e-5); }
.titre-section { font-size: var(--t-xl); margin-bottom: var(--e-5); display: flex; align-items: center; gap: var(--e-4); }
.titre-section::after { content: ""; flex: 1; height: 1px; background: var(--filet-fort); }
.section-tete .titre-section { margin-bottom: 0; flex: 1; }
.lien-suite { font-weight: 600; font-size: var(--t-s); }
.vide { color: var(--encre-douce); }

/* Sommaire numéroté 01-06 */
.rubriques-liste { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--filet-fort); }
.rubriques-liste li { border-bottom: 1px solid var(--filet); }
.rubriques-liste a { display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: baseline; gap: var(--e-3); padding: var(--e-4) 0; color: var(--encre); text-decoration: none; }
.rubriques-liste .num { font-size: 1.9rem; line-height: 1; }
.rub-nom { font-family: var(--police-titre); font-size: var(--t-l); line-height: 1.2; }
.rub-nb { font-size: var(--t-xs); color: var(--encre-douce); text-transform: uppercase; letter-spacing: 0.06em; }
.rubriques-liste a:hover .rub-nom { color: var(--cobalt); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
@media (min-width: 760px) {
  .rubriques-liste { grid-template-columns: 1fr 1fr; column-gap: var(--e-7); }
  .rubriques-liste li:nth-child(-n+2) { border-top: 0; }
}
@media (min-width: 1100px) { .rubriques-liste { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Cartes ---------- */
.cartes { display: grid; gap: var(--e-6) var(--e-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .cartes-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .cartes-3 { grid-template-columns: repeat(3, 1fr); } }
.carte { display: flex; flex-direction: column; gap: var(--e-3); }
.carte-img { overflow: hidden; background: var(--rose-pale); }
.carte-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.carte-rub { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--cobalt); margin: 0 0 var(--e-2); }
.carte-titre { font-size: 1.4rem; line-height: 1.15; margin-bottom: var(--e-2); }
.carte-titre a { color: var(--encre); text-decoration: none; }
.carte-titre a:hover { color: var(--cobalt); text-decoration: underline; text-decoration-thickness: 1px; }
.carte-desc { font-size: var(--t-s); color: var(--encre-douce); margin-bottom: var(--e-2); }
.carte-meta { font-size: var(--t-xs); color: var(--encre-douce); margin: 0; }

/* À la une : 1 grand + 3 petits, puis une liste sans image */
@media (min-width: 760px) {
  .cartes-une { grid-template-columns: repeat(6, 1fr); }
  .cartes-une > .carte { grid-column: span 2; }
  .cartes-une > .carte:first-child { grid-column: 1 / span 4; grid-row: span 3; }
  .cartes-une > .carte:first-child .carte-titre { font-size: var(--t-2xl); }
  .cartes-une > .carte:first-child .carte-desc { font-size: var(--t-m); }
  .cartes-une > .carte:nth-child(2), .cartes-une > .carte:nth-child(3), .cartes-une > .carte:nth-child(4) { grid-column: 5 / span 2; flex-direction: row; gap: var(--e-4); padding-bottom: var(--e-4); border-bottom: 1px solid var(--filet); }
  .cartes-une > .carte:nth-child(2) .carte-img, .cartes-une > .carte:nth-child(3) .carte-img, .cartes-une > .carte:nth-child(4) .carte-img { flex: 0 0 38%; align-self: flex-start; background: none; }
  .cartes-une > .carte:nth-child(-n+4):not(:first-child) .carte-img img { aspect-ratio: 1 / 1; }
  .cartes-une > .carte:nth-child(n+2) .carte-desc { display: none; }
  .cartes-une > .carte:nth-child(n+2) .carte-titre { font-size: 1.15rem; }
  .cartes-une > .carte:nth-child(n+5) { grid-column: span 2; border-top: 1px solid var(--filet-fort); padding-top: var(--e-4); }
  .cartes-une > .carte:nth-child(n+5) .carte-img { display: none; }
}

/* ---------- La semaine en 5 minutes ---------- */
.semaine { background: var(--cobalt); color: var(--sur-cobalt); padding-block: var(--e-7); }
.semaine-in { display: grid; gap: var(--e-5); }
.semaine-titre { font-size: var(--t-2xl); }
.semaine-texte p { max-width: 46rem; }
.semaine-texte ol, .semaine-texte ul { list-style: none; margin: 0; padding: 0; counter-reset: sem; display: grid; gap: 0; }
.semaine-texte li { counter-increment: sem; position: relative; padding: var(--e-3) 0 var(--e-3) 3rem; border-top: 1px solid color-mix(in srgb, var(--sur-cobalt) 35%, transparent); }
.semaine-texte li::before { content: counter(sem, decimal-leading-zero); position: absolute; left: 0; top: var(--e-3); font-family: var(--police-titre); font-size: 1.35rem; line-height: 1.2; }
.semaine a { color: var(--sur-cobalt); font-weight: 600; }
.semaine a:hover { color: var(--sur-cobalt); text-decoration-thickness: 2px; }
@media (min-width: 900px) { .semaine-in { grid-template-columns: 1fr 2fr; gap: var(--e-7); } }

/* ---------- Titraille (articles, pages, rubriques) ---------- */
.titraille { padding-block: var(--e-6) var(--e-5); }
.titraille-grille { display: grid; grid-template-areas: "tete" "figure" "suite"; gap: var(--e-5); }
.titraille-tete { grid-area: tete; }
.titraille-figure { grid-area: figure; margin-inline: calc(-1 * clamp(1rem, 4vw, 2.5rem)); }
.titraille-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.titraille-suite { grid-area: suite; }
.surtitre { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; color: var(--cobalt); margin: 0 0 var(--e-3); }
.surtitre a { text-decoration: none; }
.surtitre a:hover { text-decoration: underline; }
.titraille h1 { font-size: var(--t-2xl); }
.chapo { font-family: var(--police-titre); font-size: var(--t-l); line-height: 1.4; color: var(--encre); margin: 0 0 var(--e-4); max-width: 44rem; }
.signature { display: flex; flex-wrap: wrap; gap: var(--e-2) var(--e-4); font-size: var(--t-s); color: var(--encre-douce); margin: 0; padding-top: var(--e-3); border-top: 1px solid var(--filet); }
.signature span:not(:last-child)::after { content: "·"; margin-left: var(--e-4); color: var(--encre-douce); }
.signature a { font-weight: 600; }
@media (min-width: 860px) {
  .titraille { padding-block: var(--e-7) var(--e-6); }
  .titraille-grille { grid-template-areas: "tete" "suite" "figure"; max-width: 58rem; margin-inline: auto; text-align: left; }
  .titraille-figure { margin-inline: 0; margin-top: var(--e-3); }
  .p-article .titraille-grille { max-width: 64rem; }
}
.rub-bandeau { display: flex; align-items: flex-end; gap: var(--e-4); padding-top: var(--e-6); }
.rub-num { font-family: var(--police-titre); font-size: clamp(4rem, 3rem + 6vw, 8rem); line-height: 0.8; color: var(--cobalt); margin: 0; }
.rub-label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--encre-douce); margin: 0 0 0.4rem; }
.p-rubrique .titraille { padding-top: var(--e-4); }
.p-rubrique .titraille .surtitre { display: none; }
.titraille-404 { text-align: left; }
.auteur-tete { display: flex; gap: var(--e-5); align-items: center; }

/* ---------- Bloc assistant : une ligne de pastilles sous le chapô ---------- */
.assistants { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2) var(--e-3); padding-block: var(--e-3); border-block: 1px dashed var(--filet); margin-inline: auto; max-width: 64rem; }
.assistants-titre { margin: 0; font-size: var(--t-s); font-weight: 700; }
.assistants-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--e-2); }
.assistants-liste a, .assistants-liste button { display: inline-block; font-size: var(--t-xs); font-weight: 600; padding: 0.3rem 0.75rem; border: 1px solid var(--cobalt); border-radius: var(--rayon-pastille); color: var(--cobalt); background: transparent; text-decoration: none; cursor: pointer; line-height: 1.4; }
.assistants-liste a:hover, .assistants-liste button:hover { background: var(--cobalt); color: var(--sur-cobalt); }
.assistants-md a, .assistants-md button { border-color: var(--filet); color: var(--encre-douce); }
.assistants-note { flex-basis: 100%; margin: 0; font-size: var(--t-xs); color: var(--encre-douce); }

/* ---------- Corps d'article ---------- */
.article-grille { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e-6); padding-block: var(--e-6) var(--e-7); }
@media (min-width: 1040px) {
  .article-grille { grid-template-columns: 15rem minmax(0, var(--largeur-texte)); justify-content: center; gap: var(--e-8); }
  .article-cote .programme { position: sticky; top: var(--e-5); }
}
.corps { padding-block: var(--e-5) var(--e-7); }

.prose { max-width: var(--largeur-texte); font-size: 1.075rem; line-height: 1.72; overflow-wrap: anywhere; min-width: 0; }
.prose > * + * { margin-top: var(--e-4); }
.prose p { margin-bottom: 0; }
.prose h2 + *, .prose h3 + * { margin-top: var(--e-3); }
.prose h2 { font-size: var(--t-xl); margin-top: var(--e-7); padding-top: var(--e-4); border-top: 1px solid var(--filet-fort); scroll-margin-top: var(--e-5); }
.prose h3 { font-family: var(--police-texte); font-weight: 700; font-size: var(--t-l); line-height: 1.3; margin-top: var(--e-6); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: var(--e-2); }
.prose li::marker { color: var(--cobalt); }
.prose strong { font-weight: 700; }
.prose blockquote { margin-inline: 0; padding-left: var(--e-5); border-left: 3px solid var(--cobalt); font-family: var(--police-titre); font-size: var(--t-l); line-height: 1.4; }
.prose hr { border: 0; border-top: 1px solid var(--filet); margin-block: var(--e-6); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-s); display: block; overflow-x: auto; }
.prose th, .prose td { overflow-wrap: normal; min-width: 6.5rem; text-align: left; padding: var(--e-2) var(--e-3); border-bottom: 1px solid var(--filet); vertical-align: top; }
.prose th { font-weight: 700; border-bottom: 2px solid var(--filet-fort); }
.prose a { overflow-wrap: anywhere; }

/* Si vous n'avez qu'une minute */
.minute { background: var(--rose); color: #1C1E2B; padding: var(--e-5); }
.minute a { color: #2340A8; }
.minute-titre { font-family: var(--police-titre); font-size: var(--t-l); margin: 0 0 var(--e-3) !important; }
.minute ol { margin: 0; padding: 0; list-style: none; counter-reset: min; }
.minute li { counter-increment: min; display: grid; grid-template-columns: 1.8rem 1fr; gap: var(--e-2); font-size: var(--t-s); line-height: 1.55; }
.minute li + li { margin-top: var(--e-3); padding-top: var(--e-3); border-top: 1px solid rgba(28, 30, 43, 0.15); }
.minute li::before { content: counter(min); font-family: var(--police-titre); font-size: 1.25rem; line-height: 1.1; color: #2340A8; }

/* Au programme (sommaire) */
.programme { font-size: var(--t-s); }
.programme-titre { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin: 0 0 var(--e-3); padding-bottom: var(--e-2); border-bottom: 1px solid var(--filet-fort); }
.programme ol { margin: 0; padding: 0; list-style: none; counter-reset: prog; }
.programme li { counter-increment: prog; display: grid; grid-template-columns: 1.8rem 1fr; padding: var(--e-2) 0; border-bottom: 1px solid var(--filet); line-height: 1.4; }
.programme li::before { content: counter(prog, decimal-leading-zero); font-family: var(--police-titre); color: var(--cobalt); }
.programme a { color: var(--encre); text-decoration: none; }
.programme a:hover { color: var(--cobalt); text-decoration: underline; }
@media (max-width: 1039px) { .article-cote:empty { display: none; } }

/* Pense-bête (encadré) : fiche bristol, marge bleue */
.pense-bete { background: var(--papier); border: 1px solid var(--filet); border-left: 6px solid var(--cobalt); padding: var(--e-5); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.72em - 1px), color-mix(in srgb, var(--cobalt) 10%, transparent) calc(1.72em - 1px), color-mix(in srgb, var(--cobalt) 10%, transparent) 1.72em); }
.pense-bete-titre { font-family: var(--police-titre); font-size: var(--t-l); color: var(--cobalt); margin: 0 0 var(--e-3) !important; }
.pense-bete > * + * { margin-top: var(--e-3); }
.pense-bete ul, .pense-bete ol { margin: 0; }

/* Photos dans le texte */
.photo { margin: var(--e-6) 0; }
.photo img { width: 100%; }
.photo figcaption { font-size: var(--t-xs); color: var(--encre-douce); padding-top: var(--e-2); border-bottom: 1px solid var(--filet); padding-bottom: var(--e-2); }

/* Les questions qui reviennent */
.questions { margin-top: var(--e-7) !important; }
.questions h2 { margin-top: 0; }
.questions details { border-bottom: 1px solid var(--filet); }
.questions summary { cursor: pointer; list-style: none; padding: var(--e-4) 2rem var(--e-4) 0; font-weight: 700; position: relative; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%); font-family: var(--police-titre); font-size: 1.6rem; color: var(--cobalt); }
.questions details[open] summary::after { content: "–"; }
.questions details p { margin: 0 0 var(--e-4); color: var(--encre); }

/* Signataire */
.signataire { display: flex; gap: var(--e-4); align-items: center; margin-top: var(--e-7) !important; padding-top: var(--e-5); border-top: 1px solid var(--filet-fort); }
.signataire p { margin: 0; }
.signataire-nom { font-weight: 600; }
.signataire-bio { font-size: var(--t-s); color: var(--encre-douce); }
.pastille { flex: 0 0 auto; display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--cobalt); color: var(--sur-cobalt); font-family: var(--police-titre); font-size: 1.5rem; line-height: 1; }
.pastille-grande { width: 5.5rem; height: 5.5rem; font-size: 2.8rem; }

.meme-numero { background: var(--papier); border-top: 1px solid var(--filet-fort) !important; }

/* ---------- Pied ---------- */
.pied { background: #141726; color: #E8ECFF; padding-top: var(--e-7); font-size: var(--t-s); }
.pied a { color: #E8ECFF; text-decoration: none; }
.pied a:hover { color: #FFFFFF; text-decoration: underline; }
.pied .num { color: #9DB0FF; }
.pied-haut { display: grid; gap: var(--e-6); padding-bottom: var(--e-6); }
.pied-marque img { width: 200px; margin-bottom: var(--e-3); }
.pied-marque p { color: #B4BAD6; }
.pied-titre { text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--t-xs); font-weight: 700; color: #B4BAD6; margin-bottom: var(--e-3); }
.pied ol, .pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e-2); }
.pied-bas { border-top: 1px solid #343A57; padding-block: var(--e-5); font-size: var(--t-xs); color: #B4BAD6; display: grid; gap: var(--e-2); }
.pied-bas p { margin: 0; max-width: 60rem; }
@media (min-width: 860px) { .pied-haut { grid-template-columns: 1.3fr 1fr 1fr; } }

@media print { .tete-nav, .assistants, .pied, .meme-numero, .une-media { display: none; } body { background: #fff; } }

/* Alignement des titrailles centrées (desktop) */
@media (min-width: 860px) {
  .titraille .ariane { max-width: 58rem; margin-inline: auto; }
  .p-article .titraille .ariane { max-width: 64rem; }
  .rub-bandeau { max-width: calc(58rem + 2 * clamp(1rem, 4vw, 2.5rem)); }
  .titraille-auteur .auteur-tete, .titraille-404 > .conteneur > * { max-width: 58rem; margin-inline: auto; }
}
