/* ==========================================================================
   1. GLOBAL CORE VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --hmc-gold: #EAAA00;
    --hmc-dark: #333333;
    --lab-blue: #006699;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --border: #e0e0e0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: var(--hmc-dark);
    background-color: var(--white);
    line-height: 1.6;
}

/* Base text elements */
p {
    margin-bottom: 20px;
    color: #555;
}

/* Page Layout Container for standard content pages */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Global Section Headings */
h2 {
    font-size: 1.75rem;
    color: var(--hmc-dark);
    border-left: 5px solid var(--hmc-gold);
    padding-left: 15px;
    margin: 50px 0 25px 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--hmc-gold); /* Reusable global golden bar */
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--lab-blue);
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
    padding-left: 15px;
    line-height: 1.7;
    text-align: center;

    margin: 0 auto 0 auto; /* (Top, Right, Bottom, Left) */
}

/* ==========================================================================
   GLOBAL NAVIGATION HEADER & FOOTER
   ========================================================================== */
.site-header {
    background-color: var(--white);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--lab-blue);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-brand span {
    color: var(--hmc-gold);
}

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

.nav-link {
    text-decoration: none;
    color: var(--hmc-dark);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--lab-blue);
}

/* Global Footer Styles */
.site-footer {
    background-color: var(--light-bg);
    border-top: 1px solid var(--border);
    padding: 30px 20px;
    margin-top: 80px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ==========================================================================
   2. REUSABLE COMPONENTS (BUTTONS, HERO, GRIDS)
   ========================================================================== */
.btn {
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #004d73;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,102,153,0.3);
}

.btn-secondary {
    background-color: white;
    color: var(--hmc-dark);
    border: 2px solid var(--hmc-dark);
}

.btn-secondary:hover {
    background-color: var(--hmc-dark);
    color: white;
    transform: translateY(-2px);
}

.btn-gold {
    display: inline-block;
    background-color: var(--hmc-gold);
    color: var(--hmc-dark);
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 700;
    margin-top: 20px;
    transition: transform 0.2s;
}

.btn-gold:hover {
    transform: translateY(-1px);
}

/* Main Layout Split Grid (used on homepage) */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 50px auto;
    padding: 0 20px;
}

@media (min-width: 850px) {
    .main-grid {
        grid-template-columns: 2fr 1fr; /* 2/3 Content, 1/3 Sidebar */
    }
}

/* ==========================================================================
   3. HOME PAGE SPECIFIC STYLES
   ========================================================================== */
.hero {
    padding: 60px 20px;
    background: linear-gradient(to bottom, #ffffff, #fcfcfc);
    border-bottom: 5px solid var(--hmc-gold);
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    color: var(--lab-blue);
    margin: 0 0 15px 0;
    letter-spacing: -1px;
    font-weight: 800;
}

.hero p.lead {
    font-size: 1.4rem;
    color: #555;
    font-weight: 300;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Quick Cards Section */
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.quick-card {
    background: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
    transition: border-color 0.2s;
}

.quick-card:hover {
    border-color: var(--lab-blue);
}

.quick-card h3 {
    margin-top: 0;
    color: var(--lab-blue);
}

.quick-card a {
    text-decoration: none;
    font-weight: bold;
    color: var(--hmc-dark);
    font-size: 0.9rem;
}

/* YouTube Widget */
.youtube-box {
    margin-top: 30px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.youtube-cta {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fcfcfc;
    border-top: 1px solid #eee;
}

.cta-text {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

.btn-sub {
    background-color: #cc0000;
    color: white;
    text-decoration: none;
    padding: 6px 15px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-sub:hover {
    background-color: #aa0000;
}

/* Sidebar News Stream */
.news-panel {
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: fit-content;
}

.news-header {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--lab-blue);
    border-bottom: 2px solid var(--hmc-gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.news-date {
    font-size: 0.8rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 5px;
}

.news-content {
    font-size: 0.95rem;
    color: #333;
}

.news-content strong {
    color: var(--lab-blue);
}

.tags { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 0.7rem; padding: 3px 8px; border-radius: 12px; font-weight: 700; text-transform: uppercase; }
.tag.talk { background-color: #e3f2fd; color: #1565c0; }
.tag.pub { background-color: #fff3e0; color: #e65100; }
.tag.grant { background-color: #e8f5e9; color: #2e7d32; }
.tag.team { background-color: #f3e5f5; color: #7b1fa2; }

/* ==========================================================================
   4. TEAM PAGE STYLES (EXTRACTED)
   ========================================================================== */
.page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--lab-blue);
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: #666;
    max-width: 700px;
    margin: 0 auto 60px auto;
    font-size: 1.2rem;
    font-weight: 300;
}

.year-header {
    font-size: 1.2rem;
    color: #777;
    margin: 40px 0 20px 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* PI Profile Component */
.pi-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .pi-card {
        flex-direction: row;
    }
    .pi-image {
        width: 35%;
    }
    .pi-content {
        width: 65%;
        padding: 40px;
    }
}

.pi-image {
    padding: 25px;
    background-color: #fff;
}

.pi-content {
    padding: 30px;
}

.pi-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--lab-blue);
    margin: 0 0 5px 0;
}

.pi-title {
    font-size: 0.95rem;
    color: var(--hmc-gold);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.pi-contact {
    font-size: 0.9rem;
    color: #555;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.pi-contact a {
    color: var(--lab-blue);
    text-decoration: none;
    font-weight: 600;
}

/* Student Directory Grid */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

.member-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: var(--lab-blue);
}

.member-photo {
    padding: 25px 25px 0 25px;
}

.member-info {
    padding: 15px;
}

.member-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hmc-dark);
    margin: 0 0 5px 0;
}

.member-major {
    font-size: 0.85rem;
    color: #777;
}

/* Alumni Section */
.alumni-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 20px;
}

@media (min-width: 600px) {
    .alumni-container {
        grid-template-columns: 1fr 1fr;
    }
}

.alumni-year {
    margin-bottom: 25px;
}

.alumni-year h4 {
    color: var(--lab-blue);
    border-bottom: 2px solid var(--hmc-gold);
    display: inline-block;
    margin: 0 0 15px 0;
    padding-bottom: 2px;
    font-size: 1.1rem;
}

.alumni-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.alumni-list li {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #444;
}

.alumni-list li strong {
    color: var(--hmc-dark);
}

/* Call to Action Callout Box */
.join-box {
    background-color: var(--lab-blue);
    color: white;
    text-align: center;
    padding: 40px;
    border-radius: 12px;
    margin: 80px auto 20px auto;
    max-width: 800px;
}

.join-box h2 {
    border: none;
    color: white;
    padding: 0;
    margin-top: 0;
}

/* ==========================================================================
   5. RESEARCH PROJECTS PAGE STYLES
   ========================================================================== */
.subtitle-left {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
    max-width: 800px;
    border-left: 4px solid var(--hmc-gold);
    border-right: 4px solid var(--hmc-gold);
    padding-left: 15px;
    line-height: 1.7;
    text-align: center;

    margin: 0 auto 50px auto; /* (Top, Right, Bottom, Left) */
}

.project-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 80px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .project-section {
        flex-direction: row;
        align-items: flex-start;
    }
    .project-content {
        flex: 3;
    }
    .project-visual {
        flex: 2;
    }
}

/* Override global section margin when inside a flex row */
.project-section h2 {
    margin-top: 0;
}

/* Distinct tag wrappers to avoid homepage news stream collision */
.project-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.project-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--lab-blue);
    background: #eef6fa;
    padding: 4px 8px;
    border-radius: 4px;
}

/* ==========================================================================
   6. INTERNAL MEMBERS PORTAL STYLES
   ========================================================================== */
.notice-banner {
    background-color: #e8f4fd;
    border-left: 5px solid var(--lab-blue);
    padding: 15px;
    margin: 0 auto 30px auto;
    border-radius: 4px;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 0 auto;
}

.portal-card {
    background: var(--white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 5px solid var(--lab-blue); /* Default Blue Accent */
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

.portal-card h3 {
    margin-top: 0;
    color: var(--hmc-dark);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-card ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.portal-card li {
    margin-bottom: 12px;
}

.portal-card a {
    text-decoration: none;
    color: #444;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    background-color: var(--light-bg);
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.portal-card a:hover {
    background-color: #e0e0e0;
    color: var(--lab-blue);
}

.portal-card a::after {
    content: "→";
    font-weight: bold;
    opacity: 0.5;
}

/* Distinct Portal Card Top-Border Color Variations */
.portal-card.safety { border-top-color: #d9534f; }
.portal-card.compute { border-top-color: #5bc0de; }
.portal-card.admin { border-top-color: var(--hmc-gold); }

/* ==========================================================================
   7. TIMELINE & NEWS ARCHIVE PAGE STYLES
   ========================================================================== */
.timeline-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

/* The Vertical Accent Line */
.timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20px;
    width: 3px;
    background: #f0f0f0;
}

/* Individual News Container Node */
.news-item {
    position: relative;
    padding-left: 60px; /* Space for the line and dot */
    margin-bottom: 40px;
}

/* The Dot centered on the Vertical Line */
.news-item::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    border: 4px solid var(--hmc-gold);
    z-index: 1;
}

/* Year Separator Header Block */
.year-break {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ccc;
    margin: 40px 0 20px 60px;
    border-bottom: 1px solid #eee;
}

/* Timeline Entry Card Layout */
.timeline-content {
    background: var(--white);
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--lab-blue);
}

.timeline-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--lab-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.timeline-text {
    font-size: 1rem;
    color: #333;
}

.timeline-text strong {
    color: var(--hmc-dark);
    font-weight: 700;
}

/* ==========================================================================
   8. PUBLICATIONS PAGE STYLES
   ========================================================================== */
.year-group {
    margin-bottom: 50px;
    position: relative;
}

.year-label {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--hmc-gold);
    margin-bottom: 20px;
    display: inline-block;
    border-bottom: 2px solid var(--hmc-gold);
}

.pub-item {
    display: flex;
    flex-direction: column;
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease;
}

.pub-item:hover {
    background-color: #fafafa;
}

.pub-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--hmc-dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.pub-authors {
    font-size: 1rem;
    color: #555;
    margin-bottom: 6px;
}

.pub-authors strong {
    color: var(--lab-blue);
    font-weight: 600;
}

.pub-journal {
    font-family: 'Georgia', serif;
    font-style: italic;
    color: #777;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.pub-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modifies global .btn framework to make compact link badges */
.pub-item .btn {
    font-size: 0.8rem;
    padding: 6px 16px;
    border-radius: 20px;
}

.btn-doi {
    background-color: #eef6fa;
    color: var(--lab-blue);
}

.btn-doi:hover {
    background-color: var(--lab-blue);
    color: white;
    transform: translateY(-1px);
}

.btn-pdf {
    background-color: var(--white);
    border: 1px solid #ddd;
    color: #666;
}

.btn-pdf:hover {
    border-color: var(--hmc-dark);
    color: var(--hmc-dark);
    transform: translateY(-1px);
}

.badge-new {
    background-color: var(--hmc-gold);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

