/**
 * Impression et export PDF.
 *
 * Un tutoriel réseau se suit devant une baie, pas devant le site.
 * Cette feuille produit une procédure lisible sur papier : sans
 * navigation, sans couleurs de fond, avec les URL explicitées et
 * des blocs de code qui ne se coupent pas en deux pages.
 */

@page {
  margin: 18mm 16mm;
}

/* Toujours le thème clair à l'impression, quoi qu'affiche l'écran :
   un fond sombre vide une cartouche d'encre. */
:root,
[data-theme="dark"] {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-raise: #F4F4F4;
  --border: #C9C9C9;
  --border-strong: #9A9A9A;
  --text: #000000;
  --text-soft: #262626;
  --text-mute: #4A4A4A;
  --accent: #000000;
  --accent-hover: #000000;
  --accent-soft: #F0F0F0;
  --accent-ink: #000000;
  --shadow-1: none;
  --shadow-2: none;
  color-scheme: light;
}

body {
  background: #FFFFFF !important;
  color: #000000;
  font-size: 11pt;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   CE QUI NE S'IMPRIME PAS
   -------------------------------------------------------------------------- */

.nc-entete,
.nc-pied,
.nc-lecture,
.nc-sousentete,
.nc-bascule,
.nc-recherche,
.nc-rubrique,
.nc-progression,
.nc-newsletter,
.nc-note,
.nc-note-admin,
.nc-figure__zoom[aria-label],
.nc-code__copier,
.wp-block-post-comments-form,
.wp-block-comments-pagination,
.wp-block-post-navigation-link,
.wp-block-navigation,
.nc-pagination,
.nc-loupe {
  display: none !important;
}

/* --------------------------------------------------------------------------
   MISE EN PAGE
   -------------------------------------------------------------------------- */

.nc-article {
  display: block !important;
  max-width: none !important;
  padding: 0 !important;
}

.nc-article__corps { max-width: none; }

/* Le sommaire est conservé : sur une procédure de dix pages, il sert.
   Mais il redevient un simple encadré en tête de document. */
.nc-article__flanc {
  position: static !important;
  display: block !important;
  page-break-after: avoid;
}

.nc-article__flanc:last-of-type { display: none !important; }

.nc-sommaire {
  margin-bottom: 8mm;
  padding: 4mm 5mm;
  border: 1px solid #C9C9C9;
}

.nc-sommaire__liste { columns: 2; column-gap: 8mm; }
.nc-sommaire__lien { border: none; padding: 2px 0; }

h1, h2, h3 { page-break-after: avoid; }
h1 { font-size: 20pt; }
h2 { font-size: 15pt; margin-top: 8mm; }
h3 { font-size: 12.5pt; }

p, li { orphans: 3; widows: 3; }

/* --------------------------------------------------------------------------
   CODE ET FIGURES — ne jamais couper
   -------------------------------------------------------------------------- */

.nc-code {
  background: #F4F4F4 !important;
  border: 1px solid #9A9A9A !important;
  page-break-inside: avoid;
}

.nc-code__entete {
  background: #E4E4E4 !important;
  border-bottom: 1px solid #9A9A9A !important;
}

.nc-code__langage { color: #262626 !important; }

.nc-code__corps {
  color: #000000 !important;
  font-size: 9pt;
  white-space: pre-wrap;
  overflow: visible;
}

.nc-code__ligne { white-space: pre-wrap; }
.nc-code__ligne::before { color: #6A6A6A !important; }

.nc-figure {
  page-break-inside: avoid;
  max-width: 120mm;
}

.nc-figure img {
  filter: none !important;
  max-width: 100%;
}

.nc-encadre {
  page-break-inside: avoid;
  border: 1px solid #9A9A9A !important;
  border-left: 3px solid #000000 !important;
  background: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   LIENS — l'adresse doit être lisible sur papier
   -------------------------------------------------------------------------- */

.entry-content a,
.wp-block-post-content a {
  color: #000000;
  text-decoration: underline;
}

.wp-block-post-content a[href^="http"]::after {
  content: " (" attr(href) ")";
  font-family: var(--font-mono);
  font-size: 8.5pt;
  word-break: break-all;
  color: #4A4A4A;
}

/* Inutile pour les ancres internes et les liens de figure */
.wp-block-post-content a[href^="#"]::after,
.nc-figure a::after,
.nc-sommaire a::after {
  content: "";
}

/* --------------------------------------------------------------------------
   COMMENTAIRES — gardés, mais dégraissés
   -------------------------------------------------------------------------- */

.wp-block-comment-template li {
  border: none;
  border-top: 1px solid #C9C9C9;
  border-radius: 0;
  padding: 3mm 0;
  page-break-inside: avoid;
}

/* --------------------------------------------------------------------------
   MENTION DE PROVENANCE
   Sans elle, une procédure imprimée est un document orphelin.
   -------------------------------------------------------------------------- */

.nc-article__corps::after {
  content: "networkcorp.fr";
  display: block;
  margin-top: 10mm;
  padding-top: 3mm;
  border-top: 1px solid #C9C9C9;
  font-family: var(--font-mono);
  font-size: 8.5pt;
  color: #4A4A4A;
}
