/* ================================================================
   BUILD GUIDE — PRINT / PDF  |  PCBuildMate Blueprint Manual
   ================================================================ */

@media print {

    /* ─── Page setup + running header/footer ────────────────────── */

    @page {
        size: A4 portrait;
        margin: 20mm 18mm 24mm 18mm;

        @top-left {
            content: "PCBUILDMATE";
            font-family: 'Courier New', Courier, monospace;
            font-size: 6pt;
            font-weight: 700;
            letter-spacing: 0.22em;
            color: #3077A6;
            vertical-align: bottom;
            padding-bottom: 4pt;
        }

        @top-right {
            content: "Montage Gids";
            font-family: 'Courier New', Courier, monospace;
            font-size: 6pt;
            color: #9ca3af;
            vertical-align: bottom;
            padding-bottom: 4pt;
        }

        @bottom-left {
            content: "pcbuildmate.nl";
            font-family: 'Courier New', Courier, monospace;
            font-size: 6pt;
            color: #9ca3af;
            vertical-align: top;
            padding-top: 4pt;
        }

        @bottom-center {
            content: counter(page);
            font-family: 'Courier New', Courier, monospace;
            font-size: 7.5pt;
            font-weight: 700;
            color: #1a1a1a;
            vertical-align: top;
            padding-top: 4pt;
        }

        @bottom-right {
            content: "\00a9 PCBuildMate";
            font-family: 'Courier New', Courier, monospace;
            font-size: 6pt;
            color: #9ca3af;
            vertical-align: top;
            padding-top: 4pt;
        }
    }

    /* First page (cover) — no margins, no running header/footer */
    @page :first {
        margin: 0;

        @top-left    { content: ""; }
        @top-right   { content: ""; }
        @bottom-left { content: ""; }
        @bottom-center { content: ""; }
        @bottom-right  { content: ""; }
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    html, body {
        background: #fff !important;
        color: #1a1a1a !important;
        font-size: 10pt;
        line-height: 1.6;
    }

    /* ─── Hide all screen chrome ────────────────────────────────── */

    #wpadminbar,
    .site-header,
    .site-footer,
    .guide-topbar,
    .guide-progress-bar,
    .guide-stepnav,
    .guide-rail,
    .guide-bottom-nav,
    .guide-steplist,
    .guide-celebrate,
    .guide-step__complete,
    .guide-notes__toggle,
    .guide-notes__sheet,
    .guide-notes__footer,
    .guide-mode-toggle,
    .guide-btn,
    .cookie-banner {
        display: none !important;
    }

    /* ─── Layout ────────────────────────────────────────────────── */

    .guide-page {
        background: #fff !important;
        color: #1a1a1a !important;
    }

    .guide-layout {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .guide-main {
        padding: 0 !important;
        border: none !important;
    }

    /* ─── Cover page ────────────────────────────────────────────── */

    .guide-print-cover {
        display: flex !important;
        flex-direction: column;
        min-height: 297mm;
        margin: 0;
        padding: 0;
        page-break-after: always !important;
        break-after: page !important;
        background: #fff !important;
        position: relative;
        overflow: hidden;
    }

    /* Right binding bar — premium manual aesthetic */
    .guide-print-cover::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 2.5mm;
        background: #3077A6 !important;
        opacity: 0.10;
        z-index: 1;
    }

    /* Brand stripe — top accent, 10mm */
    .guide-print-cover__top-stripe {
        height: 10mm;
        background: #3077A6 !important;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
    }

    .guide-print-cover__body {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 14mm 20mm 8mm 22mm;
        position: relative;
        z-index: 2;
    }

    .guide-print-cover__logo-wrap {
        margin-bottom: 14mm;
        padding-bottom: 7mm;
        border-bottom: 0.5pt solid #e5e7eb;
    }

    .guide-print-cover__logo {
        height: 20pt;
        width: auto;
        display: block;
    }

    .guide-print-cover__category {
        font-size: 7pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.32em;
        color: #3077A6 !important;
        font-family: 'Courier New', Courier, monospace;
        margin-bottom: 4mm;
    }

    .guide-print-cover__title {
        font-size: 40pt;
        font-weight: 700;
        color: #0f172a !important;
        line-height: 1.04;
        margin: 0;
        font-family: Georgia, 'Times New Roman', serif;
        letter-spacing: -0.025em;
        max-width: 135mm;
    }

    .guide-print-cover__rule {
        width: 14mm;
        height: 3pt;
        background: #3077A6 !important;
        margin: 6mm 0 10mm;
    }

    /* Specs grid — 2 columns, more breathing room per spec */
    .guide-print-cover__specs {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 3mm;
        margin-bottom: 10mm;
        padding-bottom: 10mm;
        border-bottom: 0.5pt solid #e5e7eb;
    }

    .guide-print-cover__spec {
        padding: 3.5mm 5mm 4mm;
        background: #f8fafc !important;
        border-left: 3pt solid #3077A6 !important;
    }

    .guide-print-cover__spec dt {
        display: block;
        font-size: 5.5pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: #64748b !important;
        font-family: 'Courier New', Courier, monospace;
        margin-bottom: 1.5mm;
    }

    .guide-print-cover__spec dd {
        display: block;
        font-size: 10pt;
        font-weight: 600;
        color: #0f172a !important;
        margin: 0;
        line-height: 1.2;
    }

    /* TOC */
    .guide-print-cover__toc-label {
        font-size: 5.5pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.2em;
        color: #64748b !important;
        font-family: 'Courier New', Courier, monospace;
        padding-bottom: 2.5mm;
        border-bottom: 0.5pt solid #e5e7eb;
        margin-bottom: 4mm;
    }

    .guide-print-cover__toc {
        columns: 2;
        column-gap: 10mm;
        flex: 1;
    }

    .guide-print-cover__toc-section {
        font-size: 5pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: #3077A6 !important;
        font-family: 'Courier New', Courier, monospace;
        margin-top: 4.5mm;
        margin-bottom: 2mm;
        break-inside: avoid;
    }

    .guide-print-cover__toc-item {
        display: flex;
        align-items: baseline;
        margin-bottom: 1.5mm;
        break-inside: avoid;
    }

    .guide-print-cover__toc-num {
        font-size: 6pt;
        font-weight: 700;
        color: #3077A6 !important;
        font-family: 'Courier New', Courier, monospace;
        min-width: 8mm;
        flex-shrink: 0;
    }

    .guide-print-cover__toc-text {
        font-size: 7.5pt;
        color: #334155 !important;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Leader dots between text and right edge */
    .guide-print-cover__toc-leader {
        flex: 1;
        border-bottom: 0.75pt dotted #cbd5e1;
        margin: 0 1.5mm 2pt;
        min-width: 4mm;
    }

    /* Cover footer — dark navy band */
    .guide-print-cover__footer {
        display: flex !important;
        background: #0f172a !important;
        padding: 4.5mm 20mm 4.5mm 22mm;
        flex-shrink: 0;
        justify-content: space-between;
        align-items: center;
        z-index: 2;
        position: relative;
    }

    .guide-print-cover__footer-url {
        font-size: 6.5pt;
        color: #64748b !important;
        font-family: 'Courier New', Courier, monospace;
        letter-spacing: 0.05em;
    }

    .guide-print-cover__footer-brand {
        font-size: 6.5pt;
        font-weight: 700;
        color: #e2e8f0 !important;
        font-family: 'Courier New', Courier, monospace;
        letter-spacing: 0.14em;
    }

    .guide-print-cover__footer-date {
        font-size: 6.5pt;
        color: #64748b !important;
        font-family: 'Courier New', Courier, monospace;
    }

    /* Blueprint crosshatch grid — bottom-right decorative element */
    .guide-print-cover__decor {
        position: absolute;
        bottom: 15mm;
        right: 0;
        width: 100mm;
        height: 100mm;
        background-image:
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent calc(7mm - 0.35pt),
                #3077A6 calc(7mm - 0.35pt),
                #3077A6 7mm
            ),
            repeating-linear-gradient(
                90deg,
                transparent,
                transparent calc(7mm - 0.35pt),
                #3077A6 calc(7mm - 0.35pt),
                #3077A6 7mm
            ) !important;
        opacity: 0.065;
        z-index: 0;
        pointer-events: none;
    }

    /* Denser crosshatch grid — top-right, below stripe */
    .guide-print-cover__decor-2 {
        position: absolute;
        top: 10mm;
        right: 0;
        width: 50mm;
        height: 45mm;
        background-image:
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent calc(4mm - 0.35pt),
                #3077A6 calc(4mm - 0.35pt),
                #3077A6 4mm
            ),
            repeating-linear-gradient(
                90deg,
                transparent,
                transparent calc(4mm - 0.35pt),
                #3077A6 calc(4mm - 0.35pt),
                #3077A6 4mm
            ) !important;
        opacity: 0.04;
        z-index: 1;
        pointer-events: none;
    }

    /* ─── Section page breaks ───────────────────────────────────── */

    .guide-step[data-step="6"],
    .guide-step[data-step="14"],
    .guide-step[data-step="16"] {
        page-break-before: always !important;
        break-before: page !important;
    }

    .guide-print-section[data-before="6"],
    .guide-print-section[data-before="14"],
    .guide-print-section[data-before="16"] {
        display: block !important;
        padding: 6mm 7mm 5mm;
        margin-bottom: 6mm;
        border-bottom: 0.75pt solid #3077A6;
        background: #f0f7ff !important;
    }

    .guide-print-section__label {
        font-size: 6pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.22em;
        color: #3077A6 !important;
        font-family: 'Courier New', Courier, monospace;
        margin-bottom: 2mm;
    }

    .guide-print-section__title {
        font-size: 17pt;
        font-weight: 700;
        color: #0f172a !important;
        font-family: Georgia, 'Times New Roman', serif;
        margin: 0;
    }

    /* ─── Step cards ────────────────────────────────────────────── */

    .guide-step {
        display: block !important;
        background: #fff !important;
        border: none !important;
        border-left: 3pt solid #3077A6 !important;
        border-radius: 0 !important;
        padding: 9pt 13pt 9pt 11pt !important;
        margin-bottom: 11pt !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        box-shadow: none !important;
        position: relative;
    }

    .guide-step__header {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        margin-bottom: 5pt !important;
        gap: 6pt !important;
    }

    .guide-step__meta {
        background: #3077A6 !important;
        color: #fff !important;
        font-size: 5.5pt !important;
        padding: 1.5pt 6pt !important;
        border-radius: 100pt !important;
        letter-spacing: 0.12em !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        font-family: 'Courier New', Courier, monospace !important;
        display: inline-block !important;
        margin-bottom: 3pt !important;
    }

    .guide-step__title {
        font-size: 13pt !important;
        font-weight: 700 !important;
        color: #0f172a !important;
        font-family: Georgia, 'Times New Roman', serif !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }

    /* ─── Prose ─────────────────────────────────────────────────── */

    .guide-step p {
        font-size: 9.5pt !important;
        line-height: 1.65 !important;
        color: #374151 !important;
        margin: 0 0 6pt !important;
    }

    .guide-step ul,
    .guide-step ol {
        font-size: 9.5pt !important;
        color: #374151 !important;
        padding-left: 13pt !important;
        margin: 0 0 7pt !important;
    }

    .guide-step li {
        margin-bottom: 2.5pt !important;
        line-height: 1.55 !important;
    }

    .guide-step strong { color: #0f172a !important; }

    .guide-step a { color: #3077A6 !important; }

    .guide-step a[href^="http"]::after {
        content: " [" attr(href) "]";
        font-size: 7pt;
        color: #94a3b8;
        word-break: break-all;
    }

    .guide-step code,
    .guide-step kbd {
        background: #f1f5f9 !important;
        border: 0.5pt solid #e2e8f0 !important;
        font-size: 8.5pt !important;
        padding: 0.5pt 3pt !important;
        border-radius: 2pt !important;
        font-family: 'Courier New', Courier, monospace !important;
    }

    /* ─── Callouts ──────────────────────────────────────────────── */

    .guide-callout {
        display: flex !important;
        padding: 6pt 9pt !important;
        border-radius: 0 3pt 3pt 0 !important;
        margin: 6pt 0 !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        gap: 6pt !important;
        align-items: flex-start !important;
    }

    .guide-callout--tip {
        background: #f0fdf4 !important;
        border-left: 2.5pt solid #22c55e !important;
    }

    .guide-callout--warn {
        background: #fffbeb !important;
        border-left: 2.5pt solid #f59e0b !important;
    }

    .guide-callout p {
        font-size: 9pt !important;
        margin: 0 !important;
        color: #374151 !important;
    }

    .guide-callout__badge {
        font-size: 7.5pt !important;
        font-weight: 700 !important;
        flex-shrink: 0 !important;
        margin-top: 0.5pt !important;
    }

    /* ─── Notes (populated by JS beforeprint) ───────────────────── */

    .guide-notes__print {
        margin-top: 7pt;
        padding: 6pt 9pt;
        background: #eff6ff !important;
        border-left: 2.5pt solid #3077A6 !important;
        border-radius: 0 3pt 3pt 0;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .guide-notes__print-label {
        font-size: 5.5pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.14em;
        color: #3077A6 !important;
        font-family: 'Courier New', Courier, monospace;
        margin-bottom: 3pt;
    }

    .guide-notes__print-body {
        font-size: 9pt;
        color: #374151 !important;
        line-height: 1.5;
        white-space: pre-wrap;
        margin: 0;
        font-style: italic;
    }

    /* ─── Step notes section ────────────────────────────────────── */

    .guide-step__notes { display: block !important; }

    .guide-notes__toggle,
    .guide-notes__sheet,
    .guide-notes__footer { display: none !important; }

    /* ─── Print-only section markers (screen: hidden) ───────────── */

    .guide-print-section { display: none; }

}
