/* ==========================================================
   PRINT — Feuille de styles pour l'impression / export PDF
   Chargée avec media="print" dans cgv.src.html
   ========================================================== */

@page {
  size: A4;
  margin: 2cm 2cm 2.5cm 2cm;

  @bottom-center {
    content: "Triphase Energie — CGV — page " counter(page) " / " counter(pages);
    font-family: 'Montserrat', system-ui, sans-serif;
    font-size: 8pt;
    color: #999;
  }
}

@page :first {
  @bottom-center {
    content: none;
  }
}

/* ==========================================================
    RESET PRINT — neutraliser reveal (opacity:0 à l'écran)
    ========================================================== */
.reveal,
.reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
}

* {
  background: transparent !important;
  box-shadow: none !important;
  text-shadow: none !important;
  animation: none !important;
  transition: none !important;
}

body {
  font-family: 'Open Sans', system-ui, sans-serif;
  font-size: 10.5pt;
  line-height: 1.55;
  color: #000;
}

/* ==========================================================
   MASQUER ÉLÉMENTS NON PERTINENTS
   ========================================================== */
.site-header,
.tags-bar,
.art-footer,
.site-footer,
.nav-toggle,
.mobile-nav,
.btn,
.article-hero::before,
.article-hero__eyebrow,
.article-hero__chapeau,
.article-cta,
.sim-block,
.cal-box,
.tech-disclosure,
.offre,
.kpis,
.tarif-table,
.note,
.source,
.article-hero .btn,
.site-header .btn {
  display: none !important;
}

/* ==========================================================
   HERO — ne garder que le titre
   ========================================================== */
.article-hero {
  padding: 0 0 18pt 0;
  margin-bottom: 24pt;
  border-bottom: 1.5pt solid #000;
}
.article-hero__inner {
  max-width: none;
}
.article-hero h1 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 18pt;
  font-weight: 700;
  color: #000;
  margin: 0;
  max-width: none;
  line-height: 1.2;
}
.article-hero h1 em {
  font-style: italic;
  color: #000;
}

/* ==========================================================
   CORPS — pleine largeur
   ========================================================== */
.article-body,
.cgv-body {
  max-width: none;
  padding: 0;
  margin: 0;
}

/* ==========================================================
   TOC (sommaire)
   ========================================================== */
.toc {
  border: 1pt solid #ccc;
  border-left: 3pt solid #000;
  border-radius: 0;
  padding: 10pt 14pt;
  margin-bottom: 24pt;
  break-after: auto;
  page-break-after: auto;
}
.toc__title {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 8pt;
}
.toc ol {
  padding-left: 14pt;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2pt 18pt;
}
.toc li {
  font-size: 9pt;
  line-height: 1.45;
}
.toc a {
  color: #000;
  text-decoration: none;
}

/* ==========================================================
   SECTIONS — flux continu, coupures propres entre blocs.
   On ne force pas de saut de page avant chaque article : le
   contenu s'enchaîne naturellement (~10 pages au lieu de 20).
   Les blocs atomiques (listes, callouts, scope, fees) restent
   protégés contre les coupures.
   ========================================================== */
.article-section {
  margin-bottom: 16pt;
  padding-top: 4pt;
  break-inside: auto;
  break-before: auto;
}
.article-section:first-of-type {
  break-before: auto;
}
.article-section h2 {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  font-size: 12pt;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #000;
  margin: 0 0 10pt;
  padding-top: 8pt;
  border-top: 1pt solid #000;
  display: flex;
  align-items: flex-start;
  gap: 8pt;
  break-after: avoid;
  page-break-after: avoid;
}
.h2-n {
  flex-shrink: 0;
  margin-top: 1pt;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 7pt;
  font-weight: 600;
  color: #000;
  background: #eee;
  border: 0.5pt solid #999;
  border-radius: 2pt;
  padding: 2pt 5pt;
  line-height: 1;
}

/* ==========================================================
   PARAGRAPHES — anti-orphelines
   ========================================================== */
.article-section p {
  font-size: 10pt;
  line-height: 1.55;
  margin-bottom: 8pt;
  orphans: 3;
  widows: 3;
}
.article-section p:last-child {
  margin-bottom: 0;
}
.article-section strong {
  color: #000;
  font-weight: 600;
}

/* ==========================================================
   LISTES — blocs atomiques, ne pas les couper
   ========================================================== */
.cgv-defs,
.cgv-list {
  list-style: none;
  padding-left: 0;
  margin: 8pt 0 12pt;
  break-inside: avoid;
  page-break-inside: avoid;
}
.cgv-defs li,
.cgv-list li {
  position: relative;
  padding-left: 16pt;
  margin-bottom: 5pt;
  font-size: 9.5pt;
  line-height: 1.5;
  orphans: 2;
  widows: 2;
}
.cgv-defs li::before,
.cgv-list li::before {
  content: '';
  position: absolute;
  left: 2pt;
  top: 8pt;
  width: 6pt;
  height: 1.5pt;
  background: #000;
  border-radius: 0;
}
.cgv-defs li::before {
  content: none;
}
.cgv-defs li {
  padding-left: 100pt;
}
.cgv-defs strong {
  position: absolute;
  left: 0;
  top: 0;
  width: 92pt;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 8.5pt;
  font-weight: 700;
  color: #000;
  letter-spacing: 0;
}

/* ==========================================================
   BLOC CHAMP / HORS CHAMP — bloc atomique
   ========================================================== */
.cgv-scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10pt;
  margin: 16pt 0;
  break-inside: avoid;
  page-break-inside: avoid;
}
.cgv-scope__card {
  border: 1pt solid #999;
  border-radius: 0;
  padding: 12pt 14pt;
}
.cgv-scope__card--in {
  border-top: 2pt solid #000;
}
.cgv-scope__card--out {
  border-top: 2pt solid #000;
}
.cgv-scope__tag {
  display: inline-flex;
  align-items: center;
  gap: 4pt;
  padding: 2pt 7pt;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 7pt;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 0;
  margin-bottom: 8pt;
  border: 0.5pt solid #999;
  color: #000;
}
.cgv-scope__card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cgv-scope__card li {
  position: relative;
  padding-left: 12pt;
  margin-bottom: 5pt;
  font-size: 9pt;
  line-height: 1.5;
  color: #000;
}
.cgv-scope__card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7pt;
  width: 4pt;
  height: 4pt;
  border-radius: 50%;
  background: #000;
}

/* ==========================================================
   MODÈLES DE FACTURATION — bloc atomique
   ========================================================== */
.cgv-fees {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 14pt 0;
  border: 1pt solid #999;
  border-radius: 0;
  overflow: visible;
  break-inside: avoid;
  page-break-inside: avoid;
}
.cgv-fees__row {
  display: grid;
  grid-template-columns: 160pt 1fr;
  gap: 12pt;
  padding: 10pt 14pt;
  border-bottom: 0.5pt solid #ccc;
}
.cgv-fees__row:last-child {
  border-bottom: none;
}
.cgv-fees__label {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 9pt;
  font-weight: 700;
  color: #000;
}
.cgv-fees__desc {
  font-size: 9.5pt;
  line-height: 1.5;
  color: #000;
}

/* ==========================================================
   CALLOUTS — blocs atomiques
   ========================================================== */
.callout {
  border: 1pt solid #999;
  border-left: 3pt solid #000;
  border-radius: 0;
  padding: 10pt 14pt;
  margin: 14pt 0;
  break-inside: avoid;
  page-break-inside: avoid;
}
.callout p {
  font-size: 9.5pt;
  color: #000;
  margin-bottom: 0 !important;
  font-style: italic;
}
.callout p + p {
  margin-top: 6pt !important;
}
.callout--gold {
  border-left: 3pt solid #000;
}
.callout--gold p {
  font-style: normal;
  font-size: 9.5pt;
  line-height: 1.5;
}

/* ==========================================================
   LIENS — afficher l'URL
   ========================================================== */
a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 1pt;
}
a[href^="http"]::after,
a[href^="mailto"]::after {
  content: " (" attr(href) ")";
  font-size: 8pt;
  color: #666;
  text-decoration: none;
}

/* ==========================================================
   ENDMARK
   ========================================================== */
.cgv-endmark {
  text-align: center;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 8pt;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #999;
  margin-top: 28pt;
  padding-top: 14pt;
  border-top: 0.5pt solid #ccc;
}

/* ==========================================================
   RESPONSIVE — annuler en print
   (La sortie est en A4 fixe ; on neutralise les adaptations
   mobiles pour éviter qu'elles ne s'appliquent à l'impression.)
   ========================================================== */
@media (max-width: 600px) {
  .cgv-defs li {
    padding-left: 16pt;
  }
  .cgv-defs strong {
    position: static;
    display: inline;
    width: auto;
  }
  .cgv-fees__row {
    grid-template-columns: 1fr;
    gap: 4pt;
  }
  .cgv-scope {
    grid-template-columns: 1fr;
  }
}
