/* ============================================ */
/* SHARED PRINT STYLES - Academic PDF Format   */
/* STANDARDIZED FOR LIST & VIEW PAGES          */
/* ============================================ */

@media print {

  /* ---------------------------------------------------- */
  /* 1. GLOBAL RESETS & PAGE SETUP                        */
  /* ---------------------------------------------------- */
  @page {
    margin: 0.85in;
    margin-bottom: 1in;
    /* Increased space to prevent footer overlap */
    size: letter;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
    position: relative !important;
  }

  /* Watermark */
  body::before {
    content: "Immensa Gratia";
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 6rem;
    font-weight: bold;
    color: rgba(0, 0, 0, 0.04) !important;
    /* Very subtle gray */
    z-index: -1;
    white-space: nowrap;
    pointer-events: none;
    display: block !important;
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide UI elements */
  nav,
  header.header,
  footer,
  aside.sidebar,
  .mobile-controls-wrapper,
  .mobile-nav-overlay,
  .mobile-nav-drawer,
  .search-box,
  .argument-actions,
  .action-btn,
  button,
  .newsletter-section,
  .argument-tags,
  .argument-footer,
  .article-footer,
  .nav-back-container,
  .back-link,
  .language-selector,
  .theme-switch,
  .loading-state,
  #pdf-download-btn,
  .pdf-download-container,
  .pagination,
  .sidebar-mobile-header,
  .header-title-section,
  .argument-id-view,
  .footer {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* ---------------------------------------------------- */
  /* 2. LAYOUT CONTAINERS                                 */
  /* ---------------------------------------------------- */
  /* Reset container widths */
  .arguments-container,
  .argument-full-view,
  .container,
  .arguments-layout,
  .arguments-grid,
  .argument-card,
  .argument-article {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    grid-template-columns: none !important;
    page-break-inside: avoid;
  }

  /* Ensure content is visible */
  .argument-card.collapsed .argument-body {
    display: block !important;
    max-height: none !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* ---------------------------------------------------- */
  /* 3. HEADER SECTION (Top Row, Title, Author)           */
  /* ---------------------------------------------------- */
  /* Common Header Container */
  .argument-header,
  .article-header {
    display: block !important;
    text-align: left !important;
    border-bottom: none !important;
    /* Move border to Meta Row if preferred, or plain */
    margin-bottom: 1.5em !important;
    padding: 0 !important;
  }

  /* Force hide any arrows or pseudo-elements */
  .argument-header::after,
  .article-header::after,
  .argument-header::before,
  .article-header::before {
    content: none !important;
    display: none !important;
  }

  /* A. META ROW (Top): #001 [Category] Date */
  /* Target List (.argument-meta) and View (.print-header-row) */
  .argument-meta,
  .print-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    /* Left Align */
    gap: 12pt !important;
    border-bottom: 2pt solid #000 !important;
    padding-bottom: 8pt !important;
    margin-bottom: 12pt !important;
    visibility: visible !important;
    /* Ensure hidden DOM is visible */
  }

  /* Hide the Screen-View Category Badge inside header (it's legally .category-badge, so we strictly target the one NOT in meta row) */
  .article-header>.category-badge {
    display: none !important;
  }

  /* ID Styling */
  .argument-id {
    display: inline-block !important;
    font-weight: bold !important;
    font-size: 10pt !important;
    color: #000 !important;
    min-width: 40pt !important;
  }

  /* Badge Styling */
  .category-badge,
  .print-header-row .category-badge {
    display: inline-block !important;
    background-color: #000 !important;
    color: #fff !important;
    padding: 2pt 8pt !important;
    font-size: 9pt !important;
    font-weight: bold !important;
    text-transform: capitalize !important;
    border-radius: 0 !important;
    border: 1px solid #000 !important;
  }

  /* Date Styling */
  /* In List View: .argument-date. In View Page: .print-header-row .date */
  .argument-date,
  .print-header-row .date {
    display: inline-block !important;
    font-size: 10pt !important;
    font-style: italic !important;
    color: #444 !important;
    margin-left: 0 !important;
  }

  /* Remove Date from Bottom Meta in View Page (since it moved up) */
  .article-meta .date {
    display: none !important;
  }

  /* B. TITLE */
  .argument-title,
  .article-title {
    order: 2 !important;
    /* Just in case */
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 20pt !important;
    font-weight: bold !important;
    color: #000 !important;
    margin: 0 0 0.25em 0 !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  /* C. AUTHOR */
  /* List View style */
  .argument-author,
  .article-meta {
    order: 3 !important;
    display: block !important;
    font-size: 11pt !important;
    font-style: italic !important;
    margin-bottom: 1em !important;
    color: #333 !important;
    text-align: left !important;
  }

  /* ---------------------------------------------------- */
  /* 4. THESIS / CLAIM SECTION                            */
  /* ---------------------------------------------------- */
  /* User wants nicely presented thesis. Clean, Academic. */

  .argument-claim,
  section.argument-claim {
    display: block !important;
    margin: 1em 0 1.5em 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
    text-align: justify !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    text-indent: 0 !important;
  }

  /* "Thesis:" Label */
  /* View Page H2 */
  .argument-claim h2 {
    display: inline !important;
    /* Run-in heading */
    font-size: 11pt !important;
    font-weight: bold !important;
    text-transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    color: #000 !important;
  }

  .argument-claim h2::after {
    content: ": ";
  }

  /* List View Strong */
  .argument-claim strong {
    display: inline !important;
    font-size: 11pt !important;
    font-weight: bold !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* The Text Itself */
  .argument-claim p {
    display: inline !important;
    /* inline with the label */
    font-size: 11pt !important;
    font-style: italic !important;
    color: #000 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    margin-left: 0 !important;
  }



  /* ---------------------------------------------------- */
  /* 5. BODY CONTENT                                      */
  /* ---------------------------------------------------- */
  .argument-body,
  .article-body {
    display: block !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
    text-align: justify !important;
    margin-top: 1em !important;
    padding: 0 !important;
    /* FIXED: Kill inherited padding */
    margin-left: 0 !important;
    border: none !important;
  }

  /* Ensure container borders are killed */
  .argument-card,
  .argument-article {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .argument-text p,
  .article-body p {
    margin-bottom: 1em !important;
    text-indent: 0 !important;
    /* Fixed: No initial space */
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  /* Remove top margin from first paragraph for clean look */
  .argument-text p:first-child,
  .article-body p:first-child {
    margin-top: 0 !important;
  }

  /* ---------------------------------------------------- */
  /* 6. EXHORTATION / FINAL THOUGHT                       */
  /* ---------------------------------------------------- */
  .exhortation {
    margin-top: 2em !important;
    background: #f8f9fa !important;
    /* Light gray box */
    padding: 15px !important;
    border-radius: 8px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    border: none !important;
    /* Ensure no border based on user preference from previous task */
  }

  .exhortation-title,
  .exhortation h2 {
    font-size: 11pt !important;
    font-weight: bold !important;
    text-transform: none !important;
    border-bottom: 2px solid #ddd !important;
    padding-bottom: 5px !important;
    margin-bottom: 10px !important;
    width: 100% !important;
    display: block !important;
  }

  /* ---------------------------------------------------- */
  /* 8. BRANDING & FOOTER                                 */
  /* ---------------------------------------------------- */
  /* Repeating Footer on Every Page */
  .print-footer {
    display: none !important;
  }

  /* Kill previous pseudo-element branding */
  .argument-article::after,
  .argument-card::after {
    content: none !important;
    display: none !important;
  }

  /* Kill other potential stray pseudoelements/borders */
  html,
  body {
    border: none !important;
    margin: 0 !important;
    /* maintain page margin in @page, avoiding body margin duplicating it */
    padding: 0 !important;
  }

  /* Kill pseudo-elements on internal parts that might cause lines */
  .argument-body::after,
  .argument-body::before,
  .exhortation::after,
  .exhortation::before,
  .argument-footer::after,
  .argument-footer::before {
    content: none !important;
    display: none !important;
    border: none !important;
  }

  /* Explicitly kill borders on specific footer/end elements */
  .argument-footer,
  .exhortation {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
  }

  /* ---------------------------------------------------- */
  /* 9. GENERAL TYPOGRAPHY TOOLS                          */
  /* ---------------------------------------------------- */
  b,
  strong {
    font-weight: bold !important;
  }

  i,
  em {
    font-style: italic !important;
  }

  a {
    text-decoration: none !important;
    color: #000 !important;
    border-bottom: none !important;
  }

}