/* =========================================
   INDIVIDUAL RESEARCH PAPER PAGE
   ========================================= */

/* Ensure the page background matches the dark theme */
body.paper-layout {
    background-color: #121212; 
    color: #cccccc;
}

/* --- Hero Section --- */
.paper-hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-bottom: 3px solid #ff3333; /* Signature red accent */
}

/* Gradient overlay ensures text is readable over ANY image */
.paper-hero .hero-overlay {
    /* background: linear-gradient(to bottom, rgba(18, 18, 18, 0.6) 0%, rgba(18, 18, 18, 0.95) 100%);
    padding: 6rem 5% 4rem;
    display: flex;
    align-items: center;
    justify-content: center; */
}

.paper-hero .hero-container {
    max-width: 800px; /* Aligns perfectly with the text below */
    width: 100%;
    text-align: left;
}

.paper-hero .category-tag {
    margin-bottom: 1.5rem;
}

.paper-hero .paper-title {
    font-size: 3.5rem;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.paper-hero .paper-meta {
    font-size: 1.05rem;
    color: #aaaaaa;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.paper-meta .paper-source {
    color: #ffffff;
}

.paper-meta .meta-divider {
    color: #ff3333;
}

/* --- Paper Content (Typography & Layout) --- */
.paper-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    line-height: 1.8;
    font-size: 1.15rem;
    color: #d4d4d4;
}

/* Headings inside the article */
.paper-content h2 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paper-content h3 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.paper-content p {
    margin-bottom: 1.75rem;
}

/* Clinical/Important Callouts inside the text */
.paper-content blockquote,
.paper-content .clinical-highlight {
    background-color: rgba(255, 51, 51, 0.05); /* Faint red background */
    border-left: 4px solid #ff3333;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    border-radius: 0 4px 4px 0;
    font-size: 1.25rem;
    color: #ffffff;
    font-style: italic;
    line-height: 1.6;
}

/* Lists styling */
.paper-content ul, 
.paper-content ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.paper-content li {
    margin-bottom: 0.75rem;
}

/* Links and Citations inside the text */
.paper-content a {
    color: #ff3333;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
}

.paper-content a:hover {
    border-bottom-color: #ff3333;
}

.paper-content sup,
.paper-content .citation {
    font-size: 0.85rem;
    color: #888888;
    margin-left: 2px;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .paper-hero .paper-title {
        font-size: 2.2rem;
    }
    
    .paper-hero .hero-overlay {
        padding: 4rem 1.5rem 3rem;
    }
    
    .paper-content {
        padding: 2.5rem 1.5rem;
        font-size: 1.05rem; /* Slightly smaller for mobile reading */
    }

    .paper-content h2 {
        font-size: 1.8rem;
    }
    
    .paper-content blockquote {
        padding: 1.25rem 1.5rem;
        font-size: 1.15rem;
    }
}

/* =========================================
   INDIVIDUAL RESEARCH PAPER PAGE
   ========================================= */

body.paper-layout {
    background-color: #121212; 
    color: #cccccc;
}

/* --- Hero Section & Header Overlap Fix --- */
.paper-hero {
    /* margin-top: 90px;  */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-bottom: 3px solid #ff3333;
}

.paper-hero .hero-overlay {
    
    padding: 6rem 5% 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.paper-hero .hero-container {
    max-width: 1000px; /* Widened slightly to match the grid below */
    width: 100%;
    text-align: left;
}

.paper-hero .category-tag { margin-bottom: 1.5rem; }
.paper-hero .paper-title {
    font-size: 3.5rem;
    line-height: 1.15;
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.paper-hero .paper-meta {
    font-size: 1.05rem;
    color: #aaaaaa;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.paper-meta .paper-source { color: #ffffff; }
.paper-meta .meta-divider { color: #ff3333; }

/* --- Layout Grid (Sidebar + Content) --- */
.paper-layout-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr); /* 280px sidebar, rest is content */
    gap: 4rem;
    padding: 4rem 5%;
    align-items: start;
}

/* --- Context Map Sidebar --- */
.paper-sidebar {
    position: sticky;
    top: 130px; /* Keeps the map pinned to the screen below the sticky nav as you scroll */
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #aaaaaa;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 3rem;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: #ff3333;
}

.back-btn svg {
    transition: transform 0.3s ease;
}

.back-btn:hover svg {
    transform: translateX(-4px); /* Arrow slides slightly left on hover */
}

/* Map Header */
.context-map-title {
    color: #ffffff;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Map Links */
.context-map {
    display: flex;
    flex-direction: column;
    border-left: 2px solid rgba(255, 255, 255, 0.1); /* The track */
}

.context-link {
    color: #777777;
    text-decoration: none;
    padding: 0.6rem 0 0.6rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: all 0.3s ease;
    position: relative;
}

/* The red highlight that grows on active links */
.context-link::before {
    content: '';
    position: absolute;
    left: -2px; /* Overlaps the track border */
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #ff3333;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.context-link:hover {
    color: #cccccc;
}

.context-link.active {
    color: #ffffff;
    font-weight: 600;
}

.context-link.active::before {
    transform: scaleY(1); /* Expands the red border line */
}

/* --- Paper Content --- */
.paper-content {
    /* Removed padding/max-width because the grid wrapper handles it now */
    line-height: 1.8;
    font-size: 1.15rem;
    color: #d4d4d4;
}

/* Adjusted top margin on headings since the anchor links jump here */
.paper-content h2 {
    font-size: 2.2rem;
    color: #ffffff;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    scroll-margin-top: 130px; /* When user clicks a map link, it offsets the scroll so the sticky header doesn't cover the title */
}

.paper-content h3 { font-size: 1.5rem; color: #ffffff; margin-top: 2.5rem; margin-bottom: 1rem; }
.paper-content p { margin-bottom: 1.75rem; }

.paper-content blockquote,
.paper-content .clinical-highlight {
    background-color: rgba(255, 51, 51, 0.05);
    border-left: 4px solid #ff3333;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    border-radius: 0 4px 4px 0;
    font-size: 1.25rem;
    color: #ffffff;
    font-style: italic;
}

.paper-content ul, 
.paper-content ol { margin-bottom: 2rem; padding-left: 1.5rem; }
.paper-content li { margin-bottom: 0.75rem; }
.paper-content a { color: #ff3333; text-decoration: none; border-bottom: 1px solid transparent; transition: all 0.3s ease; font-weight: 600; }
.paper-content a:hover { border-bottom-color: #ff3333; }

/* --- Mobile Responsiveness --- */
@media (max-width: 900px) {
    .paper-hero .paper-title { font-size: 2.2rem; }
    
    .paper-layout-wrapper {
        grid-template-columns: 1fr; /* Stacks to single column */
        gap: 2rem;
        padding: 3rem 5%;
    }

    .paper-sidebar {
        position: relative; /* Removes sticky behavior on phone */
        top: 0;
        margin-bottom: 1rem;
    }

    .paper-content {
        font-size: 1.05rem; 
    }
    .paper-content h2 { font-size: 1.8rem; }
}