/* Pages internes au même niveau que l'accueil « bento » : grands titres, une idée par écran,
   tuiles, chapitres éditoriaux, un chapitre sombre. S'appuie sur les classes posées par tools/build.py
   (kind-expertises, kind-secteurs, kind-realisations, kind-points-de-vue, kind-hub-*, kind-doc). */

/* ---------- En-tête de page ---------- */
.page-sub .page-hero { padding: 5.5rem 0 4.5rem; border-bottom: 0; position: relative; overflow: hidden; }
.page-sub .page-hero h1 { font-size: clamp(2.6rem, 6.2vw, 4.8rem); line-height: 1.03; letter-spacing: -.028em; max-width: 17ch; }
.page-sub .page-lead { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 1.55; max-width: 40rem; margin-top: 1.75rem; }
.page-sub .page-hero .actions { margin-top: 2.25rem; }
.page-sub .crumbs { margin-bottom: 2.5rem; }
.page-sub .page-hero .eyebrow { margin-bottom: 1.25rem; }
/* Filet de couleur sous l'en-tête, rappel de la charte */
.page-sub .page-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--rule); }

/* Réalisations : en-tête sombre, comme un chapitre */
.kind-realisations .page-hero { background: var(--navy); color: #fff; }
.kind-realisations .page-hero h1 { color: #fff; }
.kind-realisations .page-hero .page-lead { color: rgba(255, 255, 255, .78); }
.kind-realisations .page-hero .eyebrow { color: var(--accent-soft); }
.kind-realisations .crumbs, .kind-realisations .crumbs a { color: rgba(255, 255, 255, .6); }
.kind-realisations .page-hero::after { display: none; }

/* ---------- Corps : chapitres éditoriaux ---------- */
.kind-expertises .page-body, .kind-secteurs .page-body, .kind-realisations .page-body { padding: 0 0 5rem; background: var(--paper); }
.kind-expertises .page-grid, .kind-secteurs .page-grid, .kind-realisations .page-grid { display: block; }
.kind-expertises .page-main, .kind-secteurs .page-main, .kind-realisations .page-main { max-width: none; }
.chapter { display: grid; gap: 1.5rem 3rem; padding: 4.5rem 0; border-bottom: 1px solid var(--rule); }
.chapter-head h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.1; letter-spacing: -.018em; color: var(--ink); max-width: 14ch; }
.chapter-head[data-chapter]::before { content: attr(data-chapter); display: block; margin-bottom: .9rem; font-size: .8rem; font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.chapter-body > p { font-size: 1.12rem; line-height: 1.75; color: var(--ink); max-width: 44rem; }
.chapter-body > p + p { margin-top: 1.1rem; }
.chapter-body .disclaimer { font-size: .85rem; margin-top: 2rem; }
@media (min-width: 960px) {
  .chapter { grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); }
  .chapter-head { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
}

/* Listes devenues tuiles */
.chapter .check-list { display: grid; gap: 1rem; counter-reset: tile; }
.chapter .check-list li { counter-increment: tile; padding: 1.6rem 1.6rem 1.6rem 1.6rem; background: var(--surface); border: 1px solid var(--rule); font-family: var(--serif); font-size: clamp(1.08rem, 1.6vw, 1.22rem); line-height: 1.4; color: var(--ink); transition: transform .35s ease, box-shadow .35s ease; }
.chapter .check-list li::before { content: counter(tile, decimal-leading-zero); position: static; display: block; width: auto; height: auto; border: 0; margin-bottom: .9rem; font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .12em; color: var(--accent); }
.chapter .check-list li:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(7, 29, 71, .45); }
.chapter .item-list { display: grid; gap: 1rem; background: none; border: 0; }
.chapter .item { padding: 2rem; background: var(--surface); border: 1px solid var(--rule); display: flex; flex-direction: column; gap: .6rem; transition: transform .35s ease, box-shadow .35s ease; }
.chapter .item:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(7, 29, 71, .45); }
.chapter .item h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.2; color: var(--primary); }
.chapter .item p { font-size: 1rem; color: var(--muted); }
.chapter .item p a { color: var(--primary); }
/* Première intervention mise en avant en marine */
.chapter .item:first-child { background: var(--navy); border-color: var(--navy); }
.chapter .item:first-child h3 { color: #fff; }
.chapter .item:first-child p { color: rgba(255, 255, 255, .78); }
.chapter .item:first-child p a { color: var(--accent-soft); }
@media (min-width: 700px) {
  .chapter .check-list, .chapter .item-list { grid-template-columns: 1fr 1fr; }
  .chapter .item:first-child { grid-column: 1 / -1; }
}

/* Dernier chapitre : bloc sombre (ce que cela change, ce que cela illustre) */
.chapter:last-child { border-bottom: 0; margin-top: 3rem; padding: 4rem clamp(1.5rem, 4vw, 3.5rem); background: var(--navy); color: #fff; }
.chapter:last-child .chapter-head h2 { color: #fff; }
.chapter:last-child .chapter-head::before { color: var(--accent-soft); }
.chapter:last-child .chapter-body > p { color: rgba(255, 255, 255, .85); font-family: var(--serif); font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.45; }
.chapter:last-child .disclaimer { color: rgba(255, 255, 255, .55) !important; font-family: var(--sans); font-size: .85rem !important; }
.chapter:last-child .check-list li { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); color: #fff; }
.chapter:last-child .check-list li::before { color: var(--accent-soft); }
.chapter:last-child .check-list li:hover { box-shadow: none; }

/* ---------- Pour aller plus loin (ancien encadré latéral) ---------- */
.kind-expertises .page-aside, .kind-secteurs .page-aside, .kind-realisations .page-aside, .kind-points-de-vue .page-aside {
  position: static; display: grid; gap: 1rem; margin-top: 4.5rem; grid-template-columns: 1fr;
}
.kind-expertises .page-aside::before, .kind-secteurs .page-aside::before, .kind-realisations .page-aside::before, .kind-points-de-vue .page-aside::before {
  content: "Pour aller plus loin"; grid-column: 1 / -1; font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.015em; color: var(--ink); margin-bottom: .5rem;
}
.page-sub .aside-card { padding: 1.75rem; background: var(--surface); transition: transform .35s ease, box-shadow .35s ease; }
.page-sub .aside-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -26px rgba(7, 29, 71, .45); }
.page-sub .aside-link { font-size: 1.2rem; }
.page-sub .aside-cta { display: flex; flex-direction: column; justify-content: space-between; }
.page-sub .aside-cta p { font-family: var(--serif); font-size: 1.25rem; line-height: 1.35; color: #fff; }
@media (min-width: 760px) {
  .kind-expertises .page-aside, .kind-secteurs .page-aside, .kind-realisations .page-aside, .kind-points-de-vue .page-aside { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .kind-expertises .page-aside, .kind-secteurs .page-aside, .kind-realisations .page-aside, .kind-points-de-vue .page-aside { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Articles : colonne de lecture ---------- */
.kind-points-de-vue .page-hero h1 { max-width: 20ch; }
.kind-points-de-vue .page-body { padding: 4rem 0 5rem; background: var(--surface); }
.kind-points-de-vue .page-grid { display: block; }
.kind-points-de-vue .prose { max-width: 42rem; margin: 0 auto; }
.kind-points-de-vue .prose p { font-size: 1.15rem; line-height: 1.85; color: var(--ink); }
.kind-points-de-vue .prose > p:first-of-type::first-letter { float: left; font-family: var(--serif); font-weight: 600; font-size: 4.2rem; line-height: .82; padding: .35rem .6rem 0 0; color: var(--primary); }
.kind-points-de-vue .prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.2; letter-spacing: -.012em; margin: 3.25rem 0 .5rem; color: var(--ink); }
.kind-points-de-vue .prose h2::before { content: ""; display: block; width: 2.5rem; height: 2px; background: var(--accent); margin-bottom: 1.1rem; }
.kind-points-de-vue .prose a { color: var(--primary); }
.kind-points-de-vue .page-aside { max-width: 72rem; margin-left: auto; margin-right: auto; }
.read-progress { position: fixed; left: 0; top: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--accent); z-index: 70; pointer-events: none; }

/* ---------- Sommaires : grilles de tuiles ---------- */
.kind-hub .page-body { padding: 4rem 0 5rem; background: var(--paper); }
.kind-hub .card-grid { gap: 1rem; background: none; border: 0; }
.kind-hub .card { position: relative; overflow: hidden; min-height: 15rem; padding: 2rem; background: var(--surface); border: 1px solid var(--rule); justify-content: flex-end; transition: transform .35s ease, box-shadow .35s ease; }
.kind-hub .card:hover { background: var(--surface); transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(7, 29, 71, .45); }
.kind-hub .card h2, .kind-hub .card h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: -.01em; }
.kind-hub .card .num { position: absolute; top: 1.5rem; left: 2rem; }
/* Première tuile mise en avant */
.kind-hub .card:first-child { background: var(--navy); border-color: var(--navy); }
.kind-hub .card:first-child h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.kind-hub .card:first-child p { color: rgba(255, 255, 255, .78); }
.kind-hub .card:first-child .more, .kind-hub .card:first-child .num, .kind-hub .card:first-child .case-tag, .kind-hub .card:first-child .view-tag { color: var(--accent-soft); }
/* Tuiles photo (photos déjà publiées et créditées) */
.kind-hub .card-grid > .card:nth-child(2) { background: var(--accent-tint); border-color: var(--accent-tint); }
/* Cartes illustrées (réalisations) : photo du thème sous un voile marine, texte clair */
.kind-hub .card-grid > .card.has-photo, .kind-hub .card-grid > .card.has-photo:hover { background: linear-gradient(0deg, rgba(7, 29, 71, .95) 0%, rgba(7, 29, 71, .62) 55%, rgba(7, 29, 71, .5) 100%), var(--photo-m) center / cover; border-color: var(--navy); }
.kind-hub .card.has-photo h2 { color: #fff; }
.kind-hub .card.has-photo p { color: rgba(255, 255, 255, .8); }
.kind-hub .card.has-photo .more, .kind-hub .card.has-photo .case-tag { color: var(--accent-soft); }
.kind-hub .card.has-photo { min-height: 19rem; }
@media (min-width: 761px) { .kind-hub .card-grid > .card.has-photo:first-child, .kind-hub .card-grid > .card.has-photo:first-child:hover { background-image: linear-gradient(0deg, rgba(7, 29, 71, .92) 0%, rgba(7, 29, 71, .45) 45%, rgba(7, 29, 71, .05) 85%), var(--photo); background-position: center 62%; } }
@media (min-width: 640px) {
  .kind-hub .card:first-child { grid-column: 1 / -1; min-height: 20rem; }
}
@media (min-width: 960px) {
  .kind-hub .card-grid { grid-template-columns: repeat(3, 1fr); }
  .kind-hub .card:first-child { grid-column: 1 / span 2; grid-row: 1 / span 2; min-height: 0; }
  .kind-hub-realisations .card-grid { grid-template-columns: repeat(3, 1fr); }
  .kind-hub-realisations .card:first-child { grid-column: 1 / -1; grid-row: auto; min-height: 24rem; }
}
.kind-hub .subhead { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.015em; margin-top: 4.5rem; }
.kind-hub .mini-grid { gap: 1rem; background: none; border: 0; }
.kind-hub .mini { border: 1px solid var(--rule); padding: 1.6rem; }

/* ---------- Pages légales ---------- */
.kind-doc .doc { padding: 5rem 0 5.5rem; }
.kind-doc .doc h1 { font-size: clamp(2.4rem, 5.4vw, 3.8rem); letter-spacing: -.025em; line-height: 1.05; margin-bottom: 2.75rem; }

/* ---------- Apparition au défilement (seulement si le script tourne) ---------- */
.fx-js .fx { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); }
.fx-js .fx.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .fx-js .fx { opacity: 1; transform: none; transition: none; }
  .chapter .check-list li, .chapter .item, .page-sub .aside-card, .kind-hub .card { transition: none; }
  .chapter .check-list li:hover, .chapter .item:hover, .page-sub .aside-card:hover, .kind-hub .card:hover { transform: none; }
  .read-progress { display: none; }
}

/* Correctifs : bloc contact sombre conservé, texte des tuiles calé en bas */
.page-sub .aside-card.aside-cta { background: var(--navy); border-color: var(--navy); }
.page-sub .aside-card.aside-cta .btn-primary { background: #fff; color: var(--navy); }
.kind-hub .card .more { margin-top: .75rem; }

/* Bandeau illustré (réalisations, secteurs) : photo du thème à droite, texte sur marine à gauche */
.page-sub .page-hero.has-photo { color: #fff; background: linear-gradient(0deg, rgba(7, 29, 71, .95) 10%, rgba(7, 29, 71, .72) 100%), var(--photo-m) center / cover; }
.page-sub .page-hero.has-photo::after { display: none; }
.page-sub .page-hero.has-photo h1 { color: #fff; }
.page-sub .page-hero.has-photo .page-lead { color: rgba(255, 255, 255, .8); }
.page-sub .page-hero.has-photo .eyebrow { color: var(--accent-soft); }
.page-sub .page-hero.has-photo .crumbs, .page-sub .page-hero.has-photo .crumbs a { color: rgba(255, 255, 255, .65); }
.page-sub .page-hero.has-photo .btn-primary { background: #fff; border-color: #fff; color: var(--navy); }
@media (min-width: 761px) {
  .page-sub .page-hero.has-photo { background: linear-gradient(90deg, rgba(7, 29, 71, .97) 0%, rgba(7, 29, 71, .88) 40%, rgba(7, 29, 71, .35) 75%, rgba(7, 29, 71, .15) 100%), var(--photo) center / cover; }
}

/* Encart « Mission représentative » illustré par la photo du cas */
.page-sub .aside-card.has-photo { position: relative; color: #fff; background: linear-gradient(0deg, rgba(7, 29, 71, .95) 0%, rgba(7, 29, 71, .65) 60%, rgba(7, 29, 71, .45) 100%), var(--photo-m) center / cover; }
.page-sub .aside-card.has-photo .kicker { color: var(--accent-soft); }
.page-sub .aside-card.has-photo .aside-link { color: #fff; }
.page-sub .aside-card.has-photo .aside-link::after { content: ""; position: absolute; inset: 0; }

/* « Où nous l'exerçons » : secteurs liés, en tuiles photo */
.also { grid-column: 1 / -1; margin: 1rem 0 3rem; }
.also-title { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.015em; margin-bottom: 1.5rem; }
.also-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.also-card { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: .35rem; min-height: 12rem; padding: 1.5rem; color: #fff; text-decoration: none; background: linear-gradient(0deg, rgba(7, 29, 71, .92) 0%, rgba(7, 29, 71, .45) 60%, rgba(7, 29, 71, .2) 100%), var(--photo-m) center / cover; transition: transform .35s ease, box-shadow .35s ease; }
.also-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -24px rgba(7, 29, 71, .5); }
.also-kicker { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-soft); }
.also-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.15; }
@media (prefers-reduced-motion: reduce) { .also-card { transition: none; } .also-card:hover { transform: none; } }

/* Bandeau d'action avant le pied de page (toutes les pages sauf l'accueil) */
.cta-band { background: var(--paper); padding: 0 0 4.5rem; }
.cta-band-inner { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 5vw, 4rem); display: grid; gap: 2rem; align-items: end; }
.cta-band-inner::after { content: ""; position: absolute; right: -6rem; top: -6rem; width: 22rem; height: 22rem; border: 1px solid rgba(255, 255, 255, .08); border-radius: 50%; pointer-events: none; }
.cta-band .eyebrow { color: var(--accent-soft); margin-bottom: 1rem; }
.cta-band-title { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.06; letter-spacing: -.022em; max-width: 18ch; margin: 0; }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: .75rem; position: relative; z-index: 1; }
.cta-band .btn-primary { background: #fff; border-color: #fff; color: var(--navy); }
.cta-band .btn-ghost { background: transparent; border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.cta-band .btn-ghost:hover { border-color: #fff; }
@media (min-width: 900px) { .cta-band-inner { grid-template-columns: 1.6fr 1fr; } .cta-band-actions { justify-content: flex-end; } }

/* Pied de page */
.site-footer { padding-top: 4.5rem; }
.footer-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; padding-bottom: 2.5rem; margin-bottom: 2.75rem; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.footer-tagline { font-family: var(--serif); font-weight: 600; color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.8rem); line-height: 1.08; letter-spacing: -.018em; max-width: 24ch; margin: 1.25rem 0 0; }
.footer-top .footer-brand { margin: 0; }
.footer-top .footer-brand .wm-mono { width: 2.6rem; height: 2.6rem; font-size: 1.6rem; }
.to-top { font-size: .85rem; letter-spacing: .04em; color: rgba(255, 255, 255, .7) !important; }
.site-footer .footer-grid ul { gap: .55rem; }
.site-footer .footer-grid a { color: rgba(255, 255, 255, .78); }
.site-footer .footer-grid a:hover { color: #fff; }
.footer-head { margin-bottom: 1rem; }
.legal { margin-top: 1rem; }

/* Pied de page : intitulé au-dessus de la signature */
.footer-kicker { margin: 1.25rem 0 0; font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-soft); }
.footer-kicker + .footer-tagline { margin-top: .6rem; }

/* Bouton de retour en haut */
.back-to-top { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; width: 3rem; height: 3rem; display: grid; place-items: center; background: var(--navy); color: #fff; text-decoration: none; font-size: 1.2rem; border: 1px solid rgba(255, 255, 255, .28); box-shadow: 0 10px 30px -12px rgba(7, 29, 71, .55); opacity: 0; visibility: hidden; transform: translateY(.75rem); transition: opacity .3s ease, transform .3s ease, visibility .3s; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--primary, #12357a); }
.back-to-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 899px) { .back-to-top { bottom: 5.25rem; right: 1rem; width: 2.75rem; height: 2.75rem; } }
@media (prefers-reduced-motion: reduce) { .back-to-top { transition: none; } }
@media print { .back-to-top { display: none; } }

/* Hubs : grilles sans trou (six expertises, onze secteurs) */
@media (min-width: 1080px) {
  .kind-hub-secteurs .card:first-child { grid-column: 1 / span 2; grid-row: auto; min-height: 19rem; }
}
/* Accueil : tuile « Votre secteur n'y figure pas ? » */
.sector-other { background: var(--primary-tint, #eef2f9); }

/* Pied de page : trois colonnes de liens */
@media (min-width: 900px) { .site-footer .footer-grid { grid-template-columns: repeat(3, 1fr); } }
