/*
    Resume-page styles.
    This file handles:
    - the on-screen resume controls and cards
    - the grouped-skill and entry layouts for browsing
    - the dedicated print-only resume layout for PDF / paper output
*/

/* Toolbar at the top of the screen version: title, selector, and print button. */
.resume-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.resume-toolbar-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.resume-select-wrap {
    display: grid;
    gap: 0.35rem;
}

.resume-select-wrap label {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.resume-select {
    min-width: 15rem;
    padding: 0.8rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

/* Shared contact-chip styling for the on-screen resume header/profile section. */
.resume-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.resume-contact a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    text-decoration: none;
}

/* Shared grid layout for the screen-only skills and entry lists. */
.resume-skill-groups,
.resume-entry-list {
    display: grid;
    gap: 1rem;
}

.resume-skill-group,
.resume-entry {
    padding: 1.1rem;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.resume-skill-group h3,
.resume-entry h3 {
    margin: 0 0 0.45rem;
    font-size: 1.02rem;
}

.resume-entry-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.65rem;
}

.resume-entry-org {
    color: var(--muted);
    font-style: italic;
}

.resume-entry-period {
    color: var(--muted);
    font-size: 0.92rem;
}

.resume-entry ul,
.resume-skill-group ul {
    margin: 0;
    padding-left: 1.1rem;
}

.resume-entry li + li,
.resume-skill-group li + li {
    margin-top: 0.35rem;
}

/*
    Print-resume wrapper.
    Hidden on screen because it only exists to create a better PDF / paper version.
*/
.print-resume {
    display: none;
}

/* Print layout typography and spacing. */
.print-resume-header {
    margin-bottom: 0.22in;
}

.print-resume-header h1 {
    margin: 0 0 0.14in;
    text-align: center;
    font-size: 24pt;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

/* Contact line sits directly under the name and uses separators instead of pills/cards. */
.print-resume-contact {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.28in;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 10pt;
}

.print-resume-contact--tight {
    gap: 0.15in;
}

.print-resume-contact li {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
}

.print-resume-contact a {
    color: inherit;
    text-decoration: none;
}

/* Each printable section gets a compact heading with a divider underneath. */
.print-resume-section {
    margin-bottom: 0.22in;
    break-inside: avoid;
    page-break-inside: avoid;
}

.print-resume-section h2 {
    margin: 0 0 0.08in;
    padding-bottom: 0.05in;
    border-bottom: 2px solid #d4d4d4;
    font-size: 12pt;
    line-height: 1.2;
}

.print-resume-copy {
    display: grid;
    gap: 0.08in;
}

.print-resume-copy p {
    margin: 0;
}

/* Skills are rendered as compact inline lines to save space and mirror a conventional resume. */
.print-resume-skill-lines {
    display: grid;
    gap: 0.05in;
}

.print-skill-line {
    margin: 0;
}

/* Shared list container for education and experience in the print layout. */
.print-resume-list {
    display: grid;
    gap: 0.09in;
}

.print-resume-item {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* First row: title + organization on the left, dates on the right. */
.print-resume-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.2in;
    align-items: baseline;
    margin-bottom: 0.04in;
}

.print-resume-item-title {
    margin: 0;
    font-size: inherit;
    font-weight: normal;
    line-height: 1.35;
}

.print-resume-item-org {
    font-style: italic;
    font-weight: 400;
}

.print-resume-item-period {
    white-space: nowrap;
    font-size: 10.5pt;
}

.print-resume-item ul {
    margin: 0;
    padding-left: 1.15rem;
}

.print-resume-item li + li {
    margin-top: 0.04in;
}

/*
    Compact print layout for one-page variants (all except full).
    Tightens margins and gaps to keep all content within a single letter page.
*/
.print-resume--compact.print-resume {
    /* Only relevant when actually printing, but set here so the class is defined. */
}

@media print {
    .print-resume--compact .print-resume-header {
        margin-bottom: 0.14in;
    }

    .print-resume--compact .print-resume-header h1 {
        margin-bottom: 0.09in;
        font-size: 22pt;
    }

    .print-resume--compact .print-resume-section {
        margin-bottom: 0.15in;
    }

    .print-resume--compact .print-resume-section h2 {
        margin-bottom: 0.05in;
        padding-bottom: 0.04in;
    }

    .print-resume--compact .print-resume-list {
        gap: 0.07in;
    }

    .print-resume--compact .print-resume-item li + li {
        margin-top: 0.03in;
    }

    .print-resume--compact .print-resume-skill-lines {
        gap: 0.04in;
    }

    .print-resume--compact .print-resume-copy {
        gap: 0.06in;
    }
}

/* 2-column grid: education/skills (2fr) left, profile/experience (3fr) right. */
/* align-items: stretch makes the two cards in each row match height. */
.resume-grid {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: 1rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

/* Profile: paragraph block. */
.resume-doc-copy {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.resume-doc-copy p {
    margin: 0;
}

/* Skills: 2-column grid so every category card is the same width regardless of label length. */
.resume-skills-card .resume-skill-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Version selector + print button bar inside its section-card. */
.resume-print-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Small-screen: stack the two columns and reorder sections for readability. */
@media (max-width: 720px) {
    .resume-grid {
        grid-template-columns: 1fr;
    }

    .resume-profile-card   { order: 1; }
    .resume-education-card { order: 2; }
    .resume-skills-card    { order: 3; }
    .resume-experience-card { order: 4; }

    .resume-skills-card .resume-skill-groups {
        grid-template-columns: 1fr 1fr;
    }

    .resume-select-wrap,
    .resume-select {
        width: 100%;
    }
}

/*
    Print rules:
    - hide the interactive screen layout
    - show the dedicated print layout
    - remove decorative screen styling
    - tighten spacing to keep the resume professional and compact
*/
@media print {
    @page {
        margin: 0.5in;
        size: letter;
    }

    html,
    body {
        background: #ffffff !important;
    }

    body {
        font-size: 10.5pt;
        line-height: 1.35;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Hide the entire screen browsing experience so only the clean print layout remains. */
    .screen-only,
    main.site-main > .site-shell > *:not(.print-resume) {
        display: none !important;
    }

    .print-resume {
        display: block !important;
    }

    /* Remove any leftover decorative spacing the shared screen layout would otherwise keep. */
    .print-resume * {
        box-shadow: none !important;
    }

    a,
    a:visited {
        color: inherit !important;
    }
}
