/* CV-specific styles */

#cv-header {
    text-align: center;
    margin-bottom: 0em;
    padding-bottom: 0em;
}

.cv-title {
    font-size: 20pt;
    font-weight: 700;
    margin-bottom: 0em;
}

/* Remove numbering from title */
.cv-title::before {
    content: "" !important;
}

.cv-email, .cv-website {
    display: inline;
}

.cv-separator {
    margin: 0 0.5em;
}

/* Counter reset for section numbering */
body {
    counter-reset: h1counter -1;
}

/* CV section styling with numbering */
h1 {
    font-size: 18pt;
    font-weight: 700;
    margin-top: 2em;
    counter-reset: h2counter;
}

h1::before {
    counter-increment: h1counter;
    content: counter(h1counter) ". ";
}

h2 {
    font-size: 14pt;
    font-weight: 600;
    margin-top: 1.5em;
    counter-reset: h3counter;
}

h2::before {
    counter-increment: h2counter;
    content: counter(h1counter) "." counter(h2counter) ". ";
}

h3 {
    font-size: 12pt;
    font-weight: 600;
    margin-top: 1em;
    counter-reset: h4counter;
}

h3::before {
    counter-increment: h3counter;
    content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) ". ";
}

h4 {
    font-size: 12pt;
    font-weight: 500;
    margin-top: 0.8em;
    margin-bottom: 0.3em;
    text-indent: 1em;
}

h4::before {
    counter-increment: h4counter;
    content: counter(h1counter) "." counter(h2counter) "." counter(h3counter) "." counter(h4counter) ". ";
}

/* Table styling for CV */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5em;
    margin-bottom: 1em;
}

h4 + table {
    margin-top: 0.5em;
}

table > tbody > tr > td:nth-child(odd) {
    width: 8em;
    text-align: right;
    vertical-align: top;
    padding-right: 1.5em;
    padding-bottom: 0.8em;
}

table > tbody > tr > td:nth-child(even) {
    vertical-align: top;
    padding-bottom: 0.8em;
    line-height: 1.5;
}

table > tbody > tr > td:nth-child(even) > em {
    display: block;
    margin-top: 0.3em;
    font-size: 10pt;
}

table em {
    font-size: 10pt;
}

table > tbody > tr > td:nth-child(even) > p {
    margin: 0em;
}

table > tbody > tr > td:nth-child(even) > p + p {
    margin-top: 0.5em;
}

table > tbody > tr > td[colspan="2"] {
    text-indent: 2em;
    text-align: left;
}

/* Lists inside tables should be less spacious */
table ul, table ol {
    margin: 0;
    padding-left: 1.5em;
}

table li {
    margin-bottom: 0.2em;
}

/* Publications and lists */
ol, ul {
    padding-left: 1.5em;
}

li {
    margin-bottom: 0.8em;
}

/* Emphasize author name in publications */
strong {
    font-weight: 700;
}

/* Underline for mentored students */
u {
    text-decoration: underline;
}

/* Better spacing for paragraphs in CV */
p {
    margin: 0.5em 0;
}

a {
    text-decoration: none;
    background-color: var(--white);
    color: var(--black);
    font-size: 12pt;
    padding: 0;
}

a:hover {
  color: var(--black);
  text-decoration: underline;
}


/* Print styles for CV */
@media print {
    @page {
        margin: 1in;
    }
    
    body {
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
        font-size: 10pt;
        line-height: 1.3;
    }
    
    html {
        background-color: white;
    }
    
    #scroller {
        display: none;
    }
    
    #cv-header {
        margin-bottom: 0.3em;
        padding-bottom: 0;
    }
    
    .cv-title {
        font-size: 16pt;
        margin-bottom: 0.2em;
    }
    
    h1 {
        font-size: 14pt;
        margin-top: 0.8em;
        margin-bottom: 0.3em;
        page-break-before: always;
    }
    
    h1:first-of-type {
        page-break-before: avoid;
    }
    
    h2 {
        font-size: 12pt;
        margin-top: 0.6em;
        margin-bottom: 0.2em;
    }
    
    h3 {
        font-size: 11pt;
        margin-top: 0.5em;
        margin-bottom: 0.2em;
    }
    
    h4 {
        font-size: 11pt;
        margin-top: 0.4em;
        margin-bottom: 0.2em;
    }
    
    table {
        margin-top: 0.5em;
        margin-bottom: 0.3em;
    }
    
    h4 + table {
        margin-top: 0.2em;
    }
    
    table > tbody > tr > td:nth-child(odd) {
        padding-right: 1em;
        padding-bottom: 0.3em;
    }
    
    table > tbody > tr > td:nth-child(even) {
        padding-bottom: 0.3em;
        line-height: 1.3;
    }
    
    table > tbody > tr > td:nth-child(even) > em {
        margin-top: 0.1em;
        font-size: 9pt;
    }
    
    table em {
        font-size: 9pt;
    }
    
    li {
        margin-bottom: 0.2em;
        line-height: 1.3;
    }
    
    p {
        margin: 0.2em 0;
    }
    
    table > tbody > tr > td:nth-child(even) > p + p {
        margin-top: 0.2em;
    }
    
    a {
        color: var(--black);
        background-color: transparent;
        font-size: 10pt;
    }
    
    /* Ensure proper page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    li, table > tbody > tr {
        page-break-inside: avoid;
    }
}

/* Mobile responsive styles */
@media (max-width: 600px) {
    .cv-contact {
        display: flex;
        flex-direction: column;
        gap: 0.3em;
    }
    
    .cv-separator {
        display: none;
    }
    
    table > tbody > tr > td:nth-child(odd) {
        width: 5em;
        padding-right: 1em;
        font-size: 10pt;
    }
    
    table > tbody > tr > td:nth-child(even) {
        font-size: 11pt;
    }
}
