/* ==========================================================================
   CV Stylesheet
   ========================================================================== */

/* Font Face Declarations
   ========================================================================== */

@font-face {
    font-family: 'Dartmouth Ruzicka';
    src: url('../data/DartmouthRuzicka-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dartmouth Ruzicka';
    src: url('../data/DartmouthRuzicka-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dartmouth Ruzicka';
    src: url('../data/DartmouthRuzicka-RegularItalic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Dartmouth Ruzicka';
    src: url('../data/DartmouthRuzicka-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* CSS Variables
   ========================================================================== */

:root {
    --primary-green: rgb(0, 105, 62);
    --bg-green: rgba(0, 105, 62, 0.2);
    --dark-text: rgba(0, 0, 0, 0.7);
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --max-width: 900px;
    --spacing-unit: 1rem;
}

/* Base Styles
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Dartmouth Ruzicka', Georgia, serif;
    font-size: 11pt;
    line-height: 1.35;
    color: var(--dark-text);
    background-color: white;
    padding-top: 60px; /* Space for sticky download bar */
}

/* Download Bar
   ========================================================================== */

.cv-download-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-green);
    color: white;
    padding: 0.75rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cv-download-bar .bar-content {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cv-download-bar .cv-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.cv-download-bar .download-btn {
    background-color: white;
    color: var(--primary-green);
    border: none;
    padding: 0.5rem 1.5rem;
    font-family: 'Dartmouth Ruzicka', Georgia, serif;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.cv-download-bar .download-btn:hover {
    background-color: var(--bg-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Main Content Container
   ========================================================================== */

.cv-content {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* CV Header
   ========================================================================== */

.cv-header {
    text-align: left;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: none;
}

.cv-header h1 {
    font-size: 17pt;
    font-weight: normal;
    color: var(--dark-text);
    margin-bottom: 0;
    letter-spacing: 0;
}

.cv-header .contact-info {
    font-size: 11pt;
    line-height: 1.3;
    color: var(--dark-text);
}

.cv-header .contact-info p {
    margin: 0;
}

.cv-header .contact-info p.space-after {
    margin-bottom: 0.5rem;
}

/* Headings
   ========================================================================== */

h2 {
    font-size: 1.3rem;
    font-weight: normal;
    color: var(--dark-text);
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    border-bottom: none;
    text-transform: none;
    letter-spacing: 0;
}

h3 {
    font-size: 1.05rem;
    font-weight: normal;
    color: var(--dark-text);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1rem;
    font-weight: normal;
    font-style: italic;
    color: var(--dark-text);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Lists
   ========================================================================== */

ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.35;
}

/* Reverse-numbered lists for publications and awards */
/* Use native browser support for reversed lists */
ol[reversed] {
    list-style-position: outside;
    padding-left: 2.5rem;
}

ol[reversed] > li {
    padding-left: 0.5rem;
}

ol[reversed] > li::marker {
    font-weight: normal;
    color: var(--dark-text);
}

/* Paragraphs
   ========================================================================== */

p {
    margin-bottom: 0.25rem;
    margin-top: 0;
    text-align: justify;
}

/* Reduce spacing for paragraphs in section content (like Advisor/Dissertation lines) */
section p {
    margin-bottom: 0.1rem;
}

/* Section notes (from footnotes) */
.section-note {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--dark-text);
}

/* Links
   ========================================================================== */

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

/* Text Styles
   ========================================================================== */

.small-caps {
    font-variant: small-caps;
    letter-spacing: 0.5px;
}

.underline {
    text-decoration: underline;
}

em, i {
    font-style: italic;
}

strong, b {
    font-weight: bold;
}

.block-spacer {
    display: block;
    height: 0.4rem;
}

/* Two-Column Lists
   ========================================================================== */

.two-column-list {
    column-count: 2;
    column-gap: 2rem;
    margin-bottom: 1.5rem;
}

.two-column-list li {
    break-inside: avoid;
    page-break-inside: avoid;
}

/* Special Sections
   ========================================================================== */

.employment-entry,
.education-entry,
.award-entry {
    margin-bottom: 1.5rem;
}

.employment-entry .position {
    font-weight: bold;
    color: var(--dark-text);
}

.employment-entry .institution {
    font-style: italic;
    margin-left: 0.5rem;
}

.employment-entry .dates {
    color: var(--primary-green);
    font-weight: bold;
}

.education-entry .degree {
    font-weight: bold;
}

.education-entry .institution {
    font-style: italic;
}

/* Publications
   ========================================================================== */

.publication {
    margin-bottom: 1rem;
    text-align: justify;
}

.publication .authors {
    font-weight: normal;
}

.publication .title {
    font-weight: bold;
}

.publication .journal {
    font-style: italic;
}

.publication .year {
    color: var(--primary-green);
}

/* CV Footer
   ========================================================================== */

.cv-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--primary-green);
    text-align: center;
    font-size: 0.9rem;
    color: var(--dark-text);
    font-style: italic;
}

/* Responsive Design - Tablet
   ========================================================================== */

@media screen and (max-width: 768px) {
    body {
        padding-top: 80px;
    }

    .cv-download-bar {
        padding: 0.75rem 1rem;
    }

    .cv-download-bar .bar-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .cv-download-bar .cv-title {
        font-size: 1rem;
    }

    .cv-content {
        margin: 1rem;
        padding: 1.5rem;
    }

    .cv-header h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    .two-column-list {
        column-count: 1;
    }

    ul, ol {
        margin-left: 1.5rem;
    }

    ol[reversed] > li {
        padding-left: 2rem;
    }
}

/* Responsive Design - Mobile
   ========================================================================== */

@media screen and (max-width: 480px) {
    body {
        font-size: 10pt;
        padding-top: 90px;
    }

    .cv-download-bar {
        padding: 0.5rem;
    }

    .cv-content {
        margin: 0.5rem;
        padding: 1rem;
        box-shadow: none;
    }

    .cv-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .cv-header h1 {
        font-size: 1.75rem;
    }

    .cv-header .contact-info {
        font-size: 0.85rem;
    }

    h2 {
        font-size: 1.1rem;
        margin-top: 1.5rem;
    }

    h3 {
        font-size: 0.95rem;
    }

    ul, ol {
        margin-left: 1rem;
    }

    ol[reversed] > li {
        padding-left: 1.5rem;
    }

    ol[reversed] > li::before {
        min-width: 1.5rem;
    }

    .cv-footer {
        margin-top: 3rem;
        padding-top: 1.5rem;
        font-size: 0.85rem;
    }
}

/* Print Styles
   ========================================================================== */

@media print {
    @page {
        margin: 0.75in;
        size: letter;
    }

    body {
        font-size: 10pt;
        padding-top: 0;
        background: white;
    }

    .cv-download-bar {
        display: none;
    }

    .cv-content {
        max-width: 100%;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .cv-header {
        page-break-after: avoid;
        border-bottom: 2px solid var(--primary-green);
    }

    .cv-header h1 {
        font-size: 20pt;
        color: var(--primary-green);
    }

    h2 {
        font-size: 13pt;
        page-break-after: avoid;
        border-bottom: 1px solid var(--border-gray);
        color: var(--primary-green);
    }

    h3 {
        font-size: 11pt;
        page-break-after: avoid;
    }

    h4 {
        font-size: 10pt;
        page-break-after: avoid;
    }

    .employment-entry,
    .education-entry,
    .award-entry,
    .publication {
        page-break-inside: avoid;
    }

    li {
        page-break-inside: avoid;
    }

    .two-column-list {
        column-count: 2;
        column-gap: 1.5rem;
    }

    a {
        color: var(--primary-green);
        text-decoration: none;
    }

    a[href^="http"]:after {
        content: "";
    }

    .cv-footer {
        margin-top: 2rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-gray);
        page-break-before: avoid;
    }

    /* Ensure proper page breaks */
    section {
        page-break-inside: avoid;
    }

    /* Orphan and widow control */
    p, li {
        orphans: 3;
        widows: 3;
    }

    /* Color adjustments for printing */
    * {
        color-adjust: exact;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Print optimization for publication lists */
@media print {
    ol[reversed] > li::before {
        color: black;
    }
}

/* Utility Classes
   ========================================================================== */

.no-break {
    page-break-inside: avoid;
    break-inside: avoid;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
