/**
 * CoconSEM Global Frontend
 * Version proposée : 1.6.0
 *
 * Rôle :
 * - fournir un rendu de base propre, cohérent et utilisable tel quel ;
 * - rester volontairement facile à surcharger par les extensions Bridge ;
 * - ne jamais chercher à reprendre la priorité sur un Bridge actif.
 *
 * Principes :
 * - spécificité basse grâce à :where() ;
 * - variables CSS pour les choix visuels ;
 * - !important réservé aux correctifs structurels indispensables ;
 * - aucune couleur ni géométrie spécifique à un client.
 */

/* =========================================================
   1. TOKENS GLOBAUX
   ========================================================= */

body.coconsem{
  --csmk-content-max: 1040px;
  --csmk-content-gutter: 32px;

  --csmk-text: #172033;
  --csmk-text-soft: #5f6876;
  --csmk-surface: #ffffff;
  --csmk-surface-soft: #f7f8fa;
  --csmk-border: #e4e7ec;

  --csmk-accent: #2d6462;
  --csmk-accent-strong: #234f4d;
  --csmk-accent-contrast: #ffffff;
  --csmk-highlight: #c5343a;

  --csmk-radius-sm: 10px;
  --csmk-radius-md: 16px;
  --csmk-radius-lg: 22px;

  --csmk-shadow-sm: 0 8px 24px rgba(15, 23, 42, .07);
  --csmk-shadow-md: 0 16px 42px rgba(15, 23, 42, .11);

  --csmk-heading-line-height: 1.18;
  --csmk-body-line-height: 1.68;
}

/* =========================================================
   2. BASE DOCUMENTAIRE
   ========================================================= */

body.coconsem :where(.content-single-page, article.prose, .csmk-bridge-prose){
  color: var(--csmk-text);
  line-height: var(--csmk-body-line-height);
}

body.coconsem :where(
  .content-single-page,
  article.prose,
  .csmk-bridge-prose
) :where(h1, h2, h3, h4, h5, h6){
  max-width: 100%;
  color: var(--csmk-text);
  line-height: var(--csmk-heading-line-height);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

body.coconsem :where(
  .content-single-page,
  article.prose,
  .csmk-bridge-prose
) :where(h1.reveal, h2.reveal, h3.reveal, h4.reveal, h5.reveal, h6.reveal){
  height: auto;
  min-height: 0;
  max-height: none;
  white-space: normal;
  overflow: visible;
}

/*
 * Le global n'impose volontairement aucune couleur spécifique aux H2.
 * Les thèmes et Bridges peuvent donc les personnaliser simplement.
 */

/* =========================================================
   3. IMAGES DE CONTENU
   ========================================================= */

body.coconsem :where(
  main .content-single-page,
  article.prose,
  .csmk-bridge-prose
) img:not(.emoji):not(.cover-image):not(.mc-header__logo){
  display: block;
  width: auto;
  max-width: min(100%, 760px);
  height: auto;
  margin: 24px 0 0;
  border-radius: var(--csmk-radius-sm);
}

body.coconsem :where(
  main .content-single-page,
  article.prose,
  .csmk-bridge-prose
) img.aligncenter:not(.emoji){
  margin-right: auto;
  margin-left: auto;
}

body.coconsem :where(
  main .content-single-page,
  article.prose,
  .csmk-bridge-prose
) img.image-avec-texte{
  width: 100%;
  max-width: 960px;
}

@media (max-width: 767px){
  body.coconsem :where(
    main .content-single-page,
    article.prose,
    .csmk-bridge-prose
  ) img:not(.emoji):not(.cover-image):not(.mc-header__logo){
    max-width: 100%;
  }
}

/* =========================================================
   4. FAQ
   ========================================================= */

body.coconsem :where(.coconsem-faq){
  margin: 1.75rem 0;
}

body.coconsem :where(.coconsem-faq-item){
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--csmk-border);
  border-radius: 12px;
  background: var(--csmk-surface);
}

body.coconsem :where(.coconsem-faq-question){
  position: relative;
  display: block;
  padding: 15px 52px 15px 18px;
  cursor: pointer;
  list-style: none;
  color: var(--csmk-text);
  font-weight: 700;
  line-height: 1.4;
}

body.coconsem :where(.coconsem-faq-question)::-webkit-details-marker{
  display: none;
}

body.coconsem :where(.coconsem-faq-question)::after{
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 22px;
  line-height: 1;
}

body.coconsem :where(.coconsem-faq-item[open] .coconsem-faq-question)::after{
  content: "–";
}

body.coconsem :where(.coconsem-faq-answer){
  padding: 0 18px 18px;
  overflow: hidden;
  opacity: 1;
  transition: max-height .28s ease, opacity .2s ease;
}

/* =========================================================
   5. RESSOURCES CIBLÉES
   ========================================================= */

/*
 * Defaults intentionnellement peu spécifiques.
 * Un Bridge peut les remplacer avec une simple règle :
 * body.csmk-client-bridge .csmk-ext-resource-box { ... }
 */

body.coconsem :where(.csmk-ext-resource-box){
  margin: 1.45em 0 5.6em;
}

body.coconsem :where(
  .csmk-ext-resource-box + h2,
  .csmk-ext-resource-box + h3,
  .csmk-ext-resource-box + h4,
  .csmk-ext-resource-box + .wp-block-heading,
  .csmk-ext-resource-box + .heading-flex
){
  margin-top: 0;
}

@media (max-width: 767px){
  body.coconsem :where(.csmk-ext-resource-box){
    margin-bottom: 4.2em;
  }
}

/* =========================================================
   6. HEADER ARTICLE / HERO PAR DÉFAUT
   ========================================================= */

body.coconsem :where(.coconsem-header){
  box-sizing: border-box;
  width: min(100%, var(--csmk-content-max));
  max-width: calc(100vw - var(--csmk-content-gutter));
  margin: 26px auto 24px;
  padding: 0;
  clear: both;
  border: 0;
  background: transparent;
}

body.coconsem :where(.coconsem-header, .coconsem-header *, .coconsem-header *::before, .coconsem-header *::after){
  box-sizing: border-box;
}

body.coconsem :where(.coconsem-header.coconsem-header--overlay){
  position: relative;
  overflow: hidden;
  border-radius: var(--csmk-radius-lg);
  background: transparent;
  box-shadow: var(--csmk-shadow-md);
}

body.coconsem :where(.coconsem-header .coconsem-hero-media){
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #111;
}

body.coconsem :where(.coconsem-header .coconsem-hero-media)::before,
body.coconsem :where(.coconsem-header .coconsem-hero-media)::after{
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity .22s ease, background .22s ease;
}

body.coconsem :where(.coconsem-header .coconsem-hero-media)::before{
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.10) 0%,
    rgba(0,0,0,.05) 45%,
    rgba(0,0,0,.28) 100%
  );
  opacity: .72;
}

body.coconsem :where(.coconsem-header .coconsem-hero-media)::after{
  background: radial-gradient(
    ellipse at center,
    rgba(255,255,255,.16) 0%,
    rgba(255,255,255,.08) 34%,
    rgba(255,255,255,0) 72%
  );
  opacity: 0;
}

body.coconsem :where(.coconsem-header.csmk-hero-bg-light .coconsem-hero-media)::before{
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.20) 0%,
    rgba(255,255,255,.12) 45%,
    rgba(0,0,0,.10) 100%
  );
  opacity: .85;
}

body.coconsem :where(.coconsem-header.csmk-hero-bg-dark .coconsem-hero-media)::before{
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.46) 0%,
    rgba(0,0,0,.28) 48%,
    rgba(0,0,0,.40) 100%
  );
  opacity: .86;
}

body.coconsem :where(.coconsem-header.csmk-hero-bg-mixed .coconsem-hero-media)::before{
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.30) 0%,
    rgba(0,0,0,.12) 44%,
    rgba(0,0,0,.36) 100%
  );
  opacity: .90;
}

body.coconsem :where(.coconsem-header.csmk-hero-bg-dark .coconsem-hero-media)::after{
  opacity: .14;
}

body.coconsem :where(.coconsem-header .cover-image){
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
  border-radius: 0;
}

body.coconsem :where(.coconsem-header .coconsem-hero-title-slot){
  position: absolute;
  right: 0;
  bottom: clamp(22px, 4vw, 54px);
  left: 0;
  z-index: 3;
  padding: 0 clamp(24px, 4vw, 80px);
  text-align: center;
  pointer-events: none;
}

body.coconsem :where(.coconsem-header .coconsem-hero-title){
  position: relative;
  display: inline-block;
  margin: 0;
  padding:
    clamp(10px, 1.4vw, 16px)
    clamp(18px, 2.6vw, 30px)
    clamp(13px, 1.7vw, 18px);
  border: 0;
  border-radius: 16px;
  background: rgba(10,13,15,.28);
  color: #fff;
  box-shadow: 0 16px 38px rgba(0,0,0,.20);
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.12;
  letter-spacing: .01em;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0,0,0,.62);
  text-wrap: balance;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

body.coconsem :where(.coconsem-header .coconsem-hero-title)::after{
  content: "";
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 54px;
  height: 3px;
  border-radius: 99px;
  background: var(--csmk-highlight);
  transform: translateX(-50%);
  opacity: .95;
}

body.coconsem :where(.coconsem-header.csmk-hero-bg-light .coconsem-hero-title),
body.coconsem :where(.coconsem-header[data-csmk-hero-contrast="light"] .coconsem-hero-title){
  background: rgba(255,255,255,.46);
  color: #111;
  box-shadow: 0 14px 34px rgba(255,255,255,.10);
  text-shadow: 0 1px 12px rgba(255,255,255,.78);
}

body.coconsem :where(
  .coconsem-header.csmk-hero-bg-dark .coconsem-hero-title,
  .coconsem-header.csmk-hero-bg-mixed .coconsem-hero-title,
  .coconsem-header[data-csmk-hero-contrast="dark"] .coconsem-hero-title,
  .coconsem-header[data-csmk-hero-contrast="mixed"] .coconsem-hero-title
){
  background: rgba(0,0,0,.48);
  color: #fff;
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
  text-shadow: 0 2px 18px rgba(0,0,0,.82);
}

/* =========================================================
   7. HOOK SOUS LE HERO
   ========================================================= */

body.coconsem :where(.coconsem-header .coconsem-hook-container){
  width: 100%;
  margin: 0;
  padding: clamp(20px, 3vw, 28px) clamp(18px, 4vw, 56px) 22px;
  border: 0;
  background: var(--csmk-accent);
  color: var(--csmk-accent-contrast);
  box-shadow: none;
  text-align: center;
}

body.coconsem :where(
  .coconsem-header .coconsem-hook-container .hook,
  .coconsem-header .coconsem-hook-container .csmk-hero-hook,
  .coconsem-header p.hook
){
  display: block;
  width: min(100%, 820px);
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 4px solid var(--csmk-highlight);
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 700;
  line-height: 1.55;
  text-align: center;
  text-shadow: none;
  opacity: 1;
}

body.coconsem :where(.coconsem-header .arrow-bounce){
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

body.coconsem :where(.coconsem-header .chevron-svg){
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #d98a55;
}

/* =========================================================
   8. TITRES FLEXIBLES / MULTILIGNES
   ========================================================= */

body.coconsem :where(.heading-flex){
  align-items: flex-start;
  min-width: 0;
}

body.coconsem :where(.heading-flex.is-multiline){
  display: block;
}

body.coconsem :where(.heading-flex.is-multiline .special-heading-border){
  display: none;
}

body.coconsem :where(
  .heading-flex.is-multiline h2,
  .heading-flex.is-multiline h3,
  .heading-flex.is-multiline h4
){
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: none;
  white-space: normal;
  overflow: visible;
}

/* =========================================================
   9. RESPONSIVE
   ========================================================= */

@media (max-width: 767px){
  body.coconsem{
    --csmk-content-gutter: 20px;
  }

  body.coconsem :where(.coconsem-header){
    margin-top: 16px;
  }

  body.coconsem :where(.coconsem-header .coconsem-hook-container){
    padding: 18px 16px;
  }

  body.coconsem :where(
    .coconsem-header .coconsem-hook-container .hook,
    .coconsem-header .coconsem-hook-container .csmk-hero-hook
  ){
    width: 100%;
    padding-left: 14px;
    font-size: 15px;
    line-height: 1.45;
  }

  body.coconsem :where(.coconsem-header .coconsem-hero-title-slot){
    bottom: 16px;
    padding-right: 18px;
    padding-left: 18px;
  }

  body.coconsem :where(.coconsem-header .coconsem-hero-title){
    border-radius: 14px;
  }
}

/* =========================================================
   10. ACCESSIBILITÉ
   ========================================================= */

@media (prefers-reduced-motion: reduce){
  body.coconsem *,
  body.coconsem *::before,
  body.coconsem *::after{
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}