/* ==========================================================================
   PrepVault — print.css
   Print stylesheet: clean paper rendering for emergency binder documents
   ========================================================================== */

@media print {

  /* ------------------------------------------------------------------------
     PAGE SETUP
     ------------------------------------------------------------------------ */
  @page {
    margin: 1in 0.75in;
    size: letter;
  }

  @page :first {
    margin-top: 0.5in;
  }


  /* ------------------------------------------------------------------------
     HIDE ON PRINT
     ------------------------------------------------------------------------ */
  .site-header,
  .site-footer,
  .ad-slot,
  .category-tabs,
  .search-wrap,
  .selection-toolbar,
  .offline-banner,
  .toast-container,
  .modal-overlay,
  .icon-btn,
  .btn--secondary,
  .btn--ghost,
  .sidebar,
  [data-no-print],
  nav,
  .header-nav,
  .skip-link,
  .loading-spinner,
  .skeleton,
  .promo-card::before,
  .promo-card::after {
    display: none !important;
  }


  /* ------------------------------------------------------------------------
     PRINT BASE STYLES
     ------------------------------------------------------------------------ */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  html {
    font-size: 11pt;
  }

  body {
    background: white !important;
    color: black !important;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: 11pt;
    line-height: 1.5;
    min-height: unset;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: black !important;
    font-family: Arial, Helvetica, sans-serif !important;
    page-break-after: avoid;
    break-after: avoid;
    margin-top: 1.2em;
    margin-bottom: 0.4em;
  }

  h1 { font-size: 22pt; }
  h2 { font-size: 17pt; }
  h3 { font-size: 14pt; }
  h4 { font-size: 12pt; }
  h5 { font-size: 11pt; }
  h6 { font-size: 10pt; }

  p {
    orphans: 3;
    widows: 3;
    margin-bottom: 0.5em;
    max-width: none;
  }

  /* Links — black, no decoration; show URL after link text */
  a,
  a:visited {
    color: black !important;
    text-decoration: none !important;
  }

  /* Show full URLs after links (except anchors and mailto placeholders) */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #444 !important;
    font-family: Arial, Helvetica, sans-serif;
    font-style: italic;
    word-break: break-all;
  }

  /* Suppress anchors, mailto, tel, javascript, and data URIs */
  a[href^="#"]::after,
  a[href^="javascript:"]::after,
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after,
  a[href^="data:"]::after {
    content: "" !important;
  }

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

  /* Code */
  pre,
  code,
  kbd,
  samp {
    font-family: 'Courier New', Courier, monospace;
    font-size: 9pt;
    border: 1px solid #ccc;
    background: #f5f5f5 !important;
    color: black !important;
    padding: 0.1em 0.3em;
    border-radius: 0;
  }

  pre {
    padding: 0.5em;
    white-space: pre-wrap;
    word-break: break-all;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  pre code {
    border: none;
    background: transparent !important;
    padding: 0;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
  }

  th,
  td {
    border: 1px solid #999;
    padding: 4pt 6pt;
    font-size: 9pt;
    text-align: left;
  }

  th {
    font-weight: bold;
    background: #e8e8e8 !important;
  }

  tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tfoot {
    display: table-footer-group;
  }

  /* Blockquotes */
  blockquote {
    border-left: 3pt solid #999;
    margin-left: 0;
    padding-left: 1em;
    color: #333 !important;
    font-style: italic;
  }

  /* Horizontal rules */
  hr {
    border: none;
    border-top: 1pt solid #999;
    margin: 1em 0;
  }


  /* ------------------------------------------------------------------------
     CONTAINER — FULL WIDTH IN PRINT
     ------------------------------------------------------------------------ */
  .container,
  .container--narrow {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .layout-with-sidebar {
    display: block !important;
    max-width: 100% !important;
  }


  /* ------------------------------------------------------------------------
     PRINT-SPECIFIC VISIBILITY
     ------------------------------------------------------------------------ */

  /* Elements hidden on screen but shown in print */
  .print-only {
    display: block !important;
  }

  .print-only--inline {
    display: inline !important;
  }

  .print-only--flex {
    display: flex !important;
  }


  /* ------------------------------------------------------------------------
     FILE CARDS
     ------------------------------------------------------------------------ */
  .file-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    background: white !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
  }

  .file-card__checkbox {
    display: none !important;
  }

  .file-card__actions {
    display: none !important;
  }

  .file-card__name {
    -webkit-line-clamp: unset;
    display: block !important;
    font-weight: bold;
    color: black !important;
    font-size: 10pt;
  }

  .file-card__meta {
    font-size: 8pt;
    color: #555 !important;
    font-family: 'Courier New', Courier, monospace;
    display: block !important;
  }

  .file-card__type-icon {
    display: none !important;
  }


  /* ------------------------------------------------------------------------
     CARDS
     ------------------------------------------------------------------------ */
  .card,
  .stat-card,
  .promo-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    background: white !important;
    border-radius: 0 !important;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem;
  }

  .card__title,
  .stat-card__number,
  .promo-card__title {
    color: black !important;
    font-family: Arial, Helvetica, sans-serif !important;
  }

  .card__footer,
  .card__header {
    border-color: #ccc !important;
  }


  /* ------------------------------------------------------------------------
     BUTTONS — keep primary/danger for reference; hide secondary/ghost
     ------------------------------------------------------------------------ */
  .btn {
    border: 1pt solid #999 !important;
    background: white !important;
    color: black !important;
    padding: 3pt 8pt;
    font-size: 9pt;
    border-radius: 0 !important;
  }

  .btn--primary {
    border-color: black !important;
    font-weight: bold;
  }

  .btn--danger {
    border-color: #c00 !important;
    color: #c00 !important;
  }

  /* These are already hidden via the hide list above */
  .btn--secondary,
  .btn--ghost {
    display: none !important;
  }


  /* ------------------------------------------------------------------------
     FORMS (read-only print representation)
     ------------------------------------------------------------------------ */
  .form-input,
  .form-select,
  .form-textarea {
    border: 1pt solid #999 !important;
    background: white !important;
    color: black !important;
    border-radius: 0 !important;
  }

  .form-label {
    font-weight: bold;
    color: black !important;
    font-family: Arial, Helvetica, sans-serif;
  }


  /* ------------------------------------------------------------------------
     PROGRESS BARS
     ------------------------------------------------------------------------ */
  .progress {
    border: 1pt solid #999 !important;
    background: white !important;
    height: 6pt !important;
  }

  .progress__bar {
    background: #555 !important;
    print-color-adjust: exact;
  }


  /* ------------------------------------------------------------------------
     BADGES & TAGS
     ------------------------------------------------------------------------ */
  .category-tag {
    border: 1pt solid #999 !important;
    background: white !important;
    color: black !important;
    padding: 1pt 5pt;
    border-radius: 0 !important;
    font-size: 8pt;
  }

  .version-badge {
    border: 1pt solid #999 !important;
    background: white !important;
    color: black !important;
    font-size: 7pt;
    border-radius: 0 !important;
  }


  /* ------------------------------------------------------------------------
     TOAST & EMPTY STATE (visibility)
     ------------------------------------------------------------------------ */
  .toast-container,
  .toast {
    display: none !important;
  }

  .empty-state {
    padding: 1rem 0 !important;
    text-align: left !important;
  }


  /* ------------------------------------------------------------------------
     PRINT HEADER (PrepVault branding replacement)
     ------------------------------------------------------------------------ */

  /* The .print-header element should be in the HTML (hidden on screen).
     It replaces the visual site header for print output. */
  .print-header {
    display: block !important;
    text-align: center;
    border-bottom: 2pt solid black;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    page-break-after: avoid;
    break-after: avoid;
  }

  .print-header__logo {
    font-size: 24pt;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    color: black !important;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.15rem;
  }

  .print-header__tagline {
    font-size: 9pt;
    color: #666 !important;
    font-family: Arial, Helvetica, sans-serif;
    font-style: italic;
    display: block;
  }

  .print-header__date {
    font-size: 8pt;
    color: #999 !important;
    font-family: Arial, Helvetica, sans-serif;
    margin-top: 0.25rem;
    display: block;
  }


  /* ------------------------------------------------------------------------
     SECTION HEADERS
     ------------------------------------------------------------------------ */
  .section-header {
    border-bottom: 1pt solid #ccc;
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
    display: block !important;
  }

  .section-title {
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 14pt;
    color: black !important;
    font-weight: bold;
  }

  .section-count {
    font-size: 8pt;
    color: #555 !important;
    background: #eee !important;
    padding: 1pt 4pt;
    border-radius: 0 !important;
  }


  /* ------------------------------------------------------------------------
     HERO SECTION (simplified for print)
     ------------------------------------------------------------------------ */
  .hero {
    background: none !important;
    border-bottom: 1pt solid #ccc !important;
    padding: 0.5rem 0 0.75rem !important;
  }

  .hero__eyebrow {
    font-size: 8pt;
    color: #555 !important;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }

  .hero__title {
    font-size: 20pt !important;
    color: black !important;
    margin-bottom: 0.25rem;
  }

  .hero__title span {
    color: black !important;
  }

  .hero__subtitle {
    font-size: 10pt;
    color: #333 !important;
    max-width: none;
    margin-bottom: 0.5rem;
  }

  .hero__actions {
    display: none !important;
  }


  /* ------------------------------------------------------------------------
     PAGE BREAK HELPERS
     ------------------------------------------------------------------------ */
  .page-break-before {
    page-break-before: always;
    break-before: page;
  }

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

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

} /* end @media print */
