:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #0284c7;
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px 60px 20px;
}

/* Institutional Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: none;
}

.tagline {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 10px;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    display: inline-block;
    background-color: rgba(2, 132, 199, 0.08);
    border: 1px solid rgba(2, 132, 199, 0.15);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 25px;
}

/* Master Top Header / Navigation Bar */
.global-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    padding: 15px 30px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.05em;
    /* text-transform: uppercase; */
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent);
    background-color: rgba(2, 132, 199, 0.05);
}

.nav-links a.active {
    color: #ffffff;
    background: var(--accent-gradient);
}

/* Adjust the main container to account for the top bar */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 60px 20px;
}

@media (max-width: 768px) {
    .global-nav { flex-direction: column; gap: 15px; text-align: center; padding: 15px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
}

/* Content Layouts */
section {
    margin-bottom: 40px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #0f172a;
}

h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 25px;
}

@media (max-width: 768px) {
    .grid { grid-template-columns: 1fr; }
    h1 { font-size: 2.2rem; }
    section { padding: 25px; }
    nav { flex-wrap: wrap; gap: 10px; }
}

.card {
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
}

.card h3 {
    font-size: 1.2rem;
    color: #0f172a;
    margin-bottom: 12px;
}

/* Diagram Components */
.diagram-caption {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-muted);
    text-align: center;
    margin-top: 15px;
    margin-bottom: 25px;
    display: block;
}

.tech-block {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 25px 0;
}

.tech-block h4 {
    font-size: 1.1rem;
    color: #0f172a;
    margin-bottom: 6px;
}

/* LaTeX Math Blocks Styles */
.math-container {
    background-color: #f1f5f9;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid var(--border);
    overflow-x: auto;
}

/* Team Component Layouts */
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
}

.member-card {
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
}

.member-meta {
    margin-bottom: 12px;
}

.member-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.member-role {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 600;
}

.bio-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer Section */
footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Click-Anywhere Article Cards & Row Alignment */
.article-row-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Forces exactly 3 equal columns in one row */
    gap: 25px;
    margin-top: 25px;
}

.clickable-card {
    position: relative; /* Essential anchor point for the stretched link */
    background-color: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

/* Subtle hover effect so the user knows it's clickable */
.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
}

/* The Magic Stretched Link */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

/* Responsive fix: if screen is small (mobile), stack them vertically instead */
@media (max-width: 900px) {
    .article-row-grid {
        grid-template-columns: 1fr;
    }
}

/* Mission Pillars Layout Container */
.mission-pillars {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual Pillar Rows - Updated to match your exact paragraph styles */
.pillar-item {
    font-size: 1rem; /* Bumps it up to match standard text size */
    line-height: 1.6; /* Matches standard comfortable paragraph tracking */
    color: var(--text-muted);
}

/* Styling the bold titles inside your text */
.pillar-item strong {
    color: #0f172a;
}

/* Keep headings on a single line to protect grid layout widths */
.card h3 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Safeguard for very small mobile screens */
    margin-bottom: 12px;     /* Ensures healthy breathing room above the paragraph */
}

/* ==========================================================================
   Compliance & Data Table Component
   ========================================================================== */
.compliance-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
    text-align: left;
}

.compliance-table th {
    background-color: #f8fafc;
    color: #0f172a;
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: none; /* Kept clean and borderless per your choice */
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.compliance-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    color: #334155;
    line-height: 1.5;
}

.compliance-table tr:hover {
    background-color: #f8fafc;
}

.compliance-tag {
    display: inline-block;
    background: #e2e8f0;
    color: #0f172a;
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ==========================================================================
   Publications Index Layout
   ========================================================================== */

.portfolio-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
}

.document-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.document-content {
    flex: 1;
}

.document-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
}

.document-desc {
    color: #475569;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.btn-download {
    display: inline-block;
    background-color: #0f172a;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn-download:hover {
    background-color: var(--accent); /* Uses your global blue highlight on hover */
}

@media (max-width: 640px) {
    .document-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .btn-download {
        width: 100%;
        text-align: center;
    }
}

/* ==========================================================================
   Team Grid & Bio Card Styles (About Page)
   ========================================================================== */

.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 30px;
}

.member-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-meta {
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.member-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.member-role {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.bio-text {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.6;
}