/*
 * Design system "nc" (Nano Carapace) — socle commun de la refonte.
 *
 * Chargé sur tous les gabarits refondus (home, Services, Service, Page cocon : voir
 * nc_is_redesign() dans inc/front.php), AVANT les feuilles propres à chaque page
 * (nc-home.css, nc-services.css, cocon-*.css) qui ne contiennent que leurs sections
 * spécifiques.
 *
 * Conventions :
 * - tout est préfixé "nc-" (BEM : .nc-bloc__element--modificateur) ;
 * - tokens en variables --nc-* sur :root (namespacées, donc sans effet sur le legacy) ;
 * - .nc-page = wrapper d'une page 100 % refondue (fond, typo, resets du legacy) ;
 * - .nc-wrap = LE conteneur de largeur, identique sur toutes les pages ;
 * - .nc-section = LE rythme vertical, identique sur toutes les pages ;
 * - contexte sombre (.nc-hero, .nc-section--dark, .nc-card--dark...) : les composants
 *   basculent tout seuls en clair via les variables --nc-c-*, pas besoin de modificateurs
 *   "--light" sur chaque titre/eyebrow/bouton.
 *
 * TODO : fichiers autonomes, hors pipeline SCSS (assets/scss + gulpfile), lui-même
 * désynchronisé de style.css. À réintégrer une fois le ménage du legacy fait.
 */

/* ============ TOKENS ============ */
:root {
    --nc-accent: #048495;
    --nc-accent-text: #036B78;      /* accent lisible (AA) sur fond clair */
    --nc-accent-light: #5CC9D5;     /* accent sur fond sombre */
    --nc-accent-soft: #E6F6F8;      /* texte secondaire sur fond accent */
    --nc-dark: #0E1416;
    --nc-dark-2: #1B2427;
    --nc-dark-border: #2B373B;
    --nc-bg: #F4F2EE;
    --nc-white: #FFFFFF;
    --nc-border: #E2DED6;
    --nc-muted: #4A5558;
    --nc-muted-light: #C9D1D3;
    --nc-subtle: #8A979A;           /* labels, méta, sur fond sombre */
    --nc-star: #F2B84B;

    --nc-font-display: 'Archivo', sans-serif;
    --nc-font-body: 'Instrument Sans', system-ui, sans-serif;

    --nc-wrap: 1264px;              /* largeur utile du contenu */
    --nc-gutter: 24px;
    --nc-section-y: clamp(56px, 7vw, 88px);
    --nc-gap: 24px;

    --nc-radius-sm: 14px;
    --nc-radius: 18px;
    --nc-radius-lg: 24px;
    --nc-shadow-hover: 0 4px 16px rgba(4, 132, 149, .1);

    /* couleurs contextuelles (fond clair par défaut) */
    --nc-c-text: var(--nc-dark);
    --nc-c-muted: var(--nc-muted);
    --nc-c-eyebrow: var(--nc-accent-text);
    --nc-c-line: var(--nc-border);
}

/* Contexte sombre : tout ce qui est dedans bascule en clair */
.nc-hero,
.nc-section--dark,
.nc-card--dark,
.nc-dark {
    --nc-c-text: var(--nc-bg);
    --nc-c-muted: var(--nc-muted-light);
    --nc-c-eyebrow: var(--nc-accent-light);
    --nc-c-line: var(--nc-dark-border);
}

/* ============ PAGE + RESETS DU LEGACY ============ */
/* Les resets passent par :where() pour rester à la spécificité d'un simple sélecteur
   d'élément : ils battent le legacy (style.css, chargé avant) sans jamais battre une
   classe .nc-* */
.nc-page {
    background: var(--nc-bg);
    font-family: var(--nc-font-body);
    color: var(--nc-dark);
}
.nc-page *,
.nc-page *::before,
.nc-page *::after { box-sizing: border-box; }

:where(.nc-page) :is(h1, h2, h3, h4) {
    font-family: var(--nc-font-display);
    font-weight: 700;
    font-size: inherit;
    line-height: 1.15;
    color: inherit;
    margin: 0;
}
:where(.nc-page) p { font-family: var(--nc-font-body); margin: 0; }
:where(.nc-page) a:hover { text-decoration: none; }
/* puces "•" + text-indent globaux du thème sur ul li : neutralisés sur nos listes */
:where(.nc-page) :is(ul, ol)[class*="nc-"] { list-style: none; margin: 0; padding: 0; }
:where(.nc-page) :is(ul, ol)[class*="nc-"] > li { padding-left: 0; text-indent: 0; margin: 0; }
:where(.nc-page) ul[class*="nc-"] > li::before { content: none; }

/* ============ LAYOUT ============ */
.nc-wrap {
    width: 100%;
    max-width: calc(var(--nc-wrap) + 2 * var(--nc-gutter));
    margin-inline: auto;
    padding-inline: var(--nc-gutter);
}

.nc-section { padding-block: var(--nc-section-y); color: var(--nc-c-text); }
.nc-section--white { background: var(--nc-white); border-block: 1px solid var(--nc-border); }
.nc-section--dark { background: var(--nc-dark); }
/* deux sections sur fond beige qui se suivent : pas de double padding entre elles */
.nc-section:not(.nc-section--white, .nc-section--dark) + .nc-section:not(.nc-section--white, .nc-section--dark) { padding-top: 0; }

/* En-tête de section : titre (+ eyebrow) à gauche, intro à droite */
.nc-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.nc-head > :first-child { flex: 1 1 420px; max-width: 760px; }
.nc-head__intro {
    flex: 0 1 460px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--nc-c-muted);
}

/* Grilles : nombre de colonnes desktop en modificateur, repli auto en responsive */
.nc-grid { display: grid; grid-template-columns: repeat(var(--nc-cols, 3), minmax(0, 1fr)); gap: var(--nc-gap); }
.nc-grid--2 { --nc-cols: 2; }
.nc-grid--3 { --nc-cols: 3; }
.nc-grid--4 { --nc-cols: 4; }
.nc-grid--5 { --nc-cols: 5; --nc-gap: 16px; }

/* Split 2 colonnes (hero, FAQ, CTA, blocs texte + liste...) */
.nc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.nc-split--7-5 { grid-template-columns: 7fr 5fr; }
.nc-split--5-7 { grid-template-columns: 5fr 7fr; }
.nc-split--top { align-items: start; }

/* Garde-fou CSS Grid : une piste "1fr" a un mini = son contenu, ce qui fait déborder
   la grille au lieu de la faire rétrécir */
.nc-grid > *,
.nc-split > * { min-width: 0; }

/* ============ TYPO ============ */
.nc-eyebrow {
    display: block;
    font-family: var(--nc-font-body);
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--nc-c-eyebrow);
    margin-bottom: 12px;
}

.nc-h1,
.nc-h2 {
    font-family: var(--nc-font-display);
    font-stretch: 118%;
    letter-spacing: -.01em;
    font-weight: 800;
    color: var(--nc-c-text);
    margin: 0;
}
.nc-h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.02; }
.nc-h2 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; }

.nc-lead { font-size: 18px; line-height: 1.55; color: var(--nc-c-muted); }

/* ============ BOUTONS ============ */
.nc-btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 28px; }
.nc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--nc-font-body);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    padding: 14px 24px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity .15s ease;
}
.nc-btn:hover { opacity: .85; text-decoration: none; }
.nc-btn--accent { background: var(--nc-accent); color: #fff; }
.nc-btn--dark { background: var(--nc-dark); color: #fff; }
.nc-btn--light { background: var(--nc-white); color: var(--nc-dark); }
.nc-btn--outline { border-color: var(--nc-c-text); color: var(--nc-c-text); }
.nc-hero .nc-btn--outline,
.nc-section--dark .nc-btn--outline,
.nc-dark .nc-btn--outline { border-color: rgba(255, 255, 255, .6); }

/* Lien texte avec flèche (fin de carte, pied de section...) */
.nc-link { font-family: var(--nc-font-body); font-size: 14px; font-weight: 600; color: var(--nc-c-eyebrow); text-decoration: none; }
.nc-link:hover { text-decoration: none; opacity: .85; }

/* ============ FIL D'ARIANE ============ */
.nc-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--nc-subtle);
    margin-bottom: 32px;
}
.nc-breadcrumb a { color: var(--nc-muted-light); text-decoration: none; }
.nc-breadcrumb a:hover { color: var(--nc-accent-light); }
.nc-breadcrumb [aria-current] { color: var(--nc-bg); }

/* ============ HERO (sombre, commun à toutes les pages) ============ */
.nc-hero {
    background: var(--nc-dark);
    color: var(--nc-c-text);
    font-family: var(--nc-font-body);
    padding: 48px 0 var(--nc-section-y);
}
.nc-hero__title { margin-bottom: 20px; }
.nc-hero__text {
    font-size: 18px;
    line-height: 1.55;
    color: var(--nc-c-muted);
    max-width: 600px;
}

/* ============ CARTE (photo + corps) ============ */
.nc-card {
    display: flex;
    flex-direction: column;
    background: var(--nc-white);
    color: var(--nc-c-text);
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius);
    overflow: hidden;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.nc-card--dark { background: var(--nc-dark); border-color: var(--nc-dark); }
/* sur une section blanche, les cartes passent en beige pour se détacher */
.nc-section--white .nc-card:not(.nc-card--dark) { background: var(--nc-bg); }
a.nc-card:hover {
    text-decoration: none;
    color: var(--nc-c-text);
    border-color: var(--nc-accent);
    box-shadow: var(--nc-shadow-hover);
}
.nc-card__photo {
    height: 200px;
    flex-shrink: 0;
    background-color: #DCD8D0;
    background-size: cover;
    background-position: center;
}
.nc-card__body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.nc-card__title { font-family: var(--nc-font-display); font-size: 21px; font-weight: 700; line-height: 1.15; margin: 0; }
.nc-card__text { font-size: 15px; line-height: 1.6; color: var(--nc-c-muted); flex-grow: 1; }
.nc-card__text p + p { margin-top: .8em; }

/* ============ ÉTAPES NUMÉROTÉES (template-parts/nc-steps.php) ============ */
.nc-step { border-top: 2px solid var(--nc-accent); padding-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.nc-step__num { font-family: var(--nc-font-display); font-size: 40px; font-weight: 800; line-height: 1.1; color: var(--nc-c-eyebrow); }
.nc-step__title { font-family: var(--nc-font-display); font-size: 22px; font-weight: 700; margin: 0; }
.nc-step__text { font-size: 16px; line-height: 1.65; color: var(--nc-c-muted); }

/* ============ FAQ (template-parts/nc-faq.php) ============ */
.nc-faq__intro { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.nc-faq__list { border-top: 1px solid var(--nc-c-line); }
.nc-faq__item { border-bottom: 1px solid var(--nc-c-line); padding: 22px 0; }
.nc-faq__item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 20px;
    font-family: var(--nc-font-display);
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
}
.nc-faq__item summary::-webkit-details-marker { display: none; }
.nc-faq__icon { color: var(--nc-c-eyebrow); font-family: var(--nc-font-body); flex-shrink: 0; font-size: 22px; line-height: 1; }
.nc-faq__icon::before { content: "+"; }
.nc-faq__item[open] .nc-faq__icon::before { content: "\2212"; }
.nc-faq__answer { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--nc-c-muted); }
.nc-faq__answer p + p,
.nc-faq__answer ul,
.nc-faq__answer ol { margin-top: .8em; }

/* ============ CTA (bandeau accent, template-parts/nc-cta.php) ============ */
.nc-cta {
    background: var(--nc-accent);
    color: #fff;
    border-radius: var(--nc-radius-lg);
    padding: clamp(32px, 5vw, 56px);
}
.nc-cta .nc-split { gap: 40px 56px; }
.nc-cta__title {
    font-family: var(--nc-font-display);
    font-stretch: 118%;
    letter-spacing: -.01em;
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    margin: 0;
}
.nc-cta__text { font-size: 17px; line-height: 1.6; color: var(--nc-accent-soft); margin-top: 14px; }
.nc-cta__phone { font-size: 15px; color: var(--nc-accent-soft); margin-top: 10px; }
.nc-cta__phone a { color: #fff; font-weight: 600; }
.nc-cta .nc-btn-row { margin-top: 0; justify-content: flex-end; }
/* variante sans formulaire : texte + boutons sur une ligne */
.nc-cta--inline .nc-split { grid-template-columns: 1fr auto; }

.nc-form {
    background: var(--nc-dark);
    border-radius: var(--nc-radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.nc-form__field { display: flex; flex-direction: column; gap: 8px; }
.nc-form__field label { font-size: 14px; font-weight: 600; color: var(--nc-bg); }
.nc-form__field input {
    border: 1px solid var(--nc-dark-border);
    background: var(--nc-dark-2);
    border-radius: 999px;
    padding: 14px 20px;
    font-size: 16px;
    font-family: inherit;
    color: var(--nc-bg);
    outline: none;
}
.nc-form__field input:focus { border-color: var(--nc-accent-light); }
.nc-form .nc-btn { margin-top: 4px; font-size: 16px; padding-block: 15px; }

/* ============ RESPONSIVE ============ */
/* ============ RENVOI PROTOCOLE CARAPACE (template-parts/nc-protocole-promo.php) ============ */
.nc-protocole-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px 48px;
    flex-wrap: wrap;
    padding: 36px 44px;
    border-radius: var(--nc-radius-lg);
    background: var(--nc-dark);
    color: var(--nc-c-text);
    text-decoration: none;
    border: 1px solid var(--nc-dark);
    transition: border-color .15s;
}
.nc-protocole-promo:hover { color: var(--nc-c-text); text-decoration: none; border-color: var(--nc-accent); }
.nc-protocole-promo__body { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.nc-protocole-promo__badge {
    align-self: flex-start;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--nc-accent);
    color: var(--nc-white);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.nc-protocole-promo__title { font-family: var(--nc-font-display); font-stretch: 118%; font-size: 32px; font-weight: 800; line-height: 1.05; }
.nc-protocole-promo__text { font-size: 16px; line-height: 1.55; color: var(--nc-c-muted); }
.nc-protocole-promo__side { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.nc-protocole-promo__price { display: flex; flex-direction: column; font-family: var(--nc-font-display); font-size: 24px; font-weight: 800; }
.nc-protocole-promo__price span { font-family: var(--nc-font-body); font-size: 13px; font-weight: 400; color: var(--nc-subtle); }
@media (max-width: 600px) {
    .nc-protocole-promo { padding: 28px 24px; }
    .nc-protocole-promo__title { font-size: 26px; }
}

@media (max-width: 960px) {
    .nc-grid--2,
    .nc-grid--3 { --nc-cols: 1; }
    .nc-grid--4 { --nc-cols: 2; }
    .nc-grid--5 { --nc-cols: 3; }
    .nc-split,
    .nc-split--7-5,
    .nc-split--5-7,
    .nc-cta--inline .nc-split { grid-template-columns: 1fr; gap: 32px; }
    .nc-cta .nc-btn-row { justify-content: flex-start; }
}

@media (max-width: 600px) {
    .nc-grid--4 { --nc-cols: 1; }
    .nc-grid--5 { --nc-cols: 2; }
    .nc-btn { white-space: normal; text-align: center; }
}

/* ============ CENTRES (template-parts/nc-centres.php : home, hub /centres-agrees/) ============ */
.nc-centres { align-items: stretch; gap: 20px; }
.nc-centres__process {
    background: var(--nc-accent);
    color: #fff;
    border-radius: var(--nc-radius-lg);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.nc-centres__process .nc-eyebrow { color: var(--nc-accent-soft); }
.nc-centres__process .nc-btn-row { margin-top: auto; }
.nc-centres__process-title { font-family: var(--nc-font-display); font-size: 32px; font-weight: 800; line-height: 1.1; }
.nc-centres__process-text { font-size: 15px; line-height: 1.6; color: var(--nc-accent-soft); }
.nc-centres__steps { border-top: 1px solid rgba(255, 255, 255, .3); }
.nc-centres__steps li {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
    font-size: 16px;
}
.nc-centres__steps li span { font-family: var(--nc-font-display); font-weight: 800; font-size: 14px; color: var(--nc-accent-soft); }
.nc-centres__phone { color: #fff; font-weight: 600; font-size: 15px; padding: 14px 8px; text-decoration: none; }
.nc-centres__phone:hover { color: #fff; }

.nc-centres__regions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
.nc-centres__regions > * { min-width: 0; }
.nc-region {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 108px;
    padding: 18px;
    background: var(--nc-dark-2);
    color: var(--nc-bg);
    border: 1px solid var(--nc-dark-border);
    border-radius: var(--nc-radius-sm);
    text-decoration: none;
}
.nc-region:hover { color: var(--nc-bg); text-decoration: none; border-color: var(--nc-accent-light); }
.nc-region__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.nc-region__top svg { flex-shrink: 0; color: var(--nc-accent-light); }
.nc-region__tag { font-size: 11px; color: var(--nc-subtle); text-align: right; }
.nc-region__name { margin-top: auto; font-family: var(--nc-font-display); font-size: 19px; font-weight: 700; }
.nc-region__link { font-size: 13px; color: var(--nc-muted-light); }

.nc-centres__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px 24px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--nc-dark-border);
}
.nc-centres__foot-text { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--nc-muted-light); }
.nc-centres__foot-text svg { flex-shrink: 0; color: var(--nc-accent-light); }

@media (max-width: 960px) {
    .nc-centres__regions { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; }
}
@media (max-width: 600px) {
    .nc-centres__regions { grid-template-columns: 1fr; }
}
