/*
================================================
TABLE OF CONTENTS
================================================
1.  RESET & ROOT VARIABLES
2.  BASE & TYPOGRAPHY STYLES
3.  LAYOUT & CONTAINER
4.  COMPONENTS
    - Navigation
    - Header / Hero Section
    - Cards
    - Buttons
    - Badges
    - Tabs
    - Lists
5.  PAGE-SPECIFIC STYLES
    - Research Page
    - Team Page
    - Media Page
6.  UTILITY CLASSES
7.  RESPONSIVE DESIGN
================================================
*/

/* 1. RESET & ROOT VARIABLES */
:root {
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-headings: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --color-background: #f8f9fa; /* Lighter, cleaner background */
    --color-foreground: #212529; /* Darker, more readable text */
    --color-muted-foreground: #6c757d;

    --color-card: #ffffff;
    --color-card-foreground: #212529;

    --color-primary: #005f73; /* A sophisticated, deep teal */
    --color-primary-foreground: #ffffff;
    --color-primary-hover: #004c5c;

    --color-secondary: #e9ecef;
    --color-secondary-foreground: #343a40;

    --color-border: #dee2e6; /* Softer border color */
    --color-accent: #ee9b00; /* A warm, contrasting accent */

    --radius: 0.375rem; /* Slightly smaller radius for a sharper look */
    --max-width: 960px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 2. BASE & TYPOGRAPHY STYLES */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--color-background);
    color: var(--color-foreground);
    font-family: var(--font-primary);
    margin: 0;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 700; /* Bolder headings */
    line-height: 1.3;
    color: var(--color-foreground);
    margin: 0 0 1rem 0;
}

p {
    color: var(--color-muted-foreground);
    line-height: 1.7;
    margin: 0 0 1rem 0;
}
p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.icon {
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    stroke-width: 2;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
}

/* 3. LAYOUT & CONTAINER */
#container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem;
    flex-grow: 1;
}

.main-footer {
    background-color: var(--color-card);
    border-top: 1px solid var(--color-border);
    margin-top: 3rem;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--color-muted-foreground);
}
.main-footer p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
}

/* 4. COMPONENTS */

/* Navigation */
.main-nav {
    background-color: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}
.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 4.5rem;
}
.nav-logo h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-foreground);
    margin: 0;
}
.nav-links-desktop { display: none; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-muted-foreground);
    transition: all 0.2s ease-in-out;
}
.nav-link:hover {
    background-color: var(--color-secondary);
    color: var(--color-primary);
    text-decoration: none;
}
.nav-link.active {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
    font-weight: 600;
}
.mobile-menu-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-foreground);
}
.mobile-menu {
    border-top: 1px solid var(--color-border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.mobile-menu.hidden { display: none; }

/* Header / Hero Section */
.page-header, .hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem 0;
}
.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--color-foreground);
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-primary);
    font-weight: 500;
    margin: 0;
}
.hero-meta, .contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--color-muted-foreground);
}
.hero-meta > div, .contact-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Cards */
.card {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
    text-align: left;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.card-title-small {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--color-foreground);
}
.card-highlight {
    background-color: #f7fdfd;
    border-left: 4px solid var(--color-primary);
}
.card-highlight .card-title {
    color: var(--color-primary);
}

/* Grid */
.grid-container {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
}
.button-outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: transparent;
}
.button-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
    text-decoration: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-default {
    background-color: var(--color-primary);
    color: var(--color-primary-foreground);
}
.badge-secondary {
    background-color: var(--color-secondary);
    color: var(--color-secondary-foreground);
}
.badge-outline {
    color: var(--color-muted-foreground);
    border-color: var(--color-border);
}

/* Tabs (Publications Page) */
.tabs-nav {
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}
.tab-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.25rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-muted-foreground);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
}
.tab-button:hover {
    color: var(--color-primary);
}
.tab-button .icon { font-size: 0.875em; }
.tab-button.active {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-content .authors {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin-bottom: 0.5rem;
}

/* Lists */
.course-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.course-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.course-item .badge { margin-top: 0.2rem; }

/* 5. PAGE-SPECIFIC STYLES */

/* Research Page */
.section-title {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.research-section h3 {
    font-size: 1.2rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}
.grant-header, .qualification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}
.grant-header > div {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.grant-amount {
    background-color: #fff4d5;
    color: #8c5a00;
    font-weight: 700;
}
.funder, .institution, .qualification-title {
    font-size: 0.9rem;
    color: var(--color-muted-foreground);
}

/* Team Page */
.team-card-container { max-width: 800px; margin: 0 auto; }
.team-card-header { text-align: center; padding-bottom: 1.5rem; }
.team-avatar {
    display: block;
    width: 9rem;
    height: 9rem;
    border-radius: 50%;
    object-fit: cover;
    margin: 1rem auto;
    border: 4px solid var(--color-card);
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.1);
}
.team-name { font-size: 1.75rem; }
.team-title { font-size: 1.125rem; color: var(--color-primary); }
.team-affiliation-small { font-size: 0.9rem; color: var(--color-muted-foreground); }
.contact-links {
    text-align: center;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}
.social-links a { display: inline-flex; align-items: center; gap: 0.35rem; }

.info-section h3 {
    font-size: 1.15rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: 700;
}
.info-section .info-list p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Gallery Page */
.gallery-section {
    margin-bottom: 3rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease-in-out;
}
.gallery-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item iframe {
    width: 100%;
    height: 200px;
    border: none;
}

.gallery-item .caption {
    padding: 1rem;
    font-size: 0.9rem;
    color: var(--color-muted-foreground);
    text-align: center;
}


/* 6. UTILITY CLASSES */
.text-center { text-align: center; }
.academic-blue { color: var(--color-primary); }
.academic-gray { color: var(--color-foreground); }
.academic-green { color: #15803d; }

/* 7. RESPONSIVE DESIGN */
@media (min-width: 768px) {
    .nav-links-desktop {
        display: flex;
        align-items: center;
        gap: 0.5rem; /* Tighter gap for a cleaner look */
    }
    .mobile-menu-button, .mobile-menu {
        display: none;
    }
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-content {
        padding: 2.5rem 2rem;
    }
    .tabs-nav { gap: 1.5rem; }
}