/* Using the Inter font (google) */
:root {
    font-family: Inter, sans-serif;
    font-feature-settings: 'liga' 1, 'calt' 1;
}

@supports (font-variation-settings: normal) {
    :root {
        font-family: InterVariable, sans-serif;
    }
}

/* Reset and base styles */
* { 
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    margin-bottom: 2cm;
    padding: 0;
    background: #f5f1e8;
    color: #1a1a1a;
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Link colors */
a {
    color: #0066cc;
    text-decoration: none;
}

a:hover {
    color: #003d7a;
}

/* Navigation Bar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

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

.nav-logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
}

.nav-logo:hover {
    color: #0066cc;
}

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

.nav-item {
    margin: 0;
}

.nav-link {
    color: #1a1a1a;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #0066cc;
    background: rgba(0, 102, 204, 0.05);
}

.nav-link.active {
    color: #0066cc;
    background: rgba(0, 102, 204, 0.1);
}

/* Mobile navigation */
@media (max-width: 850px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-logo {
        font-size: 1.1rem;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Headings */
h1 {
    padding: 1rem 0;
    margin: 1rem auto;
    width: 57.5%;
    text-align: left;
}

h2, h3, h4, h5, h6 {
    padding: 0;
    margin: 0.5rem auto;
    width: 57.5%;
}

/* Paragraphs and lists */
p {
    margin: 1rem auto;
    width: 57.5%;
}

ul, ol {
    margin: 1rem auto;
    width: 57.5%;
    padding-left: 2rem;
}

li {
    margin: 0.5rem 0;
}

/* Quote styling */
.quote {
    display: block;
    padding: 1rem 1.5rem;
    margin: 1rem auto;
    width: 57.5%;
    background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
    border: 1px solid rgba(0,0,0,0.1);
    border-left: 4px solid #0066cc;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-style: italic;
    color: #2c3e50;
}

.quote-author {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-style: normal;
    color: #5a6c7d;
}

/* Equation styling */
.equation {
    display: block;
    padding: 1rem 1.5rem;
    margin: 1rem auto;
    width: 57.5%;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* KaTeX display math - remove extra margins */
.katex-display {
    margin: 0.5em 0 !important;
}

/* Figure styling */
.figure { 
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
    margin: 1rem auto;
    width: 57.5%;
    background: #f5f1e8;
    border: 1px solid rgba(0,0,0,0.1); 
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: grid;
    align-items: center;
    padding: 1rem;
}

.figure img {
    grid-row: 1;
    justify-self: center;
    max-width: 100%;
    height: auto;
    display: block;
}

.figure caption {
    grid-row: 2;
    margin-top: 1.5rem;
    color: #1a1a1a;
    text-align: left;
    width: 100%;
    line-height: 1.6;
    display: block;
}

.figure-caption {
    grid-row: 2;
    margin-top: 1.5rem;
    color: #1a1a1a;
    text-align: left;
    width: 100%;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Prevent KaTeX display math from adding line breaks in captions */
.figure .katex-display,
.figure-caption .katex-display,
caption .katex-display,
figcaption .katex-display {
    display: inline-block !important;
    margin: 0 0.2em !important;
    padding: 0 !important;
}

/* Make sure all KaTeX elements in captions stay inline */
.figure .katex,
.figure-caption .katex,
caption .katex,
figcaption .katex {
    display: inline !important;
}

.figure .katex-html,
.figure-caption .katex-html,
caption .katex-html,
figcaption .katex-html {
    display: inline !important;
}

.figure .base,
.figure-caption .base,
caption .base,
figcaption .base {
    display: inline !important;
}

/* Video wrapper styling */
.video-wrapper {
    grid-template-rows: auto auto;
    grid-template-columns: 1fr;
    margin: 1rem auto;
    width: 40%;
    background: #f5f1e8;
    border: 1px solid rgba(0,0,0,0.1); 
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: grid;
    align-items: center;
    padding: 1rem;
}

.video-wrapper iframe {
    grid-row: 1;
    justify-self: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
}

/* Sources/References styling */
.sources { 
    max-width: 57.5%;
    padding: 0;
    box-sizing: border-box;
    margin: 1rem auto;
    text-align: left;
}

.sources ul {
    list-style-type: none;
    padding: 0;
    line-height: 1.4;
    width: 100%;
    margin: 0;
}

.sources li {
    font-size: 0.9rem;
    font-style: italic;
    margin: 0.5rem 0;
}

/* Mobile responsive */
@media (max-width: 850px) {
    body {
        font-size: 1rem;
        line-height: 1.6;
    }

    h1 {
        width: 90%;
        font-size: 1.8rem;
        padding: 0.5rem 0;
    }

    h2, h3, h4, h5, h6 {
        width: 90%;
        font-size: 1.3rem;
    }

    p {
        width: 90%;
        font-size: 1rem;
    }

    ul, ol {
        width: 90%;
        font-size: 1rem;
    }

    .quote {
        width: 90%;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
    }

    .equation {
        width: 90%;
        font-size: 1.1rem;
        padding: 0.75rem 1rem;
    }

    .figure {
        width: 90%;
        padding: 0.75rem;
    }

    .figure-caption {
        font-size: 0.85rem;
    }

    .sources {
        max-width: 90%;
    }

    .sources li {
        font-size: 0.85rem;
    }
}
