:root {
  --pme-image: url("../assets/images/metiers/donneesjour.webp");
  --pme-veil: rgba(240, 245, 253, 0.68);
  --pme-fond: #eef3fb;
}
html.theme-dark {
  --pme-image: url("../assets/images/metiers/donneesnuit.webp");
  --pme-veil: rgba(11, 16, 42, 0.70);
  --pme-fond: #0d1330;
}
html:not(.theme-dark) body.pme-page #contenu > .section.section-aqua,
html.theme-dark body.pme-page #contenu > .section.section-aqua {
  background: var(--color-soft) !important;
}
html:not(.theme-dark) body.pme-page #contenu > .section.section-aqua::before,
html.theme-dark body.pme-page #contenu > .section.section-aqua::before {
  content: "" !important;
  display: block !important;
  opacity: 1 !important;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--pme-veil), var(--pme-veil)) bottom center / 100% auto no-repeat,
    var(--pme-image) bottom center / 100% auto no-repeat,
    var(--pme-fond) !important;
}
html:not(.theme-dark) body.pme-page #contenu > .section.section-mist.section-aqua::before,
html.theme-dark body.pme-page #contenu > .section.section-mist.section-aqua::before {
  transform: none !important;
}
html.theme-dark body.pme-page #contenu > .section:not(.conversion-band)::after {
  content: none !important; display: none !important; background: none !important;
}
html.theme-dark body.pme-page #contenu > .section:not(.conversion-band):not(.section-aqua)::before {
  background: none !important;
}

@media (max-width: 900px) {
  html:not(.theme-dark) body.pme-page {
    --pme-image: url("../assets/images/metiers/donneesjourhaut.webp");
  }
  html.theme-dark body.pme-page {
    --pme-image: url("../assets/images/metiers/donneesnuithaut.webp");
  }
  html:not(.theme-dark) body.pme-page #contenu > .section.section-aqua::before,
  html.theme-dark body.pme-page #contenu > .section.section-aqua::before {
    background:
      linear-gradient(var(--pme-veil), var(--pme-veil)),
      var(--pme-image) bottom center / cover no-repeat,
      var(--pme-fond) !important;
  }
}

@media (max-width: 900px) {
  html:not(.theme-dark) body.pme-page .section-aqua .card,
  html:not(.theme-dark) body.pme-page .section-aqua .offer-card,
  html:not(.theme-dark) body.pme-page .section-aqua .sector-editorial-chapter {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  html.theme-dark body.pme-page .section-aqua .card,
  html.theme-dark body.pme-page .section-aqua .offer-card,
  html.theme-dark body.pme-page .section-aqua .sector-editorial-chapter {
    background: rgba(13, 19, 48, 0.78) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

/* Mobile jour : abaisser le motif chiffré du bandeau « Les systèmes que nous concevons » pour dégager ses titres. */
@media (max-width: 720px) and (prefers-color-scheme: light) {
  html:not(.theme-dark):not([data-theme="dark"]) body.pme-page #contenu > .section.section-soft.section-aqua::before {
    background:
      linear-gradient(var(--pme-veil), var(--pme-veil)),
      var(--pme-image) center calc(100% + 70px) / cover no-repeat,
      var(--pme-fond) !important;
  }
}

@media (max-width: 720px) {
  html[data-theme="light"] body.pme-page #contenu > .section.section-soft.section-aqua::before {
    background:
      linear-gradient(var(--pme-veil), var(--pme-veil)),
      var(--pme-image) center calc(100% + 70px) / cover no-repeat,
      var(--pme-fond) !important;
  }
}

/* TPE & PME : cartes Bénéfice en bleu intermédiaire, texte blanc ; liseré dégradé conservé. */
body.pme-page #contenu > .section.section-soft.section-aqua .sector-editorial-benefit {
  background: #415b8f !important;
  color: #ffffff !important;
}

body.pme-page #contenu > .section.section-soft.section-aqua .sector-editorial-benefit strong {
  color: #ffffff !important;
}

/* TPE & PME — mode jour : conclusion Méthode dans le même bleu intermédiaire. */
html[data-theme="light"] body.pme-page .sector-method-conclusion {
  background: #415b8f !important;
  color: #ffffff !important;
}

@media (prefers-color-scheme: light) {
  html:not(.theme-dark):not([data-theme="dark"]) body.pme-page .sector-method-conclusion {
    background: #415b8f !important;
    color: #ffffff !important;
  }
}

/* TPE & PME — mode nuit : conclusion Méthode identique aux cartes Bénéfice. */
html.theme-dark body.pme-page .sector-method-conclusion,
html[data-theme="dark"] body.pme-page .sector-method-conclusion {
  background: #415b8f !important;
  color: #ffffff !important;
}

@media (prefers-color-scheme: dark) {
  html:not(.theme-dark):not([data-theme="light"]) body.pme-page .sector-method-conclusion {
    background: #415b8f !important;
    color: #ffffff !important;
  }
}

/* Mobile : bandeau « Pour qui ? » — afficher tout le portrait sans l'écraser ni le recadrer. */
@media (max-width: 720px) {
  html:not(.theme-dark) body.pme-page #contenu > .section.section-mist.section-aqua::before,
  html.theme-dark body.pme-page #contenu > .section.section-mist.section-aqua::before,
  html[data-theme="dark"] body.pme-page #contenu > .section.section-mist.section-aqua::before {
    background:
      linear-gradient(var(--pme-veil), var(--pme-veil)),
      var(--pme-image) center center / auto 100% no-repeat,
      var(--pme-fond) !important;
  }
}

@media (prefers-color-scheme: dark) and (max-width: 720px) {
  html:not([data-theme="light"]) body.pme-page #contenu > .section.section-mist.section-aqua::before {
    background:
      linear-gradient(var(--pme-veil), var(--pme-veil)),
      var(--pme-image) center center / auto 100% no-repeat,
      var(--pme-fond) !important;
  }
}

/* TPE et PME : six systèmes et bénéfices à hauteur naturelle */
@media (min-width: 721px) {
  body.pme-page #contenu > .section.section-soft.section-aqua .sector-editorial-benefit {
    height: auto !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    margin-top: auto !important;
  }
}

@media (min-width: 721px) and (max-width: 1050px) {
  body.pme-page #contenu > .section.section-soft.section-aqua .sector-editorial-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1051px) {
  body.pme-page #contenu > .section.section-soft.section-aqua .sector-editorial-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.pme-page #contenu > .section.section-soft.section-aqua .sector-card-accordion > .sector-editorial-content {
    display: flex !important;
    flex-direction: column;
  }
}

body.pme-page .nowrap {
  white-space: nowrap;
}

body.pme-page .pme-daily-title {
  text-wrap: balance;
}

@media (min-width: 721px) {
  body.pme-page .pme-reading-width {
    max-width: 72ch;
    text-align: left;
  }

  body.pme-page .pme-systems-scope {
    margin-top: 2.5rem;
  }
}

@media (max-width: 720px) {
  body.pme-page .pme-systems-scope {
    margin-top: 1.75rem;
  }
}

body.pme-page .sector-method-card {
  padding: 1.75rem 1.75rem 4.5rem;
}

body.pme-page .sector-method-card h3 {
  line-height: 1.3;
}

body.pme-page .sector-method-detail {
  margin: 0.75rem 0 0;
  color: inherit;
  font-size: 0.95em;
  font-weight: 400;
  line-height: 1.55;
}

body.pme-page .sector-method-conclusion {
  margin-top: 2.5rem;
}

body.pme-page .sector-method-conclusion + h3 {
  margin-top: 3.5rem;
}

body.pme-page .pme-tariff-reading {
  max-width: 72ch;
  margin-top: 1.5rem;
  padding: 1.75rem;
  border-radius: 0;
  text-align: left;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

html:not(.theme-dark) body.pme-page .pme-tariff-reading,
html[data-theme="light"] body.pme-page .pme-tariff-reading {
  background: rgba(255, 255, 255, 0.82);
}

html.theme-dark body.pme-page .pme-tariff-reading,
html[data-theme="dark"] body.pme-page .pme-tariff-reading {
  background: rgba(13, 19, 48, 0.78);
}

/* Cartes méthode : titre et explication empilés */
body.pme-page .sector-method-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
body.pme-page .sector-method-card .card-title-with-icon,
body.pme-page .sector-method-card .sector-method-detail {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Mode nuit : alternance visible des fonds de sections */
html.theme-dark body.pme-page #contenu > .section:not(.section-aqua):not(.section-soft):not(.conversion-band),
html[data-theme="dark"] body.pme-page #contenu > .section:not(.section-aqua):not(.section-soft):not(.conversion-band) {
  background: #0b1028 !important;
}
html.theme-dark body.pme-page #contenu > .section.section-soft:not(.section-aqua),
html[data-theme="dark"] body.pme-page #contenu > .section.section-soft:not(.section-aqua) {
  background: linear-gradient(135deg, #11183d 0%, #172149 58%, #202d60 100%) !important;
}
@media (prefers-color-scheme: dark) {
  html:not(.theme-dark):not([data-theme="light"]) body.pme-page #contenu > .section:not(.section-aqua):not(.section-soft):not(.conversion-band) {
    background: #0b1028 !important;
  }
  html:not(.theme-dark):not([data-theme="light"]) body.pme-page #contenu > .section.section-soft:not(.section-aqua) {
    background: linear-gradient(135deg, #11183d 0%, #172149 58%, #202d60 100%) !important;
  }
}

/* Cartes méthode : pictogramme au-dessus du titre, aucun mot coupé */
body.pme-page .sector-method-card {
  padding-left: 1.35rem;
  padding-right: 1.35rem;
}
body.pme-page .sector-method-card .card-title-with-icon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
}
body.pme-page .sector-method-card .card-title-with-icon,
body.pme-page .sector-method-card .card-title-with-icon span,
body.pme-page .sector-method-card .card-title-with-icon strong,
body.pme-page .sector-method-card .sector-method-detail {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
  -webkit-hyphens: manual;
}
