/* Base Variables */
:root {
    /* CSUB Official Colors */
    --csub-blue: #003594;
    --csub-dark-blue: #001A70;
    --csub-gold: #FFC72C;
    --csub-gray: #707372;

    /* Theme Mapping */
    --primary-color: var(--csub-blue);
    --primary-dark: var(--csub-dark-blue);
    --accent-color: var(--csub-gold);

    --text-color: #1f2937;
    --light-text: #4b5563;
    --bg-color: #ffffff;
    --light-bg: #f8fafc;
    /* Slightly blue-tinted gray for freshness */
    --white: #ffffff;
    --border-color: #e2e8f0;

    --max-width: 1100px;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    /* Headings in CSUB Blue */
    margin-bottom: 0.5em;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
}

/* Header & Nav */
.header {
    background: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
    border-top: 5px solid var(--primary-color);
    /* Blue top bar */
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.brand-logo {
    height: 50px;
    /* Adjust based on the actual logo aspect ratio */
    width: auto;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-list {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-list a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-color);
}

.nav-list a:hover {
    color: var(--primary-color);
}

.btn-contact {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1.2rem;
    border-radius: 9999px;
    transition: all 0.3s;
}

.btn-contact:hover {
    background-color: var(--accent-color);
    color: var(--primary-color) !important;
    /* Gold bg, Blue text on hover */
    font-weight: 600;
}

/* Mobile Menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 6rem 0;
    /* Subtle gradient using low-opacity CSUB blue */
    background: linear-gradient(135deg, rgba(0, 53, 148, 0.05) 0%, rgba(255, 199, 44, 0.05) 100%);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-text h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.hero-text h2 {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--light-text);
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
    /* Gold accent line */
    padding-left: 1rem;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    /* Slightly squarer for academic look */
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 53, 148, 0.2);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--light-bg);
    transform: translateY(-2px);
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section.bg-light {
    background-color: var(--light-bg);
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
    margin-bottom: 3.5rem;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    /* Gold underline */
}

/* Timeline (Education) */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 6px;
    width: 1rem;
    height: 1rem;
    background-color: var(--accent-color);
    /* Gold dots */
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--accent-color);
}

.timeline-year {
    display: inline-block;
    background-color: #e0e7ff;
    /* VERY light blue */
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    margin-bottom: 0.2rem;
    color: var(--text-color);
}

.institution {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.description {
    font-size: 0.95rem;
    color: var(--light-text);
    margin-bottom: 0.5rem;
}

.link-small {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

/* Cards (Appointments) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-top: 4px solid var(--primary-color);
    /* Blue top border feature */
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card h3 {
    color: var(--primary-dark);
}

.card .role {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.card .date {
    font-size: 0.9rem;
    color: var(--light-text);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Publication List */
.publication-list {
    max-width: 900px;
    margin: 0 auto;
}

.publication-item {
    display: flex;
    flex-direction: column;
    /* Stack main content and abstract */
    padding: 0;
    /* Remove padding from container */
    background-color: white;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
    /* Show it's clickable */
}

.publication-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Stronger shadow on hover */
}

.pub-main-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
}

.pub-details {
    flex: 1;
    padding-right: 1.5rem;
}

.publication-abstract {
    display: none;
    /* Hidden by default */
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--light-text);
    font-size: 0.95rem;
    border-top: 1px dashed var(--border-color);
    margin-top: -0.5rem;
    /* Pull closer to content */
    padding-top: 1rem;
    background-color: #f8fafc;
    /* Very light background for abstract */
}

.publication-item.active .publication-abstract {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pub-badge {
    background-color: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.publication-item h3 {
    font-size: 1.15rem;
    font-family: var(--font-body);
    /* Publications easier to read in sans-serif */
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

.authors {
    font-size: 0.95rem;
    color: var(--light-text);
    margin-bottom: 0.2rem;
}

.journal {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 0;
}

.btn-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
    padding-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    display: inline-block;
}

.btn-text:hover {
    color: var(--csub-dark-blue);
    text-decoration: underline;
}

.pub-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

/* Teaching & Service */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.course-group h3 {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.course-list li {
    margin-bottom: 0.8rem;
    font-size: 1rem;
    position: relative;
    padding-left: 1.2rem;
}

.course-list li::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.service-list {
    max-width: 800px;
    margin: 0 auto;
}

.service-item {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 3px solid var(--border-color);
}

.service-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

/* Footer CTA */
.footer-cta {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 5rem 0;
}

.footer-cta h2 {
    color: var(--accent-color);
    /* Gold heading on blue bg */
    margin-bottom: 1rem;
}

.footer-cta p {
    color: #e2e8f0;
    margin-bottom: 2rem;
}

.btn-outline-white {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    margin: 0 0.5rem;
    transition: all 0.3s;
    text-decoration: none;
    min-width: 180px;
    /* Ensure uniform width */
    height: 54px;
    /* Ensure uniform height */
}

.btn-outline-white:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.student-profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem auto;
    border: 3px solid var(--accent-color);
    display: block;
}

.btn-icon {
    height: 24px;
    /* Fixed height for icons */
    width: auto;
    display: block;
    object-fit: contain;
}

/* Footer */
.footer {
    background-color: #f1f5f9;
    text-align: center;
    padding: 2rem 0;
    color: var(--gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }

    .hamburger {
        display: block;
        width: 30px;
        height: 24px;
        position: relative;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background-color: var(--primary-color);
        margin-bottom: 5px;
        border-radius: 2px;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        display: none;
    }

    .nav.active {
        display: block;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-contact {
        display: block;
        text-align: center;
        width: 100%;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .timeline {
        padding-left: 1rem;
        border-left: none;
    }

    .timeline-item::before {
        display: none;
    }

    .publication-item {
        flex-direction: column;
    }

    .btn-text {
        padding-top: 1rem;
    }
}