@media print {

    /* ===== HIDE NON-ESSENTIAL ELEMENTS ===== */
    header.header,
    .nav-menu,
    .search-container,
    .faq-icon,
    .related-questions,
    .breadcrumbs,
    .print-button,
    footer.footer,
    #no-results-message {
        display: none !important;
    }

    /* ===== PAGE SETUP ===== */
    @page {
        size: A4;
        margin: 2cm 1.5cm;
    }

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

    /* ===== SHOW ALL FAQ ANSWERS ===== */
    .faq-answer {
        display: block !important;
        max-height: none !important;
        margin-top: 0.5rem;
        padding: 0;
    }

    .faq-item {
        page-break-inside: avoid;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid #ddd;
        padding-bottom: 1rem;
    }

    /* ===== TYPOGRAPHY ===== */
    h1 {
        font-size: 24pt;
        margin-bottom: 0.5rem;
        color: #000;
    }

    h2 {
        font-size: 18pt;
        margin-top: 2rem;
        margin-bottom: 1rem;
        border-bottom: 2px solid #000;
        padding-bottom: 0.5rem;
        page-break-after: avoid;
    }

    h3 {
        font-size: 12pt;
        font-weight: bold;
        margin: 0 0 0.5rem 0;
        color: #000;
    }

    h4 {
        font-size: 11pt;
        font-weight: bold;
        margin: 1rem 0 0.5rem 0;
    }

    p {
        margin: 0.5rem 0;
        orphans: 3;
        widows: 3;
    }

    /* ===== CATEGORY SECTIONS ===== */
    .faq-category {
        page-break-before: always;
    }

    .faq-category:first-of-type {
        page-break-before: avoid;
    }

    /* ===== LISTS ===== */
    ul,
    ol {
        margin: 0.5rem 0;
        padding-left: 1.5rem;
    }

    li {
        margin: 0.25rem 0;
    }

    /* ===== LINKS ===== */
    a {
        color: #000;
        text-decoration: underline;
    }

    /* Show URLs for external links */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-style: italic;
    }

    /* Don't show URLs for internal anchors */
    a[href^="#"]:after {
        content: "";
    }

    /* ===== HERO SECTION ===== */
    .hero {
        min-height: auto !important;
        padding: 1rem 0;
        text-align: center;
        border-bottom: 3px solid #000;
        margin-bottom: 2rem;
    }

    .hero-title {
        font-size: 24pt !important;
        margin: 0;
    }

    .hero-subtitle {
        font-size: 12pt;
        margin: 0.5rem 0 0 0;
    }

    /* ===== FAQ QUESTION STYLING ===== */
    .faq-question {
        background: none;
        border: none;
        padding: 0;
        text-align: left;
        cursor: default;
        display: block;
        width: 100%;
    }

    /* ===== ANSWER SECTIONS ===== */
    .answer-summary {
        margin: 0.5rem 0;
        padding: 0.5rem;
        background: #f5f5f5;
        border-left: 3px solid #000;
    }

    .answer-detail {
        margin-top: 0.5rem;
    }

    /* ===== TABLE OF CONTENTS (if added) ===== */
    .print-toc {
        page-break-after: always;
        margin-bottom: 2rem;
    }

    .print-toc h2 {
        margin-top: 0;
    }

    .print-toc ul {
        list-style: none;
        padding: 0;
    }

    .print-toc li {
        margin: 0.5rem 0;
    }

    /* ===== FOOTER WITH METADATA ===== */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        padding: 0.5rem 0;
        border-top: 1px solid #ddd;
    }

    /* ===== PAGE NUMBERS ===== */
    @page {
        @bottom-right {
            content: "Page " counter(page) " of " counter(pages);
        }
    }

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

    /* ===== PREVENT ORPHANS/WIDOWS ===== */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
    }

    /* ===== IMAGES (if any) ===== */
    img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    /* ===== CODE BLOCKS (if any) ===== */
    code,
    pre {
        font-family: 'Courier New', monospace;
        font-size: 9pt;
        background: #f5f5f5;
        padding: 0.2rem 0.4rem;
        border: 1px solid #ddd;
    }

    pre {
        padding: 0.5rem;
        overflow: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

/* ===== PRINT BUTTON (visible on screen, hidden in print) ===== */
.print-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.2s;
}

.print-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

@media print {
    .print-button {
        display: none !important;
    }
}