/* ==========================================================================
   print.css — AwareFlow Static Site
   © 2025 SnapHabit LLC. All rights reserved.
   Purpose: Clean, legible print layout for policy/story pages.
   ========================================================================== */

@page {
  /* Sensible page margins for policies and docs */
  margin: 15mm 12mm;
}

@media print {
  /* Base */
  html {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font: 12pt/1.6 Georgia, serif;
    margin: 0;
  }

  /* Hide chrome / decorative elements */
  header,
  nav,
  footer,
  .logo,
  .subtitle,
  .cta-bar,
  .site-banner,
  .btn,
  .btn-row,
  .skip-link {
    display: none !important;
  }

  /* Content container */
  main,
  .content-container {
    max-width: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
  }

  section.box,
  .box {
    border: none !important;
    margin: 0 0 1.6em !important;
    padding: 0 !important;
    break-inside: avoid; /* keep a box on one page when possible */
  }

  /* Headings & typography */
  h1,
  h2,
  h3 {
    color: #000000 !important;
    page-break-after: avoid;
  }

  h1 + p,
  h2 + p,
  h3 + p {
    page-break-before: avoid;
  }

  p,
  ul,
  ol {
    orphans: 3;
    widows: 3;
  }

  /* Links: show URLs for external links only */
  a[href^="#"]::after,
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
    word-break: break-all;
  }

  /* Images that remain (e.g., inside content) */
  img {
    max-width: 100% !important;
    height: auto !important;
    filter: none !important;
  }

  /* Code & preformatted text */
  pre,
  code,
  kbd,
  samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
    color: #000000 !important;
  }

  pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid #000000;
    padding: 0.6em;
  }

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
  }

  th,
  td {
    border: 1px solid #000000;
    padding: 0.4em 0.6em;
  }

  thead {
    display: table-header-group; /* repeat headers on new pages */
  }

  tr {
    break-inside: avoid;
  }

  /* RTL support */
  html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
  }
}
