/* ==========================================================================
   MGP MOTO — « NOUVELLE GARDE » · CONSEILS (/conseils/ et /conseils/<slug>/)
   ========================================================================== */

/* --- En-tête de /conseils/ --------------------------------------------------- */
.mag-head { overflow: hidden; padding-top: calc(var(--nav-h) + clamp(1.5rem, 1rem + 1.5vw, 2.5rem)); padding-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); background: var(--ink-950); }
.mag-head__star { position: absolute; z-index: 0; width: min(46rem, 90vw); right: -8%; top: 8%; --star-color: rgba(245,197,24,.14); --star-stroke: 1px; pointer-events: none; }
.mag-head__title { margin-top: clamp(1.5rem, 1rem + 2vw, 3rem); max-width: 16ch; font-size: clamp(2.7rem, 1rem + 6.4vw, 8.5rem); }
.mag-head__foot { margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); display: grid; gap: 2rem; align-items: end; }
.mag-head__foot .lead { max-width: 30em; }
@media (min-width: 1100px) {
  .mag-head__foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mag-filters { justify-self: end; }
  .mag-filters .chips { justify-content: flex-end; }
}

/* --- La une : composition asymétrique -------------------------------------- */
.mag-une-section { background: var(--ink-950); padding-bottom: var(--section-y); }
.mag-une__link { display: grid; gap: clamp(1.5rem, 1rem + 2vw, 3rem); color: inherit; }
.mag-une__frame { aspect-ratio: 4 / 3; }
.mag-une__frame img { transform-origin: center; }
.mag-une__link:hover .mag-une__frame img { transform: scale(1.04); }
.mag-une__cover { padding: clamp(1.5rem, 3vw, 3rem); background: var(--ink-850); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.mag-une__cover-word { font-size: clamp(3.6rem, 1rem + 9vw, 10rem); max-width: 7ch; line-height: .9; }
.mag-une__cover-star { width: clamp(5rem, 12vw, 9rem); --star-color: var(--gold); --star-stroke: 1.2px; }
.mag-une__text { display: flex; flex-direction: column; align-items: flex-start; gap: 1.1rem; }
.mag-une__badge { color: var(--paper); }
.mag-une__title { font-size: clamp(1.8rem, 1.1rem + 1.9vw, 3.2rem); max-width: 16ch; line-height: .98; background: linear-gradient(currentColor, currentColor) no-repeat left 100% / 0 2px; transition: background-size .8s var(--ease-out); display: inline; padding-bottom: .08em; }
.mag-une__link:hover .mag-une__title { background-size: 100% 2px; }
.mag-une__chapo { font-size: clamp(1.05rem, 1rem + .3vw, 1.3rem); max-width: 28em; }
.mag-une__byline { margin-top: .25rem; }
.mag-une__btn { margin-top: .75rem; }
.mag-une__link:hover .btn__dot svg:first-child { transform: translateX(120%); }
@media (min-width: 1000px) {
  .mag-une__link { grid-template-columns: minmax(0, 7.4fr) minmax(0, 4.6fr); align-items: end; }
  .mag-une__frame { aspect-ratio: 16 / 11; }
  .mag-une__text { padding-bottom: .5rem; }
}

/* --- Grille éditoriale au rythme varié (papier ivoire) --------------------- */
.mag-grid { display: grid; gap: clamp(2.5rem, 1.5rem + 3vw, 4.5rem) var(--grid-gap); }
.mag-grid__item { min-width: 0; }
@media (min-width: 700px) {
  .mag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mag-grid__item:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  .mag-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .mag-grid__item { grid-column: span 4; }
  /* Rythme sur 5 : [7 | 5] puis [4 | 4 | 4]. Les ratios s'ajustent pour que les pieds s'alignent. */
  .mag-grid__item:nth-child(5n+1) { grid-column: span 7; }
  .mag-grid__item:nth-child(5n+2) { grid-column: span 5; padding-top: clamp(2rem, 5vw, 6rem); }
  .mag-grid__item:nth-child(5n+1) .card-a__media { aspect-ratio: 16 / 10; }
  .mag-grid__item:nth-child(5n+1) .card-a__title { font-size: var(--fs-h3); }
  .mag-grid__item:nth-child(5n+2) .card-a__media { aspect-ratio: 5 / 4; }
  /* Dernière rangée : on comble le vide plutôt que de laisser une carte seule. */
  .mag-grid__item:nth-child(5n+3):nth-last-child(2), .mag-grid__item:nth-child(5n+4):last-child { grid-column: span 6; }
  .mag-grid__item:nth-child(5n+1):last-child, .mag-grid__item:nth-child(5n+3):last-child { grid-column: 1 / -1; padding-top: 0; }
  .mag-grid__item:nth-child(5n+1):last-child .card-a__link, .mag-grid__item:nth-child(5n+3):last-child .card-a__link {
    display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--grid-gap); align-content: center; align-items: start;
  }
  .mag-grid__item:nth-child(5n+1):last-child .card-a__media, .mag-grid__item:nth-child(5n+3):last-child .card-a__media { grid-row: 1 / span 4; aspect-ratio: 16 / 9; }
  .mag-grid__item:nth-child(5n+1):last-child .card-a__meta, .mag-grid__item:nth-child(5n+3):last-child .card-a__meta { margin-top: 0; align-self: end; padding-top: 1rem; }
  .mag-grid__item:nth-child(5n+1):last-child .card-a__title, .mag-grid__item:nth-child(5n+3):last-child .card-a__title { font-size: var(--fs-h3); display: block; background: none; }
  .mag-grid__item:nth-child(5n+4):last-child .card-a__media { aspect-ratio: 16 / 10; }
}
/* Couverture typographique : un fond de scène, pas un aplat noir. */
.mag-grid .card-a__cover { background: radial-gradient(110% 90% at 100% 0%, rgba(255,77,31,.22), transparent 58%), radial-gradient(80% 70% at 0% 100%, rgba(245,197,24,.07), transparent 60%), var(--ink-900); box-shadow: inset 0 0 0 1px rgba(243,239,231,.08); }
.mag-grid .card-a__cover-word { font-size: clamp(2.4rem, 1.2rem + 3vw, 4.6rem); max-width: 8ch; }

/* ==========================================================================
   L'ARTICLE
   ========================================================================== */
.art-head { overflow: hidden; padding-top: calc(var(--nav-h) + clamp(2rem, 1rem + 3vw, 4rem)); padding-bottom: clamp(2.5rem, 1.5rem + 4vw, 5rem); background: var(--ink-950); }
.art-head--cover { padding-bottom: 0; overflow: visible; }
.art-head__star { position: absolute; z-index: 0; width: min(40rem, 80vw); right: -6%; top: 12%; --star-color: rgba(245,197,24,.13); --star-stroke: 1px; pointer-events: none; }
.art-head__inner { position: relative; }
.art-head__title { margin-top: clamp(1.5rem, 1rem + 2.5vw, 3rem); max-width: 18ch; font-size: clamp(2.3rem, 1rem + 5.4vw, 6.75rem); line-height: .95; }
.art-head__foot { margin-top: clamp(2rem, 1.2rem + 3vw, 3.5rem); display: grid; gap: 2rem; align-items: end; padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.art-head__chapo { max-width: 32em; font-size: clamp(1.15rem, 1rem + .7vw, 1.65rem); }
.art-byline { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line-strong); }
.art-byline dd { margin: .3rem 0 0; font-weight: 500; }
.art-byline time { font-variant-numeric: tabular-nums; }
@media (min-width: 1000px) {
  .art-head__foot { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--grid-gap); }
  .art-byline { justify-self: end; width: 100%; max-width: 30rem; }
}
.art-head--cover .art-head__foot { padding-bottom: clamp(2.5rem, 5vw, 4.5rem); }

.art-draft { display: inline-flex; align-items: center; gap: .7em; margin-top: 1.25rem; padding: .55rem 1rem; border-radius: var(--radius-pill); background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(245,197,24,.4); }
.art-draft__dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--gold); }

/* La couverture chevauche la frontière noir / ivoire. */
.art-cover { position: relative; z-index: 2; background: linear-gradient(to bottom, var(--ink-950) 50%, var(--paper) 50%); max-width: none; padding-inline: 0; }
.art-cover__frame { max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; width: calc(100% - 2 * var(--gutter)); aspect-ratio: 16 / 8; border-radius: var(--radius-m); }
.art-cover__frame img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 759px) { .art-cover__frame { aspect-ratio: 4 / 3; } }

/* --- Lecture sur papier ivoire --------------------------------------------- */
.art-body { padding-block: clamp(3.5rem, 2rem + 6vw, 8rem); }
.art-body--after-cover { padding-top: clamp(3rem, 2rem + 4vw, 6rem); }
.art-prose { max-width: none; font-size: clamp(1.1rem, 1.04rem + .3vw, 1.26rem); line-height: 1.75; color: #1c1c20; hyphens: auto; }
.art-prose > * + * { margin-top: 1.25em; }
/* Lettrine : le premier paragraphe ouvre la lecture. */
.art-prose > p:first-child { font-size: 1.12em; line-height: 1.6; color: var(--ink-on-paper); }
.art-prose > p:first-child::first-letter { font-family: var(--font-serif); font-style: italic; font-size: 4.6em; float: left; line-height: .78; padding: .08em .1em 0 0; color: var(--ember-deep); }
.art-prose strong { font-weight: 650; color: var(--ink-on-paper); }
.art-prose h2 { margin-top: 2.6em; padding-top: 1.1em; border-top: 1px solid var(--line-strong); font-family: var(--font-display); font-stretch: var(--wdth-display); font-weight: 800; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem); line-height: 1.02; letter-spacing: -.015em; text-transform: uppercase; text-wrap: balance; color: var(--ink-on-paper); }
.art-prose h2 + * { margin-top: 1em; }
.art-prose h3 { margin-top: 2em; font-family: var(--font-display); font-stretch: 112%; font-weight: 700; font-size: clamp(1.15rem, 1.05rem + .5vw, 1.45rem); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; color: var(--ink-on-paper); }
.art-prose h3 + * { margin-top: .6em; }
.art-prose a { color: var(--ink-on-paper); text-decoration: underline; text-decoration-color: var(--ember-deep); text-decoration-thickness: 2px; text-underline-offset: .22em; transition: color var(--dur-2), text-decoration-thickness var(--dur-2); }
.art-prose a:hover { color: var(--ember-deep); text-decoration-thickness: 3px; }
.art-prose ul, .art-prose ol { padding-left: 1.4em; }
.art-prose li + li { margin-top: .55em; }
.art-prose li::marker { color: var(--ember-deep); font-weight: 700; }
.art-prose ul { list-style: square; }
/* blockquote → encadré « L'avis de l'atelier » */
.art-prose blockquote { position: relative; margin: 2.4em 0; padding: 1.7rem clamp(1.4rem, 3vw, 2.4rem) 1.6rem; border: 0; border-radius: var(--radius-m); background: var(--ink-900); color: var(--paper); font-family: var(--font-body); font-style: normal; font-size: 1em; line-height: 1.6; }
/* Le texte porte déjà « L’avis de l’atelier. » en gras : on le compose en étiquette. */
.art-prose blockquote > p:first-child > strong:first-child { display: block; margin-bottom: .6rem; font: 500 var(--fs-label)/1.3 var(--font-mono); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ember); }
.art-prose blockquote p + p { margin-top: .8em; }
.art-prose blockquote strong { color: var(--paper); }
.art-prose blockquote a { color: var(--paper); text-decoration-color: var(--ember); }
.art-prose blockquote a:hover { color: var(--ember); }
.art-prose table { width: 100%; font-size: .9em; }
.art-prose th, .art-prose td { padding: .6em .8em; text-align: left; border-bottom: 1px solid var(--line-strong); }
.art-prose img { border-radius: var(--radius-m); }
.art-prose hr { border: 0; height: 1px; background: var(--line-strong); margin-block: 2.5em; }

/* --- Sources : visibles, jamais repliées ----------------------------------- */
.art-sources { margin-top: clamp(3rem, 2rem + 4vw, 5.5rem); padding: clamp(1.4rem, 3vw, 2.2rem); border-radius: var(--radius-m); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.art-sources__list { margin: 1.25rem 0 0; counter-reset: src; display: grid; gap: .1rem; }
.art-sources__list li { counter-increment: src; display: grid; grid-template-columns: 2.4rem 1fr; gap: .5rem; padding: .85rem 0; border-top: 1px solid var(--line-strong); font-size: .98rem; line-height: 1.4; }
.art-sources__list li::before { content: counter(src, decimal-leading-zero); font: 500 var(--fs-label)/1.8 var(--font-mono); letter-spacing: .08em; color: var(--ember-deep); }
.art-sources__list a { display: inline-flex; align-items: flex-start; gap: .5em; justify-self: start; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; transition: color var(--dur-2), text-decoration-color var(--dur-2); }
.art-sources__list a:hover { color: var(--ember-deep); text-decoration-color: var(--ember-deep); }
.art-sources__ext { flex: none; width: 1rem; height: 1rem; margin-top: .22em; }
.art-back { margin-top: clamp(2rem, 4vw, 3rem); }
.art-back__arrow { width: 1.1rem; height: 1.1rem; }

.art-machines { background: var(--ink-950); }
.art-more.section--alt { background: var(--ink-900); }

/* Couverture typographique : la rubrique y est déjà écrite, on ne la redit pas dans la méta. */
.mag-grid .card-a:has(.card-a__cover) .card-a__rubrique, .mag-grid .card-a:has(.card-a__cover) .card-a__rubrique + span,
.art-more .card-a:has(.card-a__cover) .card-a__rubrique, .art-more .card-a:has(.card-a__cover) .card-a__rubrique + span { display: none; }

/* Entête de la liste (sans numéro : l'en-tête de page n'en porte pas) */
.mag-grid-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mag-grid-head .index { gap: 1em; }
.mag-grid-head__n { color: var(--ember-deep); font-variant-numeric: tabular-nums; }
.mag-grid-head + .section-head__rule { display: block; height: 1px; background: var(--line-strong); margin: 1rem 0 clamp(2rem, 1.5rem + 2.5vw, 4rem); }
