/* PR 311 — extension de la charte validée aux seules pages TPE-PME,
   Ressources et Contact. Aucun sélecteur ne touche aux pages déjà validées.
   La couche typography neutralise les déclarations historiques importantes. */
@layer typography {
  html body.v2.v2-charte-page {
    --color-ink: #1f2b4f;
    --color-muted: #3b4a73;
    --color-accent: #c6a477;
    --color-border: #c6a477;
    --color-bg: #fff;
    --color-mist: #fff;
    --color-soft: #fff;
    --font-body: "DM Sans", sans-serif;
    --font-display: "Playfair Display", Georgia, serif;
    background: #fff !important;
    font-family: var(--font-body);
  }
  html body.v2.v2-charte-page #contenu > section:not(.hero) {
    background-image: none !important;
    box-shadow: none !important;
  }
  html body.v2.v2-charte-page #contenu > section:not(.hero)::before,
  html body.v2.v2-charte-page #contenu > section:not(.hero)::after {
    content: none !important;
    background: none !important;
  }
  html body.v2.v2-charte-page #contenu > .charte-white {
    background: #fff !important;
    color: #1f2b4f !important;
  }
  html body.v2.v2-charte-page #contenu > .charte-navy {
    background: #0f1636 !important;
    color: #fff !important;
  }
  html body.v2.v2-charte-page #contenu .charte-white :is(h2,h3,h4,p,li,strong,summary),
  html body.v2.v2-charte-page #contenu .charte-white :is(h3 a,.text-link) {
    color: #1f2b4f !important;
    -webkit-text-fill-color: #1f2b4f !important;
  }
  html body.v2.v2-charte-page #contenu .charte-navy :is(h2,h3,h4,p,li,strong,summary) {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
  html body.v2.v2-charte-page #contenu :is(.card,.sector-editorial-chapter,.contact-option,.resource-card) {
    background: #fff !important;
    border: 1px solid #c6a477 !important;
    border-top-width: 2px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  html body.v2.v2-charte-page #contenu :is(.card,.sector-editorial-chapter,.contact-option,.resource-card) :is(h3,h4,p,li,summary,strong,span,a:not(.btn)) {
    color: #1f2b4f !important;
    -webkit-text-fill-color: #1f2b4f !important;
  }
  html body.v2.v2-charte-page #contenu :is(.card,.sector-editorial-chapter,.contact-option) h3 {
    font-family: var(--font-body) !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
  }
  html body.v2.v2-charte-page #contenu :is(.eyebrow,.v2-eyebrow) {
    color: #c6a477 !important;
    -webkit-text-fill-color: #c6a477 !important;
  }
  html body.v2.v2-charte-page #contenu .sector-editorial-benefit {
    background: #fff !important;
    border-color: #c6a477 !important;
    color: #1f2b4f !important;
  }
  /* Même bouton principal champagne uni, y compris au survol et au focus. */
  html body.v2.v2-charte-page #contenu a.btn,
  html body.v2.v2-charte-page #contenu a.btn:is(:hover,:focus-visible),
  html body.v2.v2-charte-page a.v2-btn--gold {
    background: #c6a477 !important;
    background-image: none !important;
    border: 1px solid #c6a477 !important;
    border-radius: 0 !important;
    color: #0f1636 !important;
    -webkit-text-fill-color: #0f1636 !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
    font-family: var(--font-body) !important;
    font-weight: 500 !important;
    min-height: 50px;
    padding: 12px 24px;
  }
  html body.v2.v2-charte-page .v2-nav a.v2-btn--gold { min-height:44px; padding:9px 14px; }
  html body.v2.v2-charte-page #contenu a.v2-btn--ghost {
    background: transparent !important;
    border-color: rgba(255,255,255,.75) !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
  /* Conserver chaque photographie ; voile marine à gauche, image à droite. */
  html body.v2.v2-charte-page #contenu > .hero {
    background: #0f1636 !important;
    min-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }
  html body.v2.v2-charte-page #contenu > .hero::before,
  html body.v2.v2-charte-page #contenu > .hero::after { content:none !important; }
  html body.v2.v2-charte-page #contenu .hero .hero-inner {
    position:relative !important;
    z-index:2 !important;
    width:100% !important;
    max-width:1180px !important;
    margin-inline:auto !important;
    padding:clamp(48px,5vw,74px) 20px !important;
  }
  html body.v2.v2-charte-page #contenu .hero .hero-content { max-width:740px !important; width:100% !important; }
  html body.v2.v2-charte-page #contenu .hero h1 {
    font-size:clamp(33px,3.9vw,50px) !important;
    line-height:1.12 !important;
    font-weight:400 !important;
    color:#fff !important;
    -webkit-text-fill-color:#fff !important;
  }
  html body.v2.v2-charte-page #contenu .hero p:not(.eyebrow) {
    color:#fff !important;
    -webkit-text-fill-color:#fff !important;
  }
  html body.v2.v2-charte-page #contenu .hero .home-hero-media {
    position:absolute !important; inset:0 0 0 auto !important; width:65% !important; height:100% !important; opacity:1 !important;
  }
  html body.v2.v2-charte-page #contenu .hero .home-hero-media img { width:100% !important; height:100% !important; object-fit:cover !important; }
  html body.v2.v2-charte-page #contenu .hero .home-hero-veil {
    position:absolute !important; inset:0 !important; z-index:1 !important;
    background:linear-gradient(90deg,#0f1636 35%,rgba(15,22,54,.84) 50%,rgba(15,22,54,.22) 79%,rgba(15,22,54,.08)) !important;
  }
  html body.v2.v2-charte-page #contenu > .pme-hero {
    background:#0f1636 !important;
  }
  /* Pictogrammes existants : conserver les formes, appliquer le champagne. */
  html body.v2.v2-charte-page #contenu :is(.title-pictogram,.caption-pictogram,.agent-role img) {
    filter:brightness(0) saturate(100%) invert(71%) sepia(19%) saturate(573%) hue-rotate(355deg) brightness(91%) contrast(86%) !important;
  }
  html body.v2.v2-charte-page #contenu :is(.contact-signature-icon,.caption-arrow) { color:#c6a477 !important; stroke:#c6a477 !important; }
  html body.v2.v2-charte-page #contenu .title-pictogram { width:28px !important; height:28px !important; flex:0 0 28px !important; }
  /* Schéma existant : mêmes contrastes que celui de la page médecine. */
  html body.v2.v2-charte-page #contenu .assistant-schema :is(.node,.tasks) { border-radius:0 !important; border-color:#c6a477 !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema .node { background:#fff !important; color:#1f2b4f !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema .node :is(span,.sub) { color:#1f2b4f !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema :is(.assistant,.action) { background:#c6a477 !important; color:#0f1636 !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema :is(.tasks,.flow) { background:transparent !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema :is(.tasks-title,.multi-agent-caption,.caption-copy) { color:#fff !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema :is(.assistant-schema-line,.assistant-schema-head,.assistant-schema-frame rect) { stroke:#c6a477 !important; }
  html body.v2.v2-charte-page #contenu .assistant-schema .step::after { color:#c6a477 !important; }
  /* FAQ sans bandes blanches, flèches et séparations champagne. */
  html body.v2.v2-charte-page #contenu .faq-section :is(.faq-accordion,.faq-accordion-item,summary,.faq-answer) { background:#0f1636 !important; background-image:none !important; }
  html body.v2.v2-charte-page #contenu .faq-section :is(summary,.faq-answer,.faq-answer p,strong) { color:#fff !important; -webkit-text-fill-color:#fff !important; }
  html body.v2.v2-charte-page #contenu .faq-section summary::after { color:#c6a477 !important; border-color:#c6a477 !important; }
  /* Ressources : blanc pur, traits champagne, catégories sobres. */
  html body.v2.v2-charte-page #contenu .resource-card :is(.resource-category,.resource-sector) {
    background:#fff !important; border:1px solid #c6a477 !important; color:#1f2b4f !important;
  }
  html body.v2.v2-charte-page #contenu .resource-read-label { text-decoration-color:#c6a477 !important; }
  /* Coordonnées : bandeau nuit et encadrement identiques aux autres sections. */
  html body.v2.v2-charte-page #contenu .contact-signature {
    background:#0f1636 !important; border:1px solid #c6a477 !important;
    padding:clamp(24px,3vw,36px) !important;
    border-top-width:2px !important; border-radius:0 !important; box-shadow:none !important;
  }
  html body.v2.v2-charte-page #contenu .contact-signature :is(a,.contact-signature-label) { color:#fff !important; -webkit-text-fill-color:#fff !important; }
  html body.v2.v2-charte-page #contenu .contact-signature-item a { font-size:17px !important; font-weight:400 !important; }
  html body.v2.v2-charte-page #contenu .contact-signature-divider { background:#c6a477 !important; }
  html body.v2.v2-charte-page .v2-footer p { color:#d5dcee !important; }
  html body.v2.v2-charte-page .v2-footer h3 { font-family:var(--font-body) !important; font-size:13px !important; color:#c6a477 !important; }
  @media(max-width:720px) {
    html body.v2.v2-charte-page #contenu .hero .home-hero-media { width:100% !important; }
    html body.v2.v2-charte-page #contenu .hero .home-hero-veil { background:rgba(15,22,54,.76) !important; }
    html body.v2.v2-charte-page #contenu > .pme-hero { background:#0f1636 !important; }
    html body.v2.v2-charte-page #contenu .hero .hero-inner { padding-block:48px 56px !important; }
  }

  html body.v2.v2-charte-page .v2-logo { font:400 34px/1 "Playfair Display",Georgia,serif !important; color:#fff !important; }
  html body.v2.v2-charte-page .v2-logo b { font:inherit !important; font-size:1.12em !important; color:#c6a477 !important; }
  html body.v2.v2-charte-page .v2-nav :is(a,button) { font-family:var(--font-body) !important; font-size:15px !important; font-weight:400 !important; }
  html body.v2.v2-charte-page #contenu h2 { font-size:clamp(30px,3.6vw,44px) !important; line-height:1.15 !important; font-weight:400 !important; }
  html body.v2.v2-charte-page #contenu :is(p,li) { font-size:17px !important; font-weight:400 !important; }
  html body.v2.v2-charte-page #contenu .hero-content > p:not(.eyebrow):not(.hero-reassurance) { font-size:18.5px !important; line-height:1.6 !important; margin-top:22px !important; }
  html body.v2.v2-charte-page #contenu :is(.eyebrow,.v2-eyebrow) { font-size:13px !important; letter-spacing:.14em !important; }
  html body.v2.v2-charte-page #contenu a.btn { font-size:16px !important; }
  @media(max-width:720px) {
    html body.v2.v2-charte-page #contenu :is(p,li) { font-size:16px !important; }
    html body.v2.v2-charte-page #contenu :is(.eyebrow,.v2-eyebrow) { font-size:13px !important; }
  }

  html body.v2.v2-charte-page :is(header.v2-header,footer.v2-footer) a.v2-logo[data-typo-role],
  html body.v2.v2-charte-page :is(header.v2-header,footer.v2-footer) a.v2-logo b[data-typo-role] { font-family:"Playfair Display",Georgia,serif !important; }
  html body.v2.v2-charte-page #contenu section:is(.charte-white,.charte-navy) p.eyebrow {
    color:#c6a477 !important; -webkit-text-fill-color:#c6a477 !important;
  }
}

/* TPE-PME — dimensions, respiration et micro-interactions demandées. */
@layer typography {
  html body.v2.v2-pme-restored #contenu .section-aqua .sector-editorial-list {
    align-items: stretch !important;
  }
  /* Les six cartes fermées partagent la hauteur de la plus haute, même
     entre deux rangées. Une carte ouverte garde toute sa hauteur de lecture. */
  /* Six systèmes : trois cartes par rangée sur ordinateur (3 + 3). */
  @media (min-width: 1050px) {
    html body.v2.v2-pme-restored #contenu .section-aqua .sector-editorial-list:has(> details:nth-child(6):last-child) {
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
  }
  html body.v2.v2-pme-restored #contenu .section-aqua .sector-editorial-list:not(:has(> details[open])) {
    grid-auto-rows: 1fr !important;
  }
  html body.v2.v2-pme-restored #contenu .section-aqua .sector-editorial-list > details {
    align-self: stretch !important;
    height: 100% !important;
    min-width: 0;
  }
  html body.v2.v2-pme-restored #contenu .section-aqua .sector-editorial-list > details:not([open]) > summary {
    height: 100%;
  }
  html body.v2.v2-pme-restored #contenu p.pme-systems-scope {
    margin-top: 24px !important;
  }
  html body.v2.v2-pme-restored #contenu .multi-agent-schema .multi-agent-caption {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin: 40px 0 0 !important;
    max-width: none !important;
    text-align: left !important;
  }
  html body.v2.v2-pme-restored #contenu .multi-agent-caption > .caption-pictogram {
    filter: none !important;
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    margin: 0 !important;
    object-fit: contain;
  }
  html body.v2.v2-pme-restored #contenu .multi-agent-caption > .caption-copy {
    flex: 1;
    min-width: 0;
  }
  @media (prefers-reduced-motion: no-preference) {
    html body.v2.v2-pme-restored #contenu :is(.sector-editorial-chapter,.card,.related-resource-card,.assistant-schema .node) {
      transition: transform .2s ease, box-shadow .2s ease !important;
    }
    @media (hover: hover) and (pointer: fine) {
      html body.v2.v2-pme-restored #contenu :is(.sector-editorial-chapter,.card,.related-resource-card):hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 8px 20px rgba(15,22,54,.1) !important;
      }
      html body.v2.v2-pme-restored #contenu .assistant-schema .node:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 6px 16px rgba(198,164,119,.14) !important;
      }
    }
  }
  @media (prefers-reduced-motion: reduce) {
    html body.v2.v2-pme-restored #contenu :is(.sector-editorial-chapter,.card,.related-resource-card,.assistant-schema .node) {
      transition: none !important;
      transform: none !important;
    }
  }
}

/* Votre quotidien : liseré pleine largeur, reflet mobile au survol. */
@layer typography {
  html body.v2.v2-pme-restored #contenu section:has(.pme-daily-title) .sector-editorial-chapter {
    position: relative !important;
    overflow: hidden;
  }
  html body.v2.v2-pme-restored #contenu section:has(.pme-daily-title) .sector-editorial-chapter::after {
    content: "" !important;
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    height: 3px;
    background: #c6a477 linear-gradient(105deg, transparent 35%, #f2dfc1 50%, transparent 65%) no-repeat !important;
    background-size: 40% 100% !important;
    background-position: -70% 0 !important;
    pointer-events: none;
  }
  @media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    html body.v2.v2-pme-restored #contenu section:has(.pme-daily-title) .sector-editorial-chapter::after {
      transition: background-position .6s ease;
    }
    html body.v2.v2-pme-restored #contenu section:has(.pme-daily-title) .sector-editorial-chapter:hover::after {
      background-position: 170% 0 !important;
    }
  }
}

/* Ressources — bandeau « Et si nous faisions le point… » : titre recentré. */
html body.v2.v2-resources-page .v2-cta .v2-h2 {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

/* Ressources — cartes d'articles : léger mouvement au survol, comme sur TPE-PME. */
@media (prefers-reduced-motion: no-preference) {
  html body.v2.v2-resources-page #contenu .resource-card {
    transition: transform .2s ease, box-shadow .2s ease !important;
  }
  @media (hover: hover) and (pointer: fine) {
    html body.v2.v2-resources-page #contenu .resource-card:hover {
      transform: translateY(-4px) !important;
      box-shadow: 0 8px 20px rgba(15,22,54,.1) !important;
    }
  }
}
