/* CV Page — Screen & Print / PDF Styles */

.cv-page {
    max-width: 54rem;
}

/* Header */
.cv-header {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.cv-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cv-title-group {
    min-width: 0;
}

.cv-name {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 600;
    line-height: 1.2;
}

.cv-subtitle {
    margin: 0.35rem 0 0;
    color: var(--color-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.cv-actions {
    flex-shrink: 0;
    padding-top: 0.2rem;
}

.cv-print-btn {
    font-family: var(--font-sans);
    font-size: 0.82rem;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    padding: 0.35em 0.85em;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: var(--color-text);
    background: var(--color-surface);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cv-print-btn:hover,
.cv-print-btn:focus-visible {
    border-color: currentColor;
    outline: none;
}

.cv-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.42rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.cv-contact a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cv-contact a:hover {
    color: var(--color-link-hover);
}

.cv-sep {
    color: var(--color-muted);
    user-select: none;
}

.cv-interests {
    margin: 0.95rem 0 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--color-text);
}

.cv-interests-label {
    font-weight: 600;
}

/* Sections */
.cv-section {
    margin-top: 2.25rem;
    scroll-margin-top: 1.5rem;
}

.cv-section-title {
    margin: 0 0 1rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
}

/* Standard entries (Education, Experience, Mentoring) */
.cv-entry {
    margin-bottom: 1.4rem;
}

.cv-entry:last-child {
    margin-bottom: 0;
}

.cv-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
}

.cv-entry-heading {
    min-width: 0;
    flex: 1 1 auto;
}

.cv-entry-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.35;
}

.cv-entry-title a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cv-entry-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.86rem;
    color: var(--color-muted);
    line-height: 1.4;
}

.cv-entry-meta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-size: 0.8rem;
    color: var(--color-muted);
    line-height: 1.35;
    font-variant-numeric: tabular-nums;
}

.cv-entry-details {
    margin-top: 0.45rem;
    font-size: 0.86rem;
    line-height: 1.55;
}

.cv-entry-details p {
    margin: 0.3rem 0 0;
}

.cv-entry-details p:first-child {
    margin-top: 0;
}

.cv-bullets {
    margin: 0.5rem 0 0;
    padding-left: 1.25rem;
    font-size: 0.86rem;
    line-height: 1.55;
}

.cv-bullets li {
    margin-bottom: 0.32rem;
}

.cv-bullets li:last-child {
    margin-bottom: 0;
}

/* Publications / Manuscripts / Writing */
.cv-pub-group {
    margin-bottom: 1.25rem;
}

.cv-pub-group:last-child {
    margin-bottom: 0;
}

.cv-pub-group-title {
    margin: 0 0 0.55rem;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--color-muted);
    line-height: 1.35;
}

.cv-pub-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-pub-item {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.65rem;
    font-size: 0.86rem;
    line-height: 1.55;
}

.cv-pub-item:last-child {
    margin-bottom: 0;
}

.cv-pub-item::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-muted);
}

.cv-pub-link {
    font-size: 0.8rem;
    white-space: nowrap;
}

.cv-pub-note {
    margin-top: 0.15rem;
    font-size: 0.81rem;
    color: var(--color-muted);
}

/* Projects */
.cv-project-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-project-item {
    margin-bottom: 0.9rem;
}

.cv-project-item:last-child {
    margin-bottom: 0;
}

.cv-project-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem 1rem;
    flex-wrap: wrap;
}

.cv-project-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
}

.cv-project-meta {
    font-size: 0.78rem;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

.cv-project-summary {
    margin: 0.2rem 0 0;
    font-size: 0.86rem;
    line-height: 1.52;
}

/* Compact lists (Honors, Additional Experience) */
.cv-compact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cv-compact-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.25rem 1.25rem;
    margin-bottom: 0.45rem;
    font-size: 0.86rem;
    line-height: 1.45;
}

.cv-compact-item:last-child {
    margin-bottom: 0;
}

.cv-compact-main {
    min-width: 0;
    flex: 1 1 auto;
}

.cv-compact-title {
    font-weight: 600;
}

.cv-compact-detail {
    color: var(--color-muted);
}

.cv-compact-date {
    flex-shrink: 0;
    text-align: right;
    font-size: 0.8rem;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
}

/* Skills */
.cv-skills-list {
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.cv-skill-row {
    display: grid;
    grid-template-columns: 14rem 1fr;
    gap: 0.2rem 1rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.cv-skill-category {
    font-weight: 600;
}

.cv-skill-items {
    margin: 0;
}

/* Updated footer */
.cv-updated {
    margin-top: 2.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-muted);
}

.cv-updated a {
    color: inherit;
}

/* Narrow screen stacking */
@media (max-width: 640px) {
    .cv-header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .cv-entry-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cv-entry-meta {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        text-align: left;
        gap: 0.25rem 0.75rem;
    }

    .cv-compact-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .cv-compact-date {
        text-align: left;
    }

    .cv-skill-row {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
}

/* Print / Save as PDF — Traditional Serif / Sans Academic CV */
@media print {
    @page {
        size: letter;
        margin: 0.55in 0.65in;
    }

    :root,
    :root[data-theme="dark"],
    :root[data-theme="light"] {
        --color-bg: #ffffff;
        --color-text: #111111;
        --color-muted: #444444;
        --color-border: #cccccc;
        --color-surface: transparent;
        --color-link: #111111;
        --color-link-hover: #111111;
        color-scheme: light !important;
    }

    html,
    body {
        background: #ffffff !important;
        color: #111111 !important;
        color-scheme: light !important;
        font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif !important;
        font-size: 9.75pt;
        line-height: 1.38;
        margin: 0 !important;
        padding: 0 !important;
    }

    .site-header,
    .site-footer,
    .cv-actions,
    .cv-print-btn {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    .cv-page {
        max-width: none !important;
        width: 100%;
        color: #111111;
        font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    }

    .cv-page a {
        color: #111111;
        text-decoration: underline;
        text-decoration-color: #b8b8b8;
        text-decoration-thickness: 0.5pt;
        text-underline-offset: 2pt;
    }

    .cv-page code {
        font-family: 'JetBrains Mono', ui-monospace, monospace;
        background: transparent !important;
        color: #111111;
        padding: 0;
        font-size: 0.85em;
    }

    /* Centered traditional header */
    .cv-header {
        text-align: center;
        padding-bottom: 7pt;
        border-bottom: 0.85pt solid #222222;
        margin-bottom: 9pt;
    }

    .cv-header-top {
        display: block;
    }

    .cv-name {
        font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
        font-size: 19pt;
        font-weight: 700;
        letter-spacing: -0.01em;
        color: #111111;
    }

    .cv-subtitle {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 9.5pt;
        font-weight: 500;
        color: #333333;
        margin-top: 2pt;
    }

    .cv-contact {
        justify-content: center;
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.75pt;
        color: #333333;
        margin-top: 3.5pt;
        gap: 1.5pt 5pt;
    }

    .cv-interests {
        text-align: left;
        font-size: 9.25pt;
        line-height: 1.35;
        margin-top: 6.5pt;
    }

    .cv-interests-label {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.5pt;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    /* Sections */
    .cv-section {
        margin-top: 10pt;
    }

    .cv-section-title {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 9pt;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #111111;
        border-bottom: 0.6pt solid #333333;
        padding-bottom: 1.5pt;
        margin: 0 0 6pt;
        break-after: avoid;
        page-break-after: avoid;
    }

    /* Entries */
    .cv-entry {
        margin-bottom: 7pt;
    }

    .cv-entry-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 4pt 14pt;
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .cv-entry-details p,
    .cv-bullets li {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-entry-title {
        font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
        font-size: 9.85pt;
        font-weight: 600;
        line-height: 1.3;
    }

    .cv-entry-subtitle {
        font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
        font-style: italic;
        font-size: 9.25pt;
        color: #222222;
        margin-top: 1pt;
    }

    .cv-entry-meta {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.5pt;
        color: #333333;
        flex-direction: column;
        align-items: flex-end;
        text-align: right;
        line-height: 1.25;
        font-variant-numeric: lining-nums tabular-nums;
    }

    .cv-entry-details {
        margin-top: 2.5pt;
        font-size: 9.25pt;
        line-height: 1.36;
    }

    .cv-entry-details p {
        margin-top: 2pt;
    }

    .cv-bullets {
        margin-top: 2.5pt;
        padding-left: 12pt;
        font-size: 9.35pt;
        line-height: 1.36;
    }

    .cv-bullets li {
        margin-bottom: 1.75pt;
    }

    /* Publications */
    .cv-pub-group {
        margin-bottom: 7pt;
    }

    .cv-pub-group-title {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.5pt;
        font-weight: 600;
        color: #333333;
        margin: 0 0 3.5pt;
        break-after: avoid;
        page-break-after: avoid;
    }

    .cv-pub-item {
        padding-left: 9pt;
        margin-bottom: 3.75pt;
        font-size: 9.3pt;
        line-height: 1.36;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-pub-note {
        font-size: 8.65pt;
        color: #333333;
        margin-top: 1pt;
    }

    /* Projects */
    .cv-project-item {
        margin-bottom: 4.5pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-project-header {
        break-after: avoid;
        page-break-after: avoid;
    }

    .cv-project-title {
        font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
        font-size: 9.6pt;
        font-weight: 600;
    }

    .cv-project-meta {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.35pt;
        color: #444444;
        font-variant-numeric: lining-nums tabular-nums;
    }

    .cv-project-summary {
        margin-top: 1pt;
        font-size: 9.2pt;
        line-height: 1.35;
    }

    /* Compact lists */
    .cv-compact-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: 2.5pt;
        font-size: 9.25pt;
        line-height: 1.34;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-compact-detail {
        color: #333333;
    }

    .cv-compact-date {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.5pt;
        color: #333333;
        text-align: right;
        font-variant-numeric: lining-nums tabular-nums;
    }

    /* Skills */
    .cv-skills-list {
        gap: 2.5pt;
    }

    .cv-skill-row {
        display: grid;
        grid-template-columns: 1.45in 1fr;
        gap: 2pt 8pt;
        font-size: 9.25pt;
        line-height: 1.35;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-skill-category {
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8.75pt;
        font-weight: 600;
        color: #222222;
    }

    /* Updated line */
    .cv-updated {
        margin-top: 10pt;
        padding-top: 4pt;
        border-top: 0.5pt solid #cccccc;
        font-family: 'Source Sans 3', -apple-system, 'Helvetica Neue', Arial, sans-serif;
        font-size: 8pt;
        color: #444444;
        text-align: right;
    }

    p,
    li {
        orphans: 2;
        widows: 2;
    }
}
