/* IPGP Design System Variables */
:root {
    --primary-color: #c41230;
    --secondary-color: #a00e26;
    --accent-color: #d4263b;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e1e5e9;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    
    --font-family: "Suisse Int'l", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    --font-family-headings: "Garnett", "Suisse Int'l", system-ui, Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
    --font-size-xl: 24px;
    --font-size-xxl: 32px;
    
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-xxl: 64px;
    
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-headings);
    font-weight: 500;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 500; /* match IPGP heading weight */
    margin-bottom: var(--spacing-sm);
    color: var(--text-dark);
}

h1 {
    font-size: var(--font-size-xxl);
    font-weight: 500; /* was 700; harmonized with IPGP */
}

h2 {
    font-size: var(--font-size-xl);
}

h3 {
    font-size: var(--font-size-large);
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-light);
}

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

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

/* Header */
.header {
    background-color: #c41230;
    color: white;
    padding: 20px 0;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.ipgp-logo {
    height: 60px;
    width: auto;
}

.institute-name {
    display: flex;
    flex-direction: column;
}

.institute-main {
    font-size: var(--font-size-large);
    font-weight: 600;
    color: var(--primary-color);
}

.institute-tagline {
    font-size: var(--font-size-small);
    color: var(--white);
    font-style: italic;
}

/* Navigation */
.navigation {
    background-color: var(--primary-color);
    padding: 0;
}

/* Make nav container split menu (left) and profile (right) */
.navigation .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--white);
    font-weight: 500;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--secondary-color);
    text-decoration: none;
    border-bottom-color: var(--accent-color);
}

/* Compact profile summary to the right of nav */
.profile-summary {
    color: var(--white);
    text-align: right;
    line-height: 1.2;
}
.profile-summary .profile-name { font-weight: 600; }
.profile-summary .profile-role { opacity: 0.9; font-size: 0.95em; }
.profile-summary .profile-affiliation { opacity: 0.8; font-size: 0.9em; }
.profile-summary .profile-contact { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.profile-summary .profile-contact span { opacity: 0.8; font-size: 0.88em; }

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 12px;
    background: #000;
    color: #fff;
    z-index: 10000;
}

/* Twitch subscribe CTA (moved from inline) */
.twitch-cta { position: fixed; right: 16px; bottom: 16px; background: #9146FF; color: #fff; text-decoration: none; padding: 12px 16px; border-radius: 999px; font-weight: 500; box-shadow: 0 6px 14px rgba(0,0,0,.25); z-index: 1000; display: inline-flex; align-items: center; gap: 10px; animation: twitchPulse 1.8s ease-in-out infinite; }
.twitch-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0,0,0,.28); }
.twitch-cta .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,0.8); animation: dotPulse 1.8s ease-out infinite; }
@keyframes twitchPulse { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.15); } }
@keyframes dotPulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.8); } 70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) { .twitch-cta, .twitch-cta .dot { animation: none; } }

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: var(--spacing-xxl) 0;
}

.hero-section p {
    color: rgba(255, 255, 255, 0.95);
}

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

.name {
    color: var(--white);
    margin-bottom: var(--spacing-xs);
}

.title {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    margin-bottom: var(--spacing-xs);
}

.affiliation {
    font-size: var(--font-size-large);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-lg);
}

.contact-info {
    display: inline-block;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.contact-item {
    margin-bottom: var(--spacing-xs);
    color: rgba(255, 255, 255, 0.9);
}

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

/* Page-specific hero sections */
.teaching-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.research-hero {
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
}

.publications-hero {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.page-title {
    font-size: var(--font-size-xxl);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.page-subtitle {
    font-size: var(--font-size-large);
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.update-note {
    font-size: var(--font-size-small);
    opacity: 0.8;
    font-style: italic;
}

/* Teaching page styles */
.teaching-section {
    margin-bottom: var(--spacing-xxl);
}

.teaching-section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.info-box {
    background: var(--background-light);
    padding: var(--spacing-md);
    border-left: 4px solid var(--primary-color);
    margin-bottom: var(--spacing-lg);
    border-radius: var(--border-radius);
}

.teaching-periods {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
}

.period {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.period h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
}

.courses-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.course-item {
    background: var(--background-light);
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border-top: 3px solid var(--accent-color);
}

.course-item h4 {
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-large);
}

.course-item h5 {
    color: var(--primary-color);
    margin: var(--spacing-md) 0 var(--spacing-xs) 0;
    font-size: var(--font-size-base);
}

.resources ul {
    list-style-type: disc;
    margin-left: var(--spacing-md);
}

.responsibilities {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.responsibilities h4 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-sm);
}

.responsibilities ul {
    list-style-type: disc;
    margin-left: var(--spacing-md);
}

/* Research page styles */
.research-content {
    max-width: 900px;
    margin: 0 auto;
}

.research-section {
    margin-bottom: var(--spacing-xxl);
}

.research-section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.research-overview {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-lg);
}

.collaborations {
    background: var(--background-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.collaboration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.collaboration-group {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    border-top: 3px solid var(--accent-color);
}

.collaboration-group h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.collaboration-group ul {
    list-style-type: none;
    padding: 0;
}

.collaboration-group li {
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid #eee;
}

.collaboration-group li:last-child {
    border-bottom: none;
}

.research-projects {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.project-item {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
}

.project-item h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.other-interests {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.interest-area {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid #eee;
}

.interest-area:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.interest-area h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.interest-area ul {
    list-style-type: disc;
    margin-left: var(--spacing-md);
}

.publications-note {
    background: var(--accent-color);
    color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: var(--spacing-lg);
}

.publications-note a {
    color: white;
    font-weight: 600;
}

/* Publications page styles */
.publications-content {
    max-width: 1000px;
    margin: 0 auto;
}

.update-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.update-notice h2 {
    color: #856404;
    margin-bottom: var(--spacing-sm);
}

.orcid-link {
    color: #00873d;
    font-weight: 600;
    text-decoration: none;
}

.orcid-link:hover {
    text-decoration: underline;
}

.publications-sections {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-xl);
}

.pub-section {
    margin-bottom: var(--spacing-xl);
}

.pub-section h2 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.year-section {
    margin-bottom: var(--spacing-lg);
}

.year-section h3 {
    color: var(--secondary-color);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
    border-left: 4px solid var(--accent-color);
    padding-left: var(--spacing-sm);
}

.publication-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.pub-item {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--background-light);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--accent-color);
}

.pub-item.highlight {
    background: #f8f9fa;
    border-left-color: var(--primary-color);
    border-left-width: 4px;
}

.pub-number {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 30px;
    flex-shrink: 0;
}

.pub-content {
    line-height: 1.6;
}

.pub-content em {
    font-style: italic;
    color: var(--text-dark);
}

.pub-content strong {
    font-weight: 600;
    color: #000; /* was var(--primary-color); use black for all journals */
}

.earlier-years {
    background: var(--background-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-top: var(--spacing-md);
}

.highlight-pubs {
    margin-top: var(--spacing-lg);
}

.highlight-pubs h4 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.orcid-section {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.orcid-section h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.orcid-box {
    background: var(--background-light);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    border: 2px solid #00873d;
}

.orcid-button {
    display: inline-flex;
    align-items: center;
    background: #00873d;
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    margin-top: var(--spacing-sm);
    transition: var(--transition);
}

.orcid-button:hover {
    background: #006b2d;
    transform: translateY(-1px);
}

/* HAL Notice */
.hal-notice {
    background: linear-gradient(135deg, #c41230, #a00e26);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    text-align: center;
}

.hal-notice h2 {
    color: white;
    margin-bottom: 15px;
}

.hal-notice a {
    color: #fff;
    text-decoration: underline;
}

.hal-notice a:hover {
    color: #f0f0f0;
}

/* HAL live list tweaks */
#hal-live .update-note { margin-bottom: var(--spacing-md); }
#hal-live .year-section h3 { color: var(--secondary-color); }

/* Collapsible sections */
.collapsible .expand-toggle {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.collapsible .expand-toggle:hover {
    transform: scale(1.2);
}

.complete-list-note {
    font-style: italic;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #c41230;
    border-radius: 5px;
}

/* Footer */
.footer {
    background: #333;
    color: white;
    padding: 40px 0;
    text-align: center;
}

/* Research Page Specific Styles */
.research-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.highlight-item {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid #c41230;
}

.highlight-item h4 {
    color: #c41230;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.theme-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 3px solid #c41230;
}

.theme-item h4 {
    color: #c41230;
    margin-bottom: 15px;
}

.recent-papers {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.achievement-list {
    margin: 20px 0;
}

.achievement-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.achievement-item .year {
    background: #c41230;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    margin-right: 20px;
    min-width: 60px;
    text-align: center;
}

.achievement-content {
    flex: 1;
}

.collaboration-network {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.collaboration-group {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.collaboration-group h4 {
    color: #c41230;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.method-category {
    background: linear-gradient(135deg, #c41230, #a00e26);
    color: white;
    padding: 20px;
    border-radius: 10px;
}

.method-category h4 {
    color: white;
    margin-bottom: 15px;
}

.method-category ul li {
    margin-bottom: 8px;
    opacity: 0.9;
}

.future-goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.goal-item {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #c41230;
}

.goal-item h4 {
    color: #c41230;
    margin-bottom: 15px;
}

.impact-statement {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 30px;
    border-radius: 10px;
    margin: 30px 0;
    border-left: 4px solid #c41230;
}

.impact-statement h4 {
    color: #c41230;
    margin-bottom: 15px;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #e8e8e8;
        --text-light: #cfcfcf;
        --background-light: #1f1f1f;
        --border-color: #333;
    }
    body { background: #121212; }
    .header { background-color: #8f0e24; }
    .navigation { background-color: #8f0e24; }
    .nav-link:hover, .nav-link.active { background-color: #7a0c1f; }
    .publications-sections, .research-overview, .research-projects, .other-interests, .period, .collaboration-group, .goal-item, .theme-item, .orcid-section {
        background: #1b1b1b;
        box-shadow: none;
    }
    .pub-item { background: #151515; }
    .footer { background: #111; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .profile-summary { display: none; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .header-content {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        padding: var(--spacing-sm);
        font-size: var(--font-size-small);
    }
    
    .hero-section {
        padding: var(--spacing-lg) 0;
    }
    
    .name {
        font-size: var(--font-size-xl);
    }
    
    .title {
        font-size: var(--font-size-large);
    }
    
    .two-column {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .students-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .partner-logos {
        justify-content: center;
    }
    
    .collaboration-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-list {
        gap: var(--spacing-sm);
    }
    
    .course-item {
        padding: var(--spacing-sm);
    }
    
    .pub-item {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .pub-number {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .contact-info {
        width: 100%;
        text-align: center;
    }
    
    .content-section {
        padding: var(--spacing-lg) 0;
    }
    
    .column-left,
    .column-right {
        padding: var(--spacing-md);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
a:focus,
.nav-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .navigation,
    .footer {
        display: none;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .hero-section {
        background: none;
        color: var(--text-dark);
        padding: var(--spacing-md) 0;
    }
    
    .name,
    .title,
    .affiliation {
        color: var(--text-dark);
    }
    
    .contact-info {
        background: none;
        border: 1px solid var(--border-color);
    }
    
    .contact-item {
        color: var(--text-dark);
    }
    
    a {
        color: var(--text-dark);
        text-decoration: underline;
    }
}

/* PhD Students page styles */
.students-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.student-item {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-top: 3px solid var(--accent-color);
}

.student-item strong { color: var(--text-dark); }

.thesis-details {
    margin-top: 6px;
    display: grid;
    gap: 6px;
}

/* Title line inside thesis details */
.thesis-details > div:first-child span {
    font-weight: 500;
    color: var(--text-dark);
}

/* Co-supervisors line (placed right under the title) */
.thesis-details > div:nth-child(2) {
    color: var(--text-light);
    font-style: italic;
}

/* Online thesis link */
.thesis-details a {
    display: inline-block;
    margin-top: 2px;
}

@media (prefers-color-scheme: dark) {
    .student-item { background: #1b1b1b; box-shadow: none; }
}
