/* ============================================================
   PROFESSIONAL ACADEMIC WEBSITE - Main Stylesheet
   Juan Francisco Carrascoza Mayen, Ph.D.

   HOW TO EDIT:
   - Colors are defined in :root below. Change them there to
     update the entire site at once.
   - Font sizes use 'rem' units (1rem = 16px by default).
   ============================================================ */

/* --- Color Palette & Global Variables --- */
:root {
    --primary:       #1a3a5c;   /* Dark navy blue */
    --primary-light: #2c5f8a;   /* Lighter blue for hover */
    --primary-dark:  #0f2440;   /* Very dark blue */
    --accent:        #3498db;   /* Bright accent blue */
    --text:          #333333;   /* Main text color */
    --text-light:    #666666;   /* Secondary text */
    --bg:            #ffffff;   /* Page background */
    --bg-light:      #f5f7fa;   /* Light section background */
    --bg-alt:        #eef2f7;   /* Alternating background */
    --border:        #dce3eb;   /* Border color */
    --white:         #ffffff;
    --shadow:        0 2px 10px rgba(0,0,0,0.08);
    --shadow-hover:  0 4px 20px rgba(0,0,0,0.12);
    --radius:        6px;
    --max-width:     1100px;
    --nav-height:    70px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

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

img {
    max-width: 100%;
    height: auto;
}

/* --- Navigation Bar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
}

.navbar .logo img {
    height: 45px;
    width: auto;
}

.navbar .logo:hover {
    text-decoration: none;
    color: var(--white);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255,255,255,0.15);
    color: var(--white);
    text-decoration: none;
}

/* Hamburger menu (mobile) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--white);
    margin: 5px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Language selector */
.lang-selector {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-left: 1rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: var(--radius);
    background: transparent;
    cursor: default;
}

/* --- Page Content Area --- */
.page-content {
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height) - 80px);
}

/* --- Hero / Header Section --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 3rem 2rem;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.hero-photo {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.hero-text h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.hero-text .subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.hero-text .affiliation {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.5;
}

.hero-text .contact-line {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.hero-text .contact-line a {
    color: rgba(255,255,255,0.95);
}

.hero-text .contact-line a:hover {
    color: var(--white);
}

/* --- Section Containers --- */
.section {
    padding: 2.5rem 2rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

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

.section-alt .section {
    /* inherits max-width and padding */
}

.section h2 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

.section h3 {
    font-size: 1.2rem;
    color: var(--primary-light);
    margin: 1.5rem 0 0.75rem;
}

.section p {
    margin-bottom: 1rem;
}

/* --- Page Header (non-home pages) --- */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 2rem 2rem;
    text-align: center;
}

.page-header h1 {
    font-size: 2rem;
    margin: 0;
}

.page-header p {
    opacity: 0.85;
    margin-top: 0.35rem;
    font-size: 1.05rem;
}

/* --- Cards --- */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card h3 {
    margin-top: 0;
    color: var(--primary);
}

.card .meta {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

/* --- Publication List --- */
.pub-list {
    list-style: none;
    counter-reset: pub-counter;
}

.pub-list li {
    counter-increment: pub-counter;
    padding: 1rem 1rem 1rem 3.5rem;
    margin-bottom: 0.75rem;
    background: var(--white);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}

.pub-list li::before {
    content: counter(pub-counter) ".";
    position: absolute;
    left: 1rem;
    top: 1rem;
    font-weight: 700;
    color: var(--primary);
}

.pub-list .pub-title {
    font-weight: 600;
}

.pub-list .pub-authors {
    color: var(--text-light);
    font-size: 0.95rem;
}

.pub-list .pub-journal {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.93rem;
}

.pub-list .pub-doi a {
    font-size: 0.88rem;
}

/* --- Teaching Course Cards --- */
.course-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--accent);
}

.course-card h3 {
    margin-top: 0;
    font-size: 1.3rem;
    color: var(--primary);
}

.course-card .course-code {
    display: inline-block;
    background: var(--bg-alt);
    color: var(--primary);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.course-card ul {
    margin-left: 1.25rem;
    margin-top: 0.5rem;
}

.course-card li {
    margin-bottom: 0.35rem;
}

/* --- CV Timeline --- */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item .date {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 600;
}

.timeline-item h3 {
    margin: 0.15rem 0 0.1rem;
    font-size: 1.1rem;
    color: var(--primary);
}

.timeline-item .institution {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.95rem;
}

.timeline-item p {
    margin-top: 0.35rem;
    font-size: 0.95rem;
}

/* --- Interest Tags --- */
.interest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1rem;
}

.interest-tag {
    background: var(--bg-alt);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* --- Skills Grid --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.skill-category {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.skill-category h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.2rem 0;
    font-size: 0.93rem;
    color: var(--text-light);
}

.skill-category li::before {
    content: "› ";
    color: var(--accent);
    font-weight: 700;
}

/* --- Awards List --- */
.awards-list {
    list-style: none;
}

.awards-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    align-items: baseline;
}

.awards-list li:last-child {
    border-bottom: none;
}

.awards-list .year {
    font-weight: 700;
    color: var(--primary);
    min-width: 4rem;
    flex-shrink: 0;
}

/* --- Conference List --- */
.conf-list {
    list-style: none;
}

.conf-list li {
    padding: 0.75rem 0 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.conf-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.15rem;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}

.conf-list li:last-child {
    border-bottom: none;
}

/* --- Footer --- */
.footer {
    background-color: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.85rem;
}

.footer a {
    color: rgba(255,255,255,0.85);
}

.footer a:hover {
    color: var(--white);
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background-color: var(--primary);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 0.75rem 1rem;
    }

    .lang-selector {
        display: none;
    }

    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .hero-photo {
        width: 140px;
        height: 140px;
    }

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

    .section h2 {
        font-size: 1.35rem;
    }

    .timeline-item {
        padding-left: 1rem;
    }

    .awards-list li {
        flex-direction: column;
        gap: 0.15rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }

    .section {
        padding: 1.5rem 1rem;
    }

    .pub-list li {
        padding-left: 2.5rem;
    }
}
