/* =============================================
   SRE - CSS d'impression optimisé
   Styles pour l'impression des pages
   ============================================= */

/* Reset et base pour l'impression */
@media print {
  /* Variables adaptées pour l'impression */
  :root {
    --c-primary: #000;
    --c-primary-700: #000;
    --c-fg: #000;
    --c-muted: #333;
    --c-border: #ccc;
    --c-white: #fff;
    --c-bg: #fff;
  }

  /* Reset général */
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Configuration de page */
  @page {
    margin: 2cm;
    size: A4;
  }

  @page :first {
    margin-top: 1cm;
  }

  /* Corps de document */
  body {
    font-family: "Times New Roman", serif;
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }

  /* Container */
  .container {
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  /* =============================================
     ÉLÉMENTS À MASQUER À L'IMPRESSION
     ============================================= */
  
  /* Navigation et éléments interactifs */
  .header,
  .nav,
  .nav__menu,
  .nav__toggle,
  .hero__actions,
  .btn,
  button,
  .footer,
  form,
  .form,
  #contactForm,
  .fade-in,
  
  /* Éléments décoratifs */
  .hero::before,
  .about__image::after,
  .service-card__image::after,
  
  /* Animations et interactions */
  [data-stagger] {
    display: none !important;
  }

  /* =============================================
     STRUCTURE ET TITRES
     ============================================= */

  /* Hero section simplifiée */
  .hero {
    background: none;
    padding: 0;
    margin-bottom: 2cm;
    text-align: center;
  }

  .hero__title {
    font-size: 24pt;
    font-weight: bold;
    margin-bottom: 0.5cm;
    color: #000;
  }

  .hero__subtitle {
    font-size: 14pt;
    margin-bottom: 1cm;
    color: #333;
  }

  /* Titres hiérarchisés */
  h1 {
    font-size: 22pt;
    font-weight: bold;
    margin: 1cm 0 0.5cm 0;
    page-break-after: avoid;
  }

  h2 {
    font-size: 18pt;
    font-weight: bold;
    margin: 0.8cm 0 0.4cm 0;
    page-break-after: avoid;
    border-bottom: 1pt solid #000;
    padding-bottom: 0.2cm;
  }

  h3 {
    font-size: 14pt;
    font-weight: bold;
    margin: 0.6cm 0 0.3cm 0;
    page-break-after: avoid;
  }

  h4 {
    font-size: 12pt;
    font-weight: bold;
    margin: 0.4cm 0 0.2cm 0;
    page-break-after: avoid;
  }

  /* =============================================
     SECTIONS ET CONTENU
     ============================================= */

  /* Sections */
  .section {
    margin-bottom: 1.5cm;
    page-break-inside: avoid;
    padding: 0;
  }

  /* Paragraphes */
  p {
    margin-bottom: 0.4cm;
    text-align: justify;
    orphans: 3;
    widows: 3;
  }

  .lead {
    font-size: 13pt;
    font-weight: bold;
    margin-bottom: 0.6cm;
  }

  /* =============================================
     CARTES ET SERVICES
     ============================================= */

  /* Services en grille simplifiée */
  .grid {
    display: block;
  }

  .service-card,
  .card {
    border: 1pt solid #000;
    margin-bottom: 0.8cm;
    padding: 0.5cm;
    page-break-inside: avoid;
    background: #fff;
  }

  .service-card__title,
  .card h3,
  .card h4 {
    font-size: 14pt;
    font-weight: bold;
    margin-bottom: 0.3cm;
    color: #000;
  }

  .service-card__description {
    font-size: 11pt;
    line-height: 1.3;
  }

  /* Images dans les cartes */
  .service-card__image,
  .about__image {
    display: none;
  }

  /* =============================================
     LISTES ET ÉNUMÉRATIONS
     ============================================= */

  /* Listes à puces personnalisées */
  .values-list {
    margin: 0.5cm 0;
  }

  .values-item {
    margin-bottom: 0.3cm;
    page-break-inside: avoid;
    display: block;
  }

  .values-icon {
    display: none;
  }

  .values-text {
    font-size: 11pt;
  }

  .values-text strong {
    font-weight: bold;
  }

  /* Listes standard */
  ul, ol {
    margin: 0.4cm 0;
    padding-left: 1cm;
  }

  li {
    margin-bottom: 0.2cm;
    page-break-inside: avoid;
  }

  /* =============================================
     TIMELINE ET PROCESSUS
     ============================================= */

  /* Timeline simplifiée pour l'impression */
  [style*="position: relative"][style*="padding-left: 2.5rem"] {
    padding-left: 0 !important;
    position: relative !important;
    margin-bottom: 0.6cm;
    border-left: 2pt solid #000;
    padding-left: 0.5cm;
  }

  /* Masquer les éléments décoratifs de timeline */
  [style*="position: absolute"][style*="border-radius: 50%"] {
    display: none !important;
  }

  /* =============================================
     SIDEBAR ET CONTENU SECONDAIRE
     ============================================= */

  /* Sidebar transformée en contenu linéaire */
  aside {
    border-top: 1pt solid #000;
    margin-top: 1cm;
    padding-top: 0.5cm;
  }

  /* Grilles transformées en contenu linéaire */
  .grid--3,
  .grid--4 {
    display: block;
  }

  .grid--3 .card,
  .grid--4 .card {
    margin-bottom: 0.6cm;
    width: 100%;
  }

  /* =============================================
     CONTACT ET INFORMATIONS
     ============================================= */

  /* Informations de contact */
  .hero__subtitle,
  .lead {
    text-align: center;
  }

  /* Ajout automatique d'informations de contact */
  .hero::after {
    content: "Contact : contact@sre-ingenierie.com";
    display: block;
    font-size: 12pt;
    font-weight: bold;
    text-align: center;
    margin-top: 0.5cm;
    border: 1pt solid #000;
    padding: 0.3cm;
  }

  /* =============================================
     LIENS ET RÉFÉRENCES
     ============================================= */

  /* Affichage des URLs pour les liens importants */
  a[href^="mailto"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }

  a[href^="tel"]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }

  /* Masquer les liens de navigation interne */
  a[href^="#"]::after {
    content: none;
  }

  /* =============================================
     GESTION DES SAUTS DE PAGE
     ============================================= */

  /* Éviter les coupures malheureuses */
  .about__highlight,
  .card--featured,
  .hero,
  .service-card {
    page-break-inside: avoid;
  }

  /* Forcer des sauts de page avant certaines sections */
  .section:first-of-type {
    page-break-before: avoid;
  }

  /* Sauts de page après sections importantes */
  #services {
    page-break-after: page;
  }

  /* =============================================
     OPTIMISATIONS TYPOGRAPHIQUES
     ============================================= */

  /* Césure et justification */
  p, .service-card__description {
    hyphens: auto;
    text-align: justify;
  }

  /* Espacement optimisé */
  .about__text h3 {
    margin-top: 0.8cm;
  }

  /* Mise en relief du contenu important */
  .about__highlight {
    border: 1pt solid #000;
    padding: 0.4cm;
    margin: 0.6cm 0;
    font-style: italic;
    font-weight: bold;
    text-align: center;
  }

  /* =============================================
     FOOTER ET INFORMATIONS LÉGALES
     ============================================= */

  /* Ajout automatique de footer d'impression */
  body::after {
    content: "SRE - Bureau d'étude technique spécialisé | Imprimé le " counter(page);
    display: block;
    font-size: 9pt;
    text-align: center;
    margin-top: 2cm;
    padding-top: 0.5cm;
    border-top: 1pt solid #ccc;
    color: #666;
  }

  /* Numérotation des pages */
  @page {
    @bottom-right {
      content: "Page " counter(page);
      font-size: 9pt;
      color: #666;
    }
  }

  /* =============================================
     CORRECTIONS SPÉCIFIQUES
     ============================================= */

  /* Masquer les éléments avec styles inline problématiques */
  [style*="background:"],
  [style*="background-color:"] {
    background: transparent !important;
  }

  /* Corrections pour les icônes emoji */
  [style*="font-size: 1.5rem"] {
    font-size: 14pt !important;
  }

  /* Centrage des éléments importants */
  .text-center {
    text-align: center;
  }

  /* Espacement cohérent */
  .card {
    margin-bottom: 0.8cm;
  }

  /* =============================================
     RESPONSIVE PRINT (format mobile)
     ============================================= */

  @media print and (max-width: 8.5in) {
    body {
      font-size: 11pt;
    }
    
    .hero__title {
      font-size: 20pt;
    }
    
    h2 {
      font-size: 16pt;
    }
    
    .container {
      padding: 0;
    }
  }
}