/* print.css — Pro Se Federal Court Companion — print-optimized layout */
@media print {
  * { box-sizing: border-box; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11pt;
    line-height: 1.6;
  }

  /* ── Hide all UI chrome ───────────────────────────────── */
  .app-header,
  .bottom-nav,
  .toast-container,
  .skip-link,
  .no-print,
  .btn,
  button,
  input[type="text"],
  input[type="search"],
  input[type="date"],
  select,
  textarea,
  .search-box-wrap,
  .rules-filters,
  .filter-chip,
  .wt-progress-bar,
  .wt-actions,
  .step-check,
  .r11-checklist,
  .template-btn,
  #btn-copy-template,
  #btn-print-template,
  #btn-tmpl-back,
  #btn-wt-back,
  .motion-card-wrapper > button:last-child,
  .objection-chevron,
  [id^="btn-"] { display: none !important; }

  /* ── Page layout ──────────────────────────────────────── */
  @page {
    margin: 0.9in 0.75in 0.75in 0.75in;
    @bottom-center {
      content: "Pro Se Court Companion — Page " counter(page) " of " counter(pages);
      font-size: 9pt;
      color: #888;
    }
  }

  .main-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* ── Headings ─────────────────────────────────────────── */
  .section-title, h1, h2, h3, h4 {
    page-break-after: avoid;
    font-family: Georgia, serif;
    color: #000;
  }

  .section-title {
    font-size: 10pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #999;
    padding-bottom: 0.2rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  /* ── Motion Template ──────────────────────────────────── */
  .template-preview {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .template-pre {
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 10pt !important;
    line-height: 1.8 !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    color: #000 !important;
    page-break-inside: auto;
  }

  .wt-header {
    page-break-inside: avoid;
    margin-bottom: 1rem;
    border-bottom: 2px solid #000;
    padding-bottom: 0.5rem;
  }

  .wt-title {
    font-size: 14pt;
    font-weight: bold;
    font-family: Georgia, serif;
    margin-bottom: 0.25rem;
  }

  .wt-desc {
    font-size: 10pt;
    color: #555;
    font-style: italic;
  }

  /* ── Walkthrough Steps ────────────────────────────────── */
  #steps-list { margin-top: 0.75rem; }

  .step-item {
    display: block !important;
    border: none !important;
    border-bottom: 1px dotted #ccc !important;
    padding: 0.5rem 0 !important;
    background: transparent !important;
    page-break-inside: avoid;
  }

  .step-item.done .step-title { text-decoration: line-through; color: #888; }

  .step-num {
    font-size: 9pt;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .step-title {
    font-size: 11pt;
    font-weight: bold;
    margin: 0.15rem 0;
  }

  .step-detail {
    font-size: 10pt;
    color: #222;
    line-height: 1.6;
  }

  .step-rule {
    font-size: 9pt;
    color: #555;
    font-style: italic;
    display: block;
    margin-top: 0.2rem;
  }

  /* ── Checklist print layout ───────────────────────────── */
  .checklist-print-header {
    border-bottom: 2px solid #000;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    page-break-after: avoid;
  }
  .checklist-print-header h2 {
    margin: 0;
    font-size: 14pt;
  }
  .checklist-print-header .print-case-info {
    font-size: 10pt;
    color: #333;
  }
  .checklist-category {
    page-break-inside: avoid;
    margin-top: 1rem;
  }
  .checklist-category-title {
    font-size: 11pt;
    font-weight: bold;
    border-bottom: 1px solid #666;
    margin-bottom: 0.4rem;
    padding-bottom: 0.2rem;
  }
  .checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.25rem 0;
    page-break-inside: avoid;
  }
  .checklist-checkbox-print {
    width: 14px;
    height: 14px;
    border: 1.5px solid #000;
    flex-shrink: 0;
    margin-top: 2px;
    display: inline-block;
  }
  .checklist-item-text { font-size: 10.5pt; }
  .checklist-item-detail {
    font-size: 9pt;
    color: #555;
    margin-top: 2px;
    font-style: italic;
  }
  .checklist-item-done .checklist-item-text {
    text-decoration: line-through;
    color: #888;
  }
  .checklist-item-done .checklist-checkbox-print::after {
    content: '✓';
    font-size: 12px;
    line-height: 12px;
    display: block;
    text-align: center;
  }

  /* ── Deadline tracker print ───────────────────────────── */
  .deadline-row {
    display: flex;
    gap: 1rem;
    padding: 0.3rem 0;
    border-bottom: 1px dotted #ccc;
    page-break-inside: avoid;
  }
  .deadline-date-col { width: 6rem; flex-shrink: 0; font-weight: bold; }
  .deadline-type-col { width: 7rem; flex-shrink: 0; color: #555; }
  .deadline-title-col { flex: 1; }

  /* ── Rules & Glossary print ───────────────────────────── */
  .rule-card, .glossary-item {
    border: none !important;
    border-bottom: 1px dotted #ccc !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.4rem 0 !important;
    page-break-inside: avoid;
  }

  .rule-num {
    font-size: 9pt;
    font-weight: bold;
    color: #000;
    background: transparent !important;
    border: none !important;
  }

  .rule-title, .glossary-term { font-weight: bold; }
  .rule-plain, .glossary-def { font-size: 10pt; color: #222; }

  /* ── Objections reference ────────────────────────────── */
  .objection-item {
    page-break-inside: avoid;
    border-bottom: 1px dotted #ccc !important;
    background: transparent !important;
    padding: 0.5rem 0 !important;
  }

  .objection-summary, .objection-content {
    display: block !important; /* force open for print */
  }

  /* ── Motion status board print ────────────────────────── */
  .motion-status-item {
    border: 1px solid #ccc !important;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    background: transparent !important;
    page-break-inside: avoid;
  }

  /* ── Print footer ─────────────────────────────────────── */
  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #aaa;
    border-top: 1px solid #ddd;
    padding-top: 4pt;
  }

  /* ── Badges / labels ──────────────────────────────────── */
  .badge {
    border: 1px solid #999 !important;
    background: transparent !important;
    color: #000 !important;
    font-size: 8pt !important;
    padding: 0 0.25rem !important;
  }

  /* Show href for external links; suppress hash links ──── */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  a[href^="#"]::after,
  a[href^="javascript"]::after { content: ""; }

  /* ── Disclaimer at bottom of any print ───────────────── */
  .main-content::after {
    content: "LEGAL DISCLAIMER: This app provides general legal information only — not legal advice. Always verify rules at uscourts.gov and consult a licensed attorney for advice specific to your situation.";
    display: block;
    margin-top: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid #ccc;
    font-size: 8pt;
    color: #888;
    font-style: italic;
  }
}
