/* ------------------------------------------------------------------
   Print / PDF stylesheet
   Only applies when printing (media="print"), so the screen design is
   untouched. Puppeteer also switches the page to print media, which is
   how the PDF is generated.
   ------------------------------------------------------------------ */

/* Print-only contact line (hidden on screen) */
.print-contact {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 12mm 13mm 14mm;
    }

    /* --- Base ------------------------------------------------------ */
    html,
    body {
        background: #fff !important;
        color: #1f2937 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body {
        font-size: 10.5pt;
        line-height: 1.5;
    }

    a {
        text-decoration: none;
        color: inherit;
    }

    /* --- Hide interactive chrome ---------------------------------- */
    header,
    footer,
    #contact,
    .no-print,
    #top .pointer-events-none,
    #top a[href="#contact"],
    #top a[href="#experience"],
    #top .grid > div:nth-child(2) {
        display: none !important;
    }

    /* --- Hero: compact light header ------------------------------- */
    #top .grid {
        display: block !important;
    }

    #top {
        background: none !important;
        color: #0f172a !important;
        padding: 0 0 5mm !important;
        overflow: visible !important;
    }

    #top h1 {
        font-size: 25pt !important;
        line-height: 1.1 !important;
        color: #1d4ed8 !important;
        background: none !important;
        -webkit-text-fill-color: #1d4ed8 !important;
        text-align: left !important;
        filter: none !important;
        text-shadow: none !important;
    }

    #top .mt-3 {
        font-size: 12pt !important;
        color: #1d4ed8 !important;
        margin-top: 2mm !important;
        text-align: left !important;
    }

    #top p {
        color: #374151 !important;
        text-align: left !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #top .mt-6 {
        margin-top: 3mm !important;
        font-size: 10pt !important;
    }

    #top .mx-auto {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .print-contact {
        display: block;
        margin-top: 3mm;
        padding-top: 3mm;
        border-top: 1px solid #dbeafe;
        font-size: 8.8pt;
        color: #475569;
        text-align: left;
        line-height: 1.6;
    }

    .print-contact a {
        color: #1e293b !important;
        font-weight: 600;
        text-decoration: none;
    }

    /* --- Sections ------------------------------------------------- */
    section {
        padding: 4mm 0 !important;
        background: none !important;
        margin: 0 !important;
        break-inside: auto;
    }

    /* Keep the Experience heading with its first card */
    #experience {
        break-before: page;
        page-break-before: always;
    }

    /* Education is intentionally left out of the printed version */
    #education {
        display: none !important;
    }

    /* Skills, Certifications and Honors & Awards share one page */
    #skills {
        break-before: page;
        page-break-before: always;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    #certifications,
    #awards {
        break-inside: avoid;
        page-break-inside: avoid;
        margin-top: 9mm !important;
    }

    /* Small sections read better unsplit, so an orphan heading
       can never be left at the bottom of a page */
    #contact {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    section > div {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .section-title {
        font-size: 14pt !important;
        letter-spacing: -0.01em;
        break-after: avoid;
        page-break-after: avoid;
    }

    .section-title::after {
        bottom: -2.5mm;
        height: 2px;
        width: 14mm;
    }

    /* Collapse the large vertical rhythm used on screen */
    .mt-10,
    .mt-12 {
        margin-top: 5mm !important;
    }

    .py-16,
    .md\:py-24,
    .py-24 {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    /* --- Cards ---------------------------------------------------- */
    .shadow-sm,
    .shadow-md,
    .shadow-lg,
    .shadow-xl,
    .shadow-2xl,
    [class*="shadow-"] {
        box-shadow: none !important;
    }

    .rounded-2xl,
    .rounded-xl,
    .rounded-\[1\.75rem\] {
        border-radius: 2mm !important;
    }

    [class*="bg-white"],
    [class*="bg-slate-50"],
    [class*="bg-slate-100"] {
        background-color: #fff !important;
    }

    [class*="hover:-translate"],
    [class*="hover:shadow"] {
        transform: none !important;
    }

    /* Keep cards from being split across pages */
    #about .grid > div,
    #experience .relative:not(.mt-12),
    #skills .grid > div,
    #education .grid > div,
    #certifications .grid > div,
    #awards .grid > div,
    #contact .grid > a {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* --- About ---------------------------------------------------- */
    #about .grid {
        display: block !important;
    }

    #about .grid > div + div {
        margin-top: 4mm !important;
    }

    #about dl > div {
        padding: 1.5mm 0 !important;
    }

    /* --- Experience timeline -------------------------------------- */
    #experience .border-l-4 {
        border-left: 0 !important;
        margin-left: 0 !important;
        padding-left: 0 !important;
    }

    #experience .space-y-10 > * + * {
        margin-top: 4mm !important;
    }

    .timeline-dot {
        display: none !important;
    }

    #experience .relative > .rounded-2xl {
        padding: 4mm !important;
    }

    #experience h3 {
        font-size: 12pt !important;
    }

    #experience ul {
        margin-top: 2mm !important;
    }

    #experience li {
        font-size: 9.2pt !important;
        line-height: 1.45 !important;
        margin-bottom: 1mm;
    }

    #experience li + li {
        margin-top: 1mm !important;
    }

    #experience li strong,
    #experience li a {
        color: #0f172a !important;
    }

    /* --- Skills / chips ------------------------------------------- */
    .skill-tag,
    .cert-badge {
        font-size: 8.5pt !important;
        padding: 1mm 2.5mm !important;
        border-color: #dbeafe !important;
        background-color: #f8fafc !important;
        color: #1d4ed8 !important;
        box-shadow: none !important;
    }

    .skill-tag i,
    .cert-badge i {
        display: none !important;
    }

    #skills .grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 3mm !important;
    }

    /* Every skills card spans the full width so the chips flow
       naturally instead of leaving a half-empty column */
    #skills .grid > div:first-child,
    #skills .grid > div:nth-child(2) {
        grid-column: 1 / -1;
    }

    #skills .grid > div {
        padding: 3mm !important;
    }

    #skills h3 {
        margin-bottom: 2mm !important;
        font-size: 10pt !important;
    }

    #skills .text-lg {
        font-size: 10pt !important;
    }

    #skills .flex-wrap {
        gap: 1.5mm !important;
    }

    /* --- Certifications ------------------------------------------- */
    #certifications .rounded-2xl {
        padding: 3mm 4mm !important;
    }

    #certifications .flex-wrap {
        gap: 1.5mm !important;
    }

    #certifications .mt-6 {
        margin-top: 3mm !important;
    }

    #awards .rounded-2xl {
        padding: 3mm 4mm !important;
    }

    /* Rendered but subtle icons */
    i.fas,
    i.fab {
        color: inherit;
    }
}
