/* ============================================
   SECOND OPINION / DR DEW
   Print Stylesheet
   ============================================ */

@media print {
  /* Reset colors for print */
  :root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --accent: #8b6914;
    --border: #cccccc;
  }

  /* Base settings */
  * {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    margin: 0;
    padding: 0;
  }

  /* Remove grid texture */
  body::before {
    display: none;
  }

  /* Page setup */
  @page {
    margin: 2cm;
    size: letter;
  }

  /* Hide navigation and non-essential elements */
  .skip-link,
  .site-header,
  .site-nav,
  .menu-toggle,
  .header-disclaimer,
  .site-footer,
  .site-seal,
  .btn,
  .btn-group,
  .topic-chips,
  .subscribe-options,
  nav,
  .nav-list,
  .footer-nav {
    display: none !important;
  }

  /* Links */
  a {
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    font-weight: normal;
  }

  a[href^="#"]:after,
  a[href^="javascript"]:after {
    content: "";
  }

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

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

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

  h4, h5, h6 {
    font-size: 12pt;
    page-break-after: avoid;
  }

  p, li, td {
    orphans: 3;
    widows: 3;
  }

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

  /* Cards and sections */
  .card,
  .featured-episode,
  .claim-check,
  .tldw,
  .transcript {
    border: 1px solid #ccc !important;
    padding: 12pt !important;
    margin-bottom: 12pt !important;
    page-break-inside: avoid;
  }

  .card--featured {
    border-left: 3px solid #8b6914 !important;
  }

  /* Episode header */
  .episode-header {
    border-bottom: 1px solid #ccc !important;
    padding-bottom: 12pt !important;
    margin-bottom: 24pt !important;
  }

  /* Tags */
  .tag {
    border: 1px solid #ccc !important;
    padding: 2pt 6pt !important;
  }

  /* Sources */
  .sources-list li {
    border-bottom: 1px solid #eee !important;
    padding: 6pt 0 !important;
  }

  /* Claims & checks */
  .claim-check__row {
    display: block !important;
  }

  .claim-check__label {
    font-weight: bold !important;
  }

  /* Confidence badges */
  .confidence {
    border: 1px solid currentColor !important;
  }

  /* Transcript specific */
  .transcript {
    font-size: 11pt;
    line-height: 1.6;
  }

  .transcript .timestamp {
    font-size: 9pt;
  }

  /* Glossary */
  .glossary-entry {
    page-break-inside: avoid;
    border-bottom: 1px solid #eee !important;
    padding: 12pt 0 !important;
  }

  /* Page breaks */
  .episode-section {
    page-break-inside: avoid;
  }

  .section {
    page-break-before: auto;
  }

  /* Print header */
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 24pt;
    padding-bottom: 12pt;
    border-bottom: 2px solid #000;
  }

  .print-header__title {
    font-size: 14pt;
    font-weight: bold;
    letter-spacing: 0.1em;
  }

  .print-header__url {
    font-size: 10pt;
    color: #666 !important;
  }

  /* Print footer */
  .print-footer {
    display: block !important;
    text-align: center;
    margin-top: 24pt;
    padding-top: 12pt;
    border-top: 1px solid #ccc;
    font-size: 9pt;
    color: #666 !important;
  }

  /* Hide elements not meant for print */
  .no-print {
    display: none !important;
  }

  /* Force page break */
  .page-break {
    page-break-before: always;
  }

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

  /* Prose/article content */
  .prose {
    max-width: 100% !important;
  }

  .prose ul,
  .prose ol {
    padding-left: 24pt;
  }

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

  th, td {
    border: 1px solid #ccc !important;
    padding: 6pt !important;
    text-align: left;
  }

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

  /* Code blocks */
  code {
    font-family: "Courier New", monospace !important;
    font-size: 10pt;
    background: #f5f5f5 !important;
    padding: 2pt 4pt !important;
  }

  pre {
    border: 1px solid #ccc !important;
    padding: 12pt !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    page-break-inside: avoid;
  }

  /* Blockquotes */
  blockquote {
    border-left: 3px solid #8b6914 !important;
    padding-left: 12pt !important;
    margin: 12pt 0 !important;
    font-style: italic;
  }
}
