/**
 * Hymn Print Styles
 *
 * Optimized styles for printing hymn pages
 *
 * @package HymnManager
 */

/* Print Button Styles (screen only) */
@media screen {
    .print-toolbar {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 20px;
        padding: 16px 20px;
        background: var(--light-gray, #f4f4f4);
        border-radius: 8px;
        border: 1px solid var(--medium-gray, #e5e5e5);
    }

    .print-toolbar-label {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-secondary, #555);
    }

    .print-options {
        display: flex;
        gap: 8px;
    }

    .btn-print {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 16px;
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--white, #fff);
        background: var(--accent-blue, #3d6b99);
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .btn-print:hover {
        background: var(--accent-blue-hover, #2d5a88);
    }

    .btn-print.btn-secondary {
        color: var(--text-primary, #222);
        background: var(--white, #fff);
        border: 1px solid var(--medium-gray, #e5e5e5);
    }

    .btn-print.btn-secondary:hover {
        background: var(--light-gray, #f4f4f4);
    }

    .btn-print svg {
        width: 16px;
        height: 16px;
    }
}

/* Print Styles */
@media print {
    /* Reset and base */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        margin: 0;
        padding: 0;
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    /* Hide non-essential elements */
    header,
    footer,
    nav,
    .site-header,
    .site-footer,
    .site-navigation,
    #wpadminbar,
    .transpose-toolbar,
    .view-toggle,
    .download-section,
    .hymn-story,
    .print-toolbar,
    .hymn-card-favorite,
    .btn-print,
    .kadence-header,
    .kadence-footer,
    .entry-footer,
    .comments-area,
    .post-navigation,
    .sidebar,
    aside,
    .wp-block-navigation,
    [class*="cookie"],
    [class*="popup"],
    [class*="modal"] {
        display: none !important;
    }

    /* Main container */
    .hymn-single-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Page header */
    .hymn-header {
        text-align: center;
        margin-bottom: 24pt;
        padding-bottom: 12pt;
        border-bottom: 1pt solid #ccc;
    }

    .hymn-title {
        font-size: 18pt;
        font-weight: bold;
        margin: 0 0 8pt 0;
        color: #000;
    }

    .hymn-meta {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12pt;
        font-size: 10pt;
        color: #333;
    }

    .hymn-meta-item {
        display: inline-flex;
        align-items: center;
        gap: 4pt;
    }

    .hymn-meta-item svg {
        display: none;
    }

    /* Content area */
    .hymn-content {
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
    }

    .hymn-article {
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
    }

    /* Chord view */
    #chord-view {
        font-family: "Courier New", Courier, monospace;
        font-size: 11pt;
        line-height: 1.8;
        white-space: pre-wrap;
    }

    #chord-view .chord-line {
        margin-bottom: 4pt;
    }

    #chord-view .chord {
        font-weight: bold;
        color: #000;
    }

    /* Lyrics view */
    #lyrics-view {
        font-size: 12pt;
        line-height: 1.8;
    }

    #lyrics-view p {
        margin: 0 0 12pt 0;
    }

    /* Section headers */
    .section-header,
    .verse-header {
        font-weight: bold;
        font-size: 10pt;
        text-transform: uppercase;
        margin: 16pt 0 8pt 0;
        color: #333;
    }

    /* Print header (generated by JS) */
    .print-header {
        display: block !important;
        text-align: center;
        margin-bottom: 20pt;
        padding-bottom: 10pt;
        border-bottom: 1pt solid #ccc;
    }

    .print-header h1 {
        font-size: 16pt;
        margin: 0 0 6pt 0;
    }

    .print-header .print-meta {
        font-size: 9pt;
        color: #666;
    }

    /* Page settings */
    @page {
        size: letter;
        margin: 0.75in;
    }

    @page :first {
        margin-top: 0.5in;
    }

    /* Avoid breaks */
    .hymn-header,
    .verse,
    .chorus {
        page-break-inside: avoid;
    }

    /* Footer with page numbers */
    @page {
        @bottom-center {
            content: counter(page);
            font-size: 9pt;
            color: #999;
        }
    }

    /* Links */
    a {
        color: #000;
        text-decoration: none;
    }

    /* Hide one view based on print mode */
    body.print-chords #lyrics-view {
        display: none !important;
    }

    body.print-lyrics #chord-view {
        display: none !important;
    }

    /* Show the appropriate view */
    body.print-chords #chord-view,
    body.print-lyrics #lyrics-view {
        display: block !important;
    }
}

/* Print preview adjustments */
@media print and (max-width: 8.5in) {
    .hymn-title {
        font-size: 16pt;
    }

    #chord-view,
    #lyrics-view {
        font-size: 10pt;
    }
}
