/* CV Stylesheet */

:root {
    --bg-color: #f9f9f9;
    --text-color: #333;
    --heading-color: #2c3e50;
    --link-color: #3498db;
    --border-color: #bdc3c7;
    --nav-bg: #f8f9fa;
    --nav-border: #e9ecef;
    --nav-hover: #e9ecef;
    --code-bg: #ecf0f1;
    --table-header-bg: #34495e;
    --table-header-text: white;
    --blockquote-border: #3498db;
    --line-block-bg: #ecf0f1;
    --line-block-border: #3498db;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --link-color: #5dade2;
    --border-color: #555555;
    --nav-bg: #2c2c2c;
    --nav-border: #444444;
    --nav-hover: #444444;
    --code-bg: #2c2c2c;
    --table-header-bg: #444444;
    --table-header-text: #e0e0e0;
    --blockquote-border: #5dade2;
    --line-block-bg: #2c2c2c;
    --line-block-border: #5dade2;
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 4px;
    padding: 0.5em;
    cursor: pointer;
    font-size: 1em;
    z-index: 1000;
}
.theme-toggle:hover {
    background: var(--nav-hover);
}

body {
    font-family: 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
    position: relative;
}

h1.title {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.2em;
    color: var(--heading-color);
    border-bottom: 2px solid var(--link-color);
    padding-bottom: 0.3em;
}

p.subtitle {
    font-size: 1.8em; /* Almost as big as title (2.5em) but not quite */
    font-weight: normal;
    text-align: center;
    margin-top: 0.2em;
    margin-bottom: 1.5em;
    color: var(--text-color);
    font-style: italic;
}

.line-block {
    margin: 1em 0;
    padding: 0.5em;
    background-color: var(--line-block-bg);
    border-left: 4px solid var(--line-block-border);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.line-block br {
    margin-bottom: 0.5em;
}

/* Navigation */
nav#TOC {
    background-color: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 4px;
    padding: 1em;
    margin: 1.5em 0;
}

nav#TOC ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav#TOC li {
    margin-bottom: 0.25em;
}

nav#TOC a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    padding: 0.5em 0.75em;
    border-radius: 3px;
    transition: background-color 0.2s;
}

nav#TOC a:hover {
    background-color: var(--nav-hover);
    color: var(--text-color);
}

nav#TOC ul ul {
    margin-left: 1em;
    border-left: 1px solid #dee2e6;
    padding-left: 1em;
}

nav#TOC ul ul a {
    padding: 0.25em 0.5em;
    font-size: 0.9em;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 1.8em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.2em;
}

h3 {
    font-size: 1.3em;
}

h4 {
    font-size: 1.1em;
}

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-left: 2em;
}

/* Code blocks */
pre {
    background-color: var(--code-bg);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 0.5em;
    text-align: left;
}

th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--blockquote-border);
    padding-left: 1em;
    margin-left: 0;
    font-style: italic;
    color: var(--text-color);
}

/* Footer */
footer {
    margin-top: 3em;
    padding-top: 1em;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-color);
    font-size: 0.9em;
}

/* Responsive Design */

/* Tablet and smaller desktop */
@media (max-width: 1024px) {
    body {
        padding: 15px;
        max-width: 100%;
    }

    h1.title {
        font-size: 2.2em;
    }

    p.subtitle {
        font-size: 1.6em;
    }

    nav#TOC {
        padding: 0.75em;
        margin: 1em 0;
    }

    nav#TOC a {
        padding: 0.4em 0.6em;
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 16px;
        line-height: 2.0;
    }

    h1.title {
        font-size: 2em;
        margin-bottom: 0.2em;
    }

    p.subtitle {
        font-size: 1.5em;
        margin-bottom: 1.2em;
    }

    nav#TOC {
        padding: 0.5em;
        margin: 1em 0;
        font-size: 0.9em;
    }

    .line-block {
        margin: 1em -10px; /* Extend to screen edges */
        padding: 1em;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    h1, h2, h3, h4, h5, h6 {
        margin-top: 1.5em;
        margin-bottom: 0.8em;
    }

    h1 {
        font-size: 1.6em;
    }

    h2 {
        font-size: 1.4em;
    }

    h3 {
        font-size: 1.2em;
    }

    ul, ol {
        margin-left: 1.5em;
        margin-top: 0.8em;
        margin-bottom: 0.8em;
    }

    li {
        margin-bottom: 0.6em;
    }

    p {
        margin-top: 0.8em;
        margin-bottom: 0.8em;
    }

    pre {
        margin: 1.2em -10px;
        border-radius: 0;
        overflow-x: auto;
        font-size: 14px;
    }

    table {
        font-size: 0.95em;
        margin: 0.8em -10px;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }

    th, td {
        padding: 0.5em;
    }

    footer {
        margin-top: 2em;
        font-size: 0.9em;
    }

    /* Hide less critical sections on mobile to reduce clutter */
    #notable-projects,
    #certifications {
        display: none;
    }

    /* Index page mobile adjustments */
    .index-page .container {
        padding: 20px;
    }

    .index-page .profile {
        padding: 20px;
    }

    .index-page h1 {
        font-size: 1.8em;
    }

    .index-page .profile h2 {
        font-size: 1.3em;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    body {
        padding: 8px;
        font-size: 14px;
        line-height: 1.9;
    }

    h1.title {
        font-size: 1.8em;
    }

    p.subtitle {
        font-size: 1.3em;
    }

    nav#TOC {
        padding: 0.5em;
        margin: 0.5em 0;
        font-size: 0.8em;
    }

    .line-block {
        margin: 0.8em -8px;
        padding: 0.8em;
    }

    h1, h2, h3, h4, h5, h6 {
        margin-top: 1.3em;
        margin-bottom: 0.6em;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }

    h3 {
        font-size: 1.1em;
    }

    ul, ol {
        margin-left: 1.5em;
        margin-top: 0.6em;
        margin-bottom: 0.6em;
    }

    li {
        margin-bottom: 0.5em;
    }

    p {
        margin-top: 0.6em;
        margin-bottom: 0.6em;
    }

    pre {
        margin: 1em -8px;
        font-size: 12px;
    }

    table {
        margin: 0.6em -8px;
        font-size: 0.85em;
    }

    footer {
        margin-top: 1.5em;
        font-size: 0.85em;
    }

    /* Hide less critical sections on small mobile */
    #notable-projects,
    #certifications {
        display: none;
    }

    /* Index page small mobile adjustments */
    .index-page .container {
        padding: 15px;
    }

    .index-page .selector {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .index-page .profile {
        padding: 15px;
    }

    .index-page h1 {
        font-size: 1.6em;
    }

    .index-page .profile h2 {
        font-size: 1.2em;
    }
}

/* Index page styles */
.index-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    position: static;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    max-width: none;
}

.index-page .container {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-color);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
}

.index-page h1 {
    color: var(--heading-color);
    margin-bottom: 10px;
}

.index-page p.subtitle {
    color: var(--text-color);
    margin-bottom: 40px;
    font-size: 1.1em;
}

.index-page .selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.index-page .profile {
    background-color: var(--bg-color);
    padding: 30px;
    border-radius: 8px;
    border: 1px solid var(--nav-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.index-page .profile:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.08);
}

.index-page .profile-span-2 {
	grid-column: span 2;
}

.index-page .profile h2 {
    color: var(--heading-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.index-page .links p {
    margin: 10px 0;
    text-align: center;
}

.index-page .links a {
    text-decoration: none;
    color: var(--link-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

.index-page .links a:hover {
    color: var(--link-color);
    text-decoration: underline;
    filter: brightness(0.8);
}

.index-page .separator {
    color: var(--border-color);
    margin: 0 10px;
}

.index-page .pdf-link img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

[data-theme="dark"] .index-page .container {
    background: var(--bg-color);
}

/* Print styles */
@media print {
    body {
        font-size: 11pt;
        line-height: 1.3;
        max-width: none;
        margin: 0.4in;
        padding: 0;
        color: #000;
        background: #fff;
        font-family: 'Times New Roman', serif;
    }

    nav#TOC {
        display: none; /* Hide navigation in print */
    }

    .theme-toggle {
        display: none; /* Hide theme toggle in print */
    }

    .container {
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
    }

    h1.title {
        font-size: 20pt;
        page-break-after: avoid;
        margin-bottom: 0.5em;
        border-bottom: 2pt solid #000;
        padding-bottom: 0.3em;
    }

    p.subtitle {
        font-size: 14pt;
        page-break-after: avoid;
        margin-bottom: 1em;
        font-style: italic;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        color: #000;
        margin-top: 1em;
        margin-bottom: 0.5em;
    }

    h1 {
        font-size: 16pt;
        border-bottom: 1pt solid #ccc;
        padding-bottom: 0.2em;
    }

    h2 {
        font-size: 14pt;
        border-bottom: 1pt solid #ccc;
        padding-bottom: 0.1em;
    }

    h3 {
        font-size: 12pt;
    }

    h4 {
        font-size: 11pt;
    }

    p {
        margin: 0.5em 0;
        orphans: 3;
        widows: 3;
    }

    ul, ol {
        margin: 0.5em 0;
        padding-left: 1.5em;
        page-break-inside: avoid;
    }

    li {
        margin-bottom: 0.3em;
        page-break-inside: avoid;
    }

    .line-block {
        border: 1pt solid #ccc;
        background: #f5f5f5;
        padding: 0.5em;
        margin: 0.5em 0;
        page-break-inside: avoid;
        font-size: 10pt;
    }

    a {
        text-decoration: none;
        color: #000;
        border-bottom: 1pt dotted #000;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    a[href^="mailto"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

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

    pre {
        border: 1pt solid #ccc;
        page-break-inside: avoid;
        font-size: 9pt;
        background: #f5f5f5;
        padding: 0.5em;
        margin: 0.5em 0;
    }

    code {
        font-size: 9pt;
        font-family: 'Courier New', monospace;
    }

    table {
        page-break-inside: avoid;
        margin: 0.5em 0;
        font-size: 10pt;
        border-collapse: collapse;
    }

    th, td {
        border: 1pt solid #ccc;
        padding: 0.3em;
        text-align: left;
        vertical-align: top;
    }

    th {
        background: #f0f0f0;
        font-weight: bold;
    }

    blockquote {
        border-left: 3pt solid #ccc;
        padding-left: 0.5em;
        margin: 0.5em 0;
        font-style: italic;
        page-break-inside: avoid;
    }

    img {
        display: none; /* Hide images in print */
    }

    footer {
        page-break-inside: avoid;
        margin-top: 1em;
        padding-top: 0.5em;
        border-top: 1pt solid #ccc;
        font-size: 9pt;
        color: #666;
    }

    /* Ensure important sections stay together */
    .section {
        page-break-inside: avoid;
    }

    /* Professional Experience section - avoid breaking between jobs */
    .section > ul > li {
        page-break-inside: avoid;
        margin-bottom: 1em;
    }

    /* Index page print adjustments */
    .index-page {
        height: auto;
        min-height: auto;
        display: block;
    }

    .index-page .container {
        padding: 0;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
    }

    .index-page .selector {
        display: block; /* Stack profiles vertically */
    }

    .index-page .profile {
        margin-bottom: 1.5em;
        border: 1pt solid #ccc;
        padding: 0.5em;
        page-break-inside: avoid;
        background: transparent;
    }

    .index-page .profile h2 {
        margin-bottom: 0.5em;
        page-break-after: avoid;
    }

    .index-page .links p {
        margin: 0.3em 0;
    }

    .index-page .pdf-link img {
        display: none;
    }

    /* Hide non-essential elements */
    .pdf-link img,
    .separator,
    #notable-projects,
    #certifications {
        display: none;
    }

    /* Ensure contact information is prominent */
    .line-block:first-child {
        border: 2pt solid #000;
        background: #f9f9f9;
        font-weight: bold;
        margin-bottom: 1em;
    }
}

@media (max-width: 768px) {
  .index-page .selector {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
}


