/**
 * Print Stylesheet
 * Academic Legal Website
 * 
 * Optimizes article pages for printing and PDF generation.
 * Designed for academic readers who need clean, readable printouts.
 * 
 * @package AcademicLegalWebsite
 * @version 1.0
 */

@media print {
    
    /* ========================================================================
       RESET & BASE STYLES
       ======================================================================== */
    
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-family: "Times New Roman", Times, Georgia, serif;
        font-size: 12pt;
        line-height: 1.5;
        margin: 0;
        padding: 0;
    }
    
    /* ========================================================================
       HIDE NON-ESSENTIAL ELEMENTS
       ======================================================================== */
    
    /* Navigation & UI */
    .site-header,
    .site-nav,
    .mobile-nav,
    .mobile-nav-toggle,
    .skip-link,
    .breadcrumb,
    .theme-toggle,
    .back-to-top,
    footer.site-footer,
    .footer-content,
    .footer-bottom {
        display: none !important;
    }
    
    /* Interactive elements */
    .share-links,
    .share-buttons,
    .newsletter-inline-box,
    .newsletter-popup,
    .newsletter-form,
    .article-nav,
    .related-articles,
    .article-actions,
    .btn,
    button,
    .citation-export-links,
    .citation-export-btn {
        display: none !important;
    }
    
    /* Sidebar & decorative */
    .sidebar,
    .aside,
    .advertisement,
    .social-links,
    .category-icon svg,
    .article-meta-item svg {
        display: none !important;
    }
    
    /* ========================================================================
       PAGE SETUP
       ======================================================================== */
    
    @page {
        size: A4;
        margin: 2cm 2.5cm;
    }
    
    @page :first {
        margin-top: 3cm;
    }
    
    /* ========================================================================
       ARTICLE CONTAINER
       ======================================================================== */
    
    .article-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* ========================================================================
       ARTICLE HEADER
       ======================================================================== */
    
    .article-header {
        margin-bottom: 1.5cm;
        padding-bottom: 0.5cm;
        border-bottom: 1pt solid #000;
    }
    
    .article-category {
        margin-bottom: 0.3cm;
    }
    
    .category-badge {
        font-size: 10pt;
        font-weight: normal;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-decoration: none;
        color: #000 !important;
    }
    
    .article-title {
        font-size: 18pt;
        font-weight: bold;
        line-height: 1.2;
        margin: 0.5cm 0;
        text-align: left;
    }
    
    .article-meta {
        font-size: 10pt;
        color: #333 !important;
        margin-top: 0.3cm;
    }
    
    .article-meta-item {
        display: inline;
        margin-right: 1em;
    }
    
    .article-meta-item::after {
        content: " · ";
        margin-left: 1em;
    }
    
    .article-meta-item:last-child::after {
        content: "";
    }
    
    /* ========================================================================
       ABSTRACT
       ======================================================================== */
    
    .article-abstract {
        font-size: 11pt;
        font-style: italic;
        margin: 1cm 0;
        padding: 0.5cm;
        border-left: 3pt solid #666;
        background: none !important;
    }
    
    .article-abstract strong {
        font-style: normal;
    }
    
    /* ========================================================================
       ARTICLE CONTENT
       ======================================================================== */
    
    .article-content {
        font-size: 12pt;
        line-height: 1.6;
        text-align: justify;
        hyphens: auto;
    }
    
    .article-content h2 {
        font-size: 14pt;
        font-weight: bold;
        margin-top: 1cm;
        margin-bottom: 0.5cm;
        page-break-after: avoid;
    }
    
    .article-content h3 {
        font-size: 12pt;
        font-weight: bold;
        margin-top: 0.8cm;
        margin-bottom: 0.3cm;
        page-break-after: avoid;
    }
    
    .article-content h4 {
        font-size: 12pt;
        font-weight: bold;
        font-style: italic;
        margin-top: 0.5cm;
        margin-bottom: 0.3cm;
        page-break-after: avoid;
    }
    
    .article-content p {
        margin: 0 0 0.5cm 0;
        orphans: 3;
        widows: 3;
    }
    
    .article-content ul,
    .article-content ol {
        margin: 0.5cm 0;
        padding-left: 1cm;
    }
    
    .article-content li {
        margin-bottom: 0.2cm;
    }
    
    .article-content blockquote {
        margin: 0.5cm 1cm;
        padding-left: 0.5cm;
        border-left: 2pt solid #666;
        font-style: italic;
    }
    
    /* ========================================================================
       LINKS
       ======================================================================== */
    
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    
    /* Show URL after external links in article content */
    .article-content a[href^="http"]:after {
        content: " [" attr(href) "]";
        font-size: 9pt;
        color: #666 !important;
        word-break: break-all;
    }
    
    /* Don't show URL for internal links */
    .article-content a[href^="/"]:after,
    .article-content a[href^="#"]:after {
        content: "";
    }
    
    /* ========================================================================
       CODE BLOCKS
       ======================================================================== */
    
    pre,
    code {
        font-family: "Courier New", Courier, monospace;
        font-size: 10pt;
    }
    
    pre {
        background: #f5f5f5 !important;
        border: 1pt solid #ccc;
        padding: 0.3cm;
        overflow-x: auto;
        page-break-inside: avoid;
    }
    
    code {
        background: #f5f5f5 !important;
        padding: 0 0.1cm;
    }
    
    /* ========================================================================
       TABLES
       ======================================================================== */
    
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 0.5cm 0;
        font-size: 10pt;
        page-break-inside: avoid;
    }
    
    th,
    td {
        border: 1pt solid #000;
        padding: 0.2cm;
        text-align: left;
    }
    
    th {
        font-weight: bold;
        background: #f0f0f0 !important;
    }
    
    /* ========================================================================
       IMAGES & FIGURES
       ======================================================================== */
    
    img {
        max-width: 100% !important;
        height: auto;
        page-break-inside: avoid;
    }
    
    figure {
        margin: 0.5cm 0;
        page-break-inside: avoid;
    }
    
    figcaption {
        font-size: 10pt;
        font-style: italic;
        text-align: center;
        margin-top: 0.2cm;
    }
    
    /* ========================================================================
       CITATION BOX (Print Version)
       ======================================================================== */
    
    .citation-box {
        margin-top: 1cm;
        padding: 0.5cm;
        border: 1pt solid #000;
        page-break-inside: avoid;
    }
    
    .citation-header {
        border-bottom: none !important;
        padding-bottom: 0 !important;
        margin-bottom: 0.3cm !important;
    }
    
    .citation-title {
        font-size: 11pt;
        font-weight: bold;
    }
    
    .citation-content {
        font-size: 10pt;
    }
    
    .citation-text {
        font-family: "Courier New", Courier, monospace;
        font-size: 9pt;
        margin-bottom: 0.3cm;
    }
    
    .citation-text.citation-alt {
        border-top: none !important;
        padding-top: 0.3cm !important;
    }
    
    .citation-formats {
        display: none !important;
    }
    
    /* ========================================================================
       AUTHOR BIO (Simplified for Print)
       ======================================================================== */
    
    .author-bio {
        margin-top: 1cm;
        padding-top: 0.5cm;
        border-top: 1pt solid #000;
        page-break-inside: avoid;
    }
    
    .author-photo-placeholder {
        display: none !important;
    }
    
    .author-info {
        width: 100%;
    }
    
    .author-label {
        font-size: 9pt;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .author-name {
        font-size: 12pt;
        font-weight: bold;
        margin: 0.2cm 0;
    }
    
    .author-credentials {
        font-size: 10pt;
        font-style: italic;
    }
    
    .author-bio-text {
        font-size: 10pt;
        margin-top: 0.3cm;
    }
    
    .author-link {
        display: none !important;
    }
    
    /* ========================================================================
       PAGE BREAKS
       ======================================================================== */
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .article-header,
    .article-abstract,
    .citation-box,
    .author-bio {
        page-break-inside: avoid;
    }
    
    /* ========================================================================
       PRINT HEADER/FOOTER (via @page)
       ======================================================================== */
    
    /* Note: CSS @page headers/footers have limited browser support.
       For full control, consider server-side PDF generation. */
    
    /* ========================================================================
       PRINT-SPECIFIC CONTENT
       ======================================================================== */
    
    /* Show print-only elements */
    .print-only {
        display: block !important;
    }
    
    /* Hide screen-only elements */
    .screen-only {
        display: none !important;
    }
    
    /* Print URL at bottom of article */
    .article-container::after {
        content: "Retrieved from: " attr(data-url);
        display: block;
        margin-top: 1cm;
        padding-top: 0.5cm;
        border-top: 1pt solid #ccc;
        font-size: 9pt;
        color: #666 !important;
    }
}

/* ============================================================================
   PRINT BUTTON STYLES (Screen Only)
   ============================================================================ */

@media screen {
    .print-only {
        display: none !important;
    }
    
    .print-article-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        font-weight: 500;
        color: var(--text-medium);
        background: var(--white);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        cursor: pointer;
        transition: all var(--transition-fast);
    }
    
    .print-article-btn:hover {
        color: var(--primary);
        border-color: var(--primary);
    }
    
    .print-article-btn svg {
        width: 1rem;
        height: 1rem;
    }
}
