/* Extracted from index.html */

/* Custom styling for a dramatic, modern look */
:root {
    --primary-color: #dc2626; /* Red 600 - sporty accent */
    --bg-light: #ffffff; /* White */
    --text-color: #0f172a; /* Slate 900 fallback used by global headings */
}
html, body {
    overflow-x: hidden;
}

header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 9999;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: #0f172a; /* Slate 900 */
    scroll-behavior: smooth;
    padding-top: 5rem;
}

/* Loading indicator */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #64748b;
}
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Styling for the sticky left navigation */
#chronicle-nav {
    background-color: rgba(255, 255, 255, 0.96);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    padding: 0.75rem;
    z-index: 20;
    transition: top 0.2s ease;
}

@media (min-width: 1024px) {
    #chronicle-nav {
        position: fixed;
        left: max(1rem, calc((100vw - 1536px) / 2 + 1rem));
        width: min(11rem, 100%);
        max-width: 11rem;
        max-height: calc(100vh - var(--timeline-scroll-offset, 6.5rem) - 1rem);
        overflow-y: auto;
    }
}

/* Keep the nav list indentation compact (user preference: 20px) */
#chronicle-nav ul,
#nav-list {
    padding-left: 20px;
}

.chronicle-nav-item {
    position: relative;
    padding: 0.18rem 0.25rem 0.18rem 0.01rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    color: #475569; /* Slate 600 */
    font-weight: 500;
}

/* Active state for the left navigation */
.chronicle-nav-item.active {
    color: var(--primary-color);
    font-weight: 700;
}
.chronicle-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 100%;
    border-radius: 9999px;
    background-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Scroll Animation effect (Opacity and Transform) */
.year-section {
    /* opacity: 0.2; */ /* Removed for full visibility */
    /* transform: translateY(40px); */ /* Removed for full visibility */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    padding: 1.5rem 0;
    scroll-margin-top: var(--timeline-scroll-offset, 9rem);
}
#department-header {
    margin-bottom: 1.25rem;
    /* margin-top is set dynamically by JavaScript in department-page.js */
}
main#chronicle-content > * + * {
    margin-top: 0.625rem !important; /* 10px gap between header and year sections */
}
.year-section.in-view {
    /* Intentionally left empty: class kept for JS-driven state (animation/visibility) */
}



/* Styles for dynamically rendered article content */
.article-content h1 {
    font-size: 1.875rem; /* 30px */
    line-height: 2.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}
.article-content h2 {
    font-size: 1.5rem; /* 24px */
    line-height: 2rem;
    font-weight: 700;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.article-content h3 {
    font-size: 1.25rem; /* 20px */
    line-height: 1.75rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.article-content p {
    margin-top: 1rem;
    margin-bottom: 1rem;
}
.article-content ul, .article-content ol {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}
.article-content ul {
    list-style-type: disc;
}
.article-content ol {
    list-style-type: decimal;
}
.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
}
.article-content strong {
    font-weight: 700;
}
.article-content em {
    font-style: italic;
}

/* Image styling for article content - overrides Tailwind reset */
.article-content img {
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Single image in a container: centered, block display, limited width */
.article-content p > img:only-of-type,
.article-content div > img:only-of-type {
    display: block !important;
    margin-left: auto;
    margin-right: auto;
    max-width: 32rem;
}

/* Multiple images in a container: inline, side by side */
.article-content p > img:not(:only-of-type),
.article-content div > img:not(:only-of-type) {
    display: inline-block !important;
    vertical-align: middle !important;
    max-width: 48%;
    margin-right: 0.5rem;
}

/* Simple scrollbar styling for nav */
.overflow-x-auto::-webkit-scrollbar {
    height: 4px;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
    background-color: #cbd5e1; /* Slate 300 */
    border-radius: 20px;
}

/* Utility moved from inline style in index.html */
.spacer-50vh {
    height: 50vh;
}

/* Keep timeline controls visible below the fixed header */
/* Position is now set dynamically by JavaScript based on header height */

/* Fade-in animation for articles */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Lazy loading images */
.lazy-image {
    background-color: #f1f5f9;
    transition: opacity 0.3s ease;
}
.lazy-loaded {
    animation: fadeInImage 0.3s ease;
}
@keyframes fadeInImage {
    from { opacity: 0.5; }
    to { opacity: 1; }
}
