/**
 * Integrity Cleaning - Print Styles
 * Optimized layout for printing
 * @version 2026.02.19
 */

@media print {
  /* Reset for print */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Ensure links are visible */
  a,
  a:visited {
    text-decoration: underline;
  }

  /* Show URLs after links */
  a[href^="http"]::after,
  a[href^="https"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    word-break: break-all;
  }

  /* Skip mailto and tel links */
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after {
    content: "";
  }

  /* Abbreviations */
  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /* Hide non-essential elements */
  .navbar,
  .navbar-toggler,
  .mobile-menu,
  .back-to-top,
  .sticky-call,
  .social-icons,
  .cookie-notice,
  .video-container,
  iframe,
  .btn,
  button,
  form,
  .pagination,
  .faq-toggle,
  .accordion-toggle,
  .scroll-reveal,
  [data-aos] {
    display: none !important;
  }

  /* Show important content */
  .container,
  .container-fluid,
  header,
  main,
  footer,
  .service-card,
  .testimonial-card,
  .contact-info {
    display: block !important;
  }

  /* Page layout */
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: black;
    background: white;
  }

  /* Headings */
  h1 {
    font-size: 24pt;
    page-break-after: avoid;
  }

  h2 {
    font-size: 18pt;
    page-break-after: avoid;
  }

  h3 {
    font-size: 14pt;
    page-break-after: avoid;
  }

  /* Avoid breaks inside these elements */
  p,
  li,
  blockquote,
  .service-card,
  .testimonial-card {
    orphans: 3;
    widows: 3;
    page-break-inside: avoid;
  }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    page-break-inside: avoid;
  }

  th,
  td {
    border: 1px solid black;
    padding: 0.5em;
  }

  /* Remove dark backgrounds */
  .bg-dark,
  .bg-primary,
  footer,
  [class*="gradient"] {
    background: white !important;
    color: black !important;
  }

  /* Footer contact info - show in print */
  footer {
    border-top: 2px solid black;
    padding-top: 1em;
    margin-top: 2em;
  }

  footer p,
  footer a {
    color: black !important;
  }

  /* Service cards - simplify */
  .service-card {
    border: 1px solid #ccc;
    margin-bottom: 1em;
    page-break-inside: avoid;
  }

  /* Testimonials */
  .testimonial-card {
    border: 1px solid #ccc;
    margin-bottom: 1em;
    page-break-inside: avoid;
  }

  /* Contact info - make visible */
  .phone-number,
  .email-address {
    font-size: 14pt;
    font-weight: bold;
  }

  /* Print URL for important links */
  .service-card a[href]::after,
  .testimonial-card a[href]::after {
    content: " → " attr(href);
    font-size: 0.8em;
  }

  /* Page numbers */
  @page {
    margin: 2cm;
  }

  /* First page special handling */
  @page :first {
    margin-top: 1cm;
  }

  /* Avoid widows/orphans at page breaks */
  p {
    orphans: 3;
    widows: 3;
  }

  /* Ensure readability */
  body {
    font-family: 'Times New Roman', Times, serif;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: 'Arial', sans-serif;
    color: black;
  }

  /* Hide elements with print-hide class */
  .print-hide,
  .no-print,
  [data-print-hide] {
    display: none !important;
  }

  /* Show elements with print-show class */
  .print-show,
  [data-print-show] {
    display: block !important;
  }

  /* Print-only content */
  .print-only {
    display: block !important;
  }

  /* Screen-only content - hide */
  .screen-only {
    display: none !important;
  }

  /* Contact section - format for print */
  .contact-section {
    page-break-before: avoid;
    border-top: 2px solid black;
    padding-top: 1em;
  }

  /* Logo - print in black */
  .navbar-brand img,
  .logo img {
    filter: grayscale(100%);
    max-width: 200px;
  }

  /* Remove shadows and filters */
  * {
    filter: none !important;
    box-shadow: none !important;
  }

  /* Ensure background colors are printed (if user enables) */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Print margins */
  @page {
    margin: 1.5cm;
  }

  /* Handle hero section */
  .hero-section,
  .banner-area {
    min-height: auto !important;
    padding: 2em 0 !important;
    page-break-after: avoid;
  }

  /* Call to action - show as text */
  .cta-section,
  .call-to-action {
    border: 2px solid black;
    padding: 1em;
    margin: 2em 0;
    page-break-inside: avoid;
  }

  .cta-section h2,
  .call-to-action h2 {
    font-size: 16pt;
  }

  /* Footer */
  footer {
    page-break-before: avoid;
    border-top: 2px solid black;
    padding-top: 1em;
    margin-top: 2em;
  }

  /* Copyright notice */
  .copyright {
    font-size: 10pt;
    text-align: center;
    margin-top: 2em;
  }
}

/* Print-specific utilities */
@media print {
  .print-page-break-before {
    page-break-before: always;
  }

  .print-page-break-after {
    page-break-after: always;
  }

  .print-page-break-inside-avoid {
    page-break-inside: avoid;
  }

  .print-keep-together {
    page-break-inside: avoid;
  }
}
