/* =========================================================================
   NextToYourPlace — print.css
   Stylesheet print pour pages /commune/ et PDF Le Dossier (14 pages).
   ========================================================================= */

@media print {
  :root {
    --bg: #fff;
    --paper: #fff;
    --paper-warm: #fff;
    --paper-ridge: #fff;
    --paper-deep: #fff;
    --ink: #000;
    --fg: #000;
    --fg-soft: #1a1a1a;
    --fg-muted: #4a4a4a;
    --rule: #000;
  }

  @page {
    size: A4;
    margin: 18mm 16mm 22mm 16mm;
    @bottom-center {
      content: "NextToYourPlace · Le Dossier · " counter(page) "/" counter(pages);
      font-family: 'Source Serif 4', serif;
      font-size: 9pt;
      color: #4a4a4a;
      font-style: italic;
    }
  }
  @page :first { @bottom-center { content: ""; } }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 11pt;
    line-height: 1.45;
  }

  h1 { font-size: 22pt; line-height: 1.15; margin: 0 0 8mm; page-break-after: avoid; }
  h2 { font-size: 16pt; line-height: 1.2; margin: 8mm 0 4mm; page-break-after: avoid; }
  h3 { font-size: 13pt; line-height: 1.25; margin: 6mm 0 3mm; page-break-after: avoid; }

  p, dl, dd, dt, li { orphans: 3; widows: 3; }
  p { max-width: none; margin: 0 0 4mm; }

  /* Hide all interactive surfaces */
  .btn, button, input, select, textarea, .switch, .check, .radio,
  nav, .expat-banner__close, .cta-card, .expat-cta-pack,
  .site-header__nav, .profile-pill, .toolbar {
    display: none !important;
  }

  /* Source-cite — signature de sérieux, toujours visible */
  .source-cite {
    color: #000 !important;
    font-style: italic;
    font-size: 9pt;
  }

  /* Sections cohérentes — pas de coupure interne */
  .dim, .profile-panel, .encart-editorial, .card, .dl-stat-grid, .expat-tile-set, .source-line {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #000 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  /* Le Dossier — saut de page systématique avant chaque profil */
  .pdf-page { page-break-before: always; break-before: page; }
  .pdf-page:first-child { page-break-before: auto; }

  /* Liens en print — afficher l'URL */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #4a4a4a;
    font-style: italic;
  }
  a[href^="/"]::after, a[href^="#"]::after { content: ""; }

  /* Ornements coupés */
  .fleuron, .logo__wordmark::after { display: none !important; }

  /* Profile color forcée en encre noire pour print monochrome */
  .kicker, .encart-editorial__kicker, .profile-pill__dot {
    color: #000 !important;
    background: #000 !important;
  }

  /* Tables denses (profil Investisseur) */
  table { border-collapse: collapse; width: 100%; font-size: 10pt; }
  th, td { border: 0.5pt solid #000; padding: 3mm 2mm; text-align: left; }
  th { background: #f0f0f0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
