/* NLP Course - ML_Design_Thinking Exact Style */

:root {
    --primary: #0066cc;
    --primary-dark: #004499;
    --secondary: #6c757d;
    --accent: #ff7f0e;
    --success: #2ca02c;
    --background: #f5f5f5;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-light: #444444;
    --text-muted: #666666;
    --heading: #000000;
    --border: #ddd;
    --lavender: #adadd0;
    --lavender-light: #c1c1e8;
    --section-blue: #e8f4fc;
    --section-green: #e8f8e8;
    --section-yellow: #fef9e7;
    --section-gray: #f8f8f8;
    --badge-beginner: #27ae60;
    --badge-intermediate: #f39c12;
    --badge-advanced: #e74c3c;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.25;
    color: var(--text);
    background: var(--background);
    font-size: 13px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 600; }
h1 { font-size: 1.3rem; line-height: 1.15; margin-bottom: 0.3rem; }
h2 { font-size: 1.1rem; line-height: 1.15; margin: 0.5rem 0 0.2rem; border-bottom: 1px solid var(--lavender); padding-bottom: 0.15rem; }
h3 { font-size: 0.95rem; line-height: 1.2; margin: 0.4rem 0 0.15rem; }
p { margin-bottom: 0.3rem; }

img { max-width: 100%; height: auto; }

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ==================== SITE LAYOUT ==================== */
.site-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0.5rem;
    align-items: start;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    position: sticky;
    top: 0.25rem;
    height: fit-content;
    max-height: calc(100vh - 0.5rem);
    overflow-y: auto;
    background: var(--surface);
    padding: 0.4rem;
    border-radius: 4px;
    font-size: 11px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    width: 180px;
}

.sidebar-header {
    background: var(--primary);
    margin: -0.4rem -0.4rem 0.5rem -0.4rem;
    padding: 0.4rem;
    border-radius: 4px 4px 0 0;
}

.sidebar-logo {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    margin-bottom: 0.3rem;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}
.sidebar-title a { color: inherit; text-decoration: none; }

.sidebar-subtitle {
    font-size: 9px;
    color: rgba(255,255,255,0.8);
    margin-top: 2px;
}

/* Sidebar Search */
.sidebar-search {
    margin-bottom: 0.4rem;
}
.sidebar-search input {
    width: 100%;
    padding: 0.25rem 0.4rem;
    font-size: 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--background);
}
.sidebar-search input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Sidebar Sections */
.sidebar-content {
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 0.4rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-light);
    margin-bottom: 0.15rem;
    padding: 0.15rem 0.2rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}
.section-header:hover { background: var(--background); }

.section-toggle {
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.section-toggle::before {
    content: "";
    border: solid var(--text-muted);
    border-width: 0 1.5px 1.5px 0;
    padding: 2px;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.sidebar-section.collapsed .section-toggle::before {
    transform: rotate(-45deg);
}

.section-content {
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
}
.sidebar-section.collapsed .section-content {
    max-height: 0;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
    display: block;
    padding: 0.15rem 0.3rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 2px;
    line-height: 1.2;
    font-size: 10px;
}
.sidebar-nav a:hover { background: var(--background); color: var(--primary); text-decoration: none; }
.sidebar-nav a.active { background: var(--primary); color: white; }

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.3rem;
    border-top: 1px solid var(--border);
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 0.4rem;
}
.sidebar-footer a { color: var(--primary); }

/* ==================== TOP NAVIGATION ==================== */
.top-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    padding: 0.3rem;
    background: var(--primary);
    border-radius: 4px;
}

.top-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
}

.top-nav-links a {
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 10px;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    text-decoration: none;
}
.top-nav-links a:hover { background: rgba(255,255,255,0.2); color: white; text-decoration: none; }
.top-nav-links a.active { background: white; color: var(--primary); }

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    font-size: 9px;
    box-shadow: 0 2px 4px rgba(255,127,14,0.3);
}
.download-btn:hover { background: #e06f00; text-decoration: none; color: white; }

/* ==================== MAIN CONTENT ==================== */
.main-content {
    min-width: 0;
}

main {
    padding: 0.5rem 0;
}

/* ==================== HERO SECTION ==================== */
.hero {
    background: linear-gradient(135deg, var(--lavender) 0%, var(--lavender-light) 100%);
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    text-align: center;
}

.hero h1 {
    color: var(--heading);
    margin-bottom: 0.1rem;
    font-size: 1rem;
}

.hero .subtitle {
    font-size: 0.75rem;
    color: var(--text);
    margin: 0 auto 0.3rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
}
.hero-btn.primary {
    background: var(--accent);
    color: white;
}
.hero-btn.primary:hover {
    background: #e06f00;
    text-decoration: none;
}
.hero-btn.secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
}
.hero-btn.secondary:hover {
    background: var(--background);
    text-decoration: none;
}

/* Hero Images */
.hero-images {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-image {
    width: 160px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hero-image:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hero-image img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}
.hero-image span {
    display: block;
    padding: 0.25rem;
    text-align: center;
    font-size: 9px;
    color: var(--text-light);
    font-weight: 500;
}

/* ==================== SECTION TITLES ==================== */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 0.3rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid var(--lavender);
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

/* ==================== TOPIC CARDS ==================== */
.topics-section {
    padding: 0.4rem 0;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.35rem;
    margin: 0.4rem 0;
}

.topic-card {
    background: var(--surface);
    border-radius: 4px;
    padding: 0.35rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 2px solid var(--primary);
    transition: box-shadow 0.2s;
}
.topic-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.topic-card h3 {
    margin: 0 0 0.1rem 0;
    font-size: 0.8rem;
    color: var(--heading);
}
.topic-card h3 a {
    color: var(--primary);
    text-decoration: none;
}
.topic-card h3 a:hover { text-decoration: underline; }

.topic-card p {
    color: var(--text-light);
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
    line-height: 1.2;
}

.topic-meta {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.08rem 0.25rem;
    border-radius: 2px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.difficulty-badge.beginner { background: var(--badge-beginner); color: white; }
.difficulty-badge.intermediate { background: var(--badge-intermediate); color: white; }
.difficulty-badge.advanced { background: var(--badge-advanced); color: white; }

.duration {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ==================== RESOURCES GRID ==================== */
.resources-section {
    padding: 0.4rem 0;
    background: var(--section-gray);
    border-radius: 4px;
    margin-top: 0.4rem;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.35rem;
    padding: 0 0.4rem;
}

.resource-card {
    background: var(--surface);
    border-radius: 4px;
    padding: 0.4rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.2s;
}
.resource-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    text-decoration: none;
}
.resource-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.15rem;
}
.resource-card p {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ==================== CHART GALLERY ==================== */
.gallery-section {
    padding: 0.4rem 0;
}

.gallery-stats {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.stat-item {
    background: var(--surface);
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.stat-item strong { color: var(--primary); }

.filter-buttons {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
}

.filter-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.35rem;
}

.gallery-item {
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    background: var(--background);
}
.gallery-item-name {
    padding: 0.2rem;
    font-size: 0.6rem;
    text-align: center;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1.2;
}
.gallery-item-category {
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* Category badges */
.category-badge {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.55rem;
    font-weight: 500;
}
.category-foundations { background: #d4edda; color: #155724; }
.category-embeddings { background: #cce5ff; color: #004085; }
.category-lstm { background: #fff3cd; color: #856404; }
.category-attention { background: #f8d7da; color: #721c24; }
.category-transformers { background: #e2d5f1; color: #4a235a; }
.category-bert { background: #d1ecf1; color: #0c5460; }
.category-scaling { background: #ffeeba; color: #856404; }
.category-tokenization { background: #c3e6cb; color: #155724; }
.category-decoding { background: #b8daff; color: #004085; }
.category-finetuning { background: #f5c6cb; color: #721c24; }
.category-efficiency { background: #d6d8db; color: #383d41; }
.category-ethics { background: #fdfdfe; color: #383d41; border: 1px solid #d6d8db; }

/* ==================== MODULES ==================== */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.35rem;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.4rem;
    transition: all 0.2s;
}
.module-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.module-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.3rem;
}

.module-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.module-meta h3 {
    font-size: 0.8rem;
    color: var(--primary);
    margin: 0 0 0.15rem 0;
}
.module-meta h3 a { color: inherit; text-decoration: none; }
.module-meta h3 a:hover { color: var(--accent); }

.module-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.slide-count {
    font-size: 0.6rem;
    color: var(--primary);
    background: rgba(0,102,204,0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
}

.module-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.module-topics {
    list-style: none;
    margin-bottom: 0.4rem;
    padding: 0;
}
.module-topics li {
    font-size: 0.65rem;
    color: var(--text);
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.module-topics li:last-child { border-bottom: none; }
.module-topics li::before {
    content: "";
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.module-btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
}
.module-btn:hover { background: #e06f00; text-decoration: none; color: white; }

/* ==================== ABOUT PAGE ==================== */
.about-hero {
    text-align: center;
    padding: 0.5rem;
    background: linear-gradient(135deg, var(--lavender) 0%, var(--lavender-light) 100%);
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.about-hero h1 { font-size: 1.1rem; margin-bottom: 0.2rem; color: var(--heading); }
.about-hero .subtitle { font-size: 0.75rem; color: var(--text); max-width: 400px; margin: 0 auto; }

.about-section {
    padding: 0.5rem;
    max-width: 700px;
    margin: 0 auto;
}
.about-section h2 {
    color: var(--primary);
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    padding-bottom: 0.15rem;
    border-bottom: 2px solid var(--accent);
}
.about-section p { line-height: 1.4; color: var(--text); margin-bottom: 0.3rem; font-size: 0.8rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.4rem;
    margin: 0.4rem 0;
}
.stat-card {
    background: var(--surface);
    border-radius: 4px;
    padding: 0.4rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-number { font-size: 1.3rem; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.15rem; }

.learning-objectives {
    list-style: none;
    padding: 0;
}
.learning-objectives li {
    padding: 0.3rem 0;
    padding-left: 1rem;
    position: relative;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}
.learning-objectives li:last-child { border-bottom: none; }
.learning-objectives li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin: 0.4rem 0;
}
.tech-badge {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 500;
}

.timeline {
    position: relative;
    padding-left: 1rem;
    margin: 0.4rem 0;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
}
.timeline-item {
    position: relative;
    padding-bottom: 0.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0.2rem;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    transform: translateX(-3px);
}
.timeline-item h4 { color: var(--primary); margin-bottom: 0.15rem; font-size: 0.8rem; }
.timeline-item p { color: var(--text-muted); font-size: 0.7rem; margin: 0; }

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}
.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.7rem;
}
.contact-link:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ==================== LIGHTBOX ==================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}
.lightbox.active { display: flex; }
.lightbox img { max-width: 95%; max-height: 95%; object-fit: contain; }
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.9);
    padding: 0.4rem;
    text-align: center;
    font-size: 0.7rem;
    border-radius: 4px;
    margin-top: 0.4rem;
}
.footer a { color: var(--lavender-light); }
.footer p { margin: 0.1rem 0; }

.back-to-top {
    display: inline-block;
    margin-bottom: 0.2rem;
    padding: 0.2rem 0.4rem;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    color: white;
    font-size: 0.65rem;
    text-decoration: none;
}
.back-to-top:hover { background: rgba(255,255,255,0.2); color: white; text-decoration: none; }

/* ==================== RESPONSIVE ==================== */
@media (min-width: 1024px) {
    .topics-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .site-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
}

@media (max-width: 768px) {
    h1 { font-size: 1.1rem; }
    h2 { font-size: 0.95rem; }
    .topics-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .hero-images { gap: 0.3rem; }
    .hero-image { width: 120px; }
}

@media (max-width: 500px) {
    .topics-grid { grid-template-columns: 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-buttons { flex-direction: column; }
    .hero-images { flex-direction: column; align-items: center; }
    .hero-image { width: 100%; max-width: 200px; }
    .download-btn { width: 100%; justify-content: center; }
}

@media print {
    .sidebar, .top-nav, .lightbox { display: none; }
    body { background: white; }
}

/* ==================== SUBPAGE STYLES (Topic/Module Pages) ==================== */

/* Page article wrapper */
.page {
    background: var(--surface);
    border-radius: 4px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.page h1 {
    margin-bottom: 0.2rem;
}
.page p {
    margin-bottom: 0.4rem;
}

/* Badges (slide count, part indicators) */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-right: 0.4rem;
    background: var(--primary);
    color: white;
}
.badge.part-1 { background: #27ae60; }
.badge.part-2 { background: var(--accent); }
.badge.part-3 { background: #9b59b6; }
.badge.part-4 { background: #e74c3c; }

/* Topics grid (Key Topics section) */
.page .topics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0;
}
.topic-item {
    background: var(--background);
    padding: 0.35rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    color: var(--text);
    border-left: 3px solid var(--accent);
}

/* Chart grid (Key Visualizations section) */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0;
}
.chart-item {
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
}
.chart-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.chart-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    background: var(--background);
}
.chart-item span {
    display: block;
    padding: 0.3rem;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-light);
    font-weight: 500;
    line-height: 1.2;
}

/* Resource buttons */
.resource-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}
.resource-buttons p {
    display: contents;
}
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s;
    background: var(--accent);
    color: white;
}
.btn:hover {
    background: #e06f00;
    text-decoration: none;
    color: white;
}
.btn.secondary {
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
}
.btn.secondary:hover {
    border-color: var(--primary);
    background: var(--background);
    text-decoration: none;
}

/* Navigation cards (Prev/Next) */
.nav-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--lavender);
}
.nav-card {
    background: var(--surface);
    border-radius: 4px;
    padding: 0.5rem 0.6rem;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.2s;
}
.nav-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transform: translateY(-1px);
    text-decoration: none;
}
.nav-card.prev {
    text-align: left;
    border-left: 3px solid var(--accent);
}
.nav-card.next {
    text-align: right;
    border-right: 3px solid var(--primary);
}
.nav-label {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}
.nav-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
}

/* Responsive adjustments for subpages */
@media (max-width: 600px) {
    .nav-cards {
        grid-template-columns: 1fr;
    }
    .nav-card.next {
        text-align: left;
        border-right: none;
        border-left: 3px solid var(--primary);
    }
    .chart-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Enhanced Topic Pages */

/* Discovery Hook */
.discovery-hook {
  background: linear-gradient(135deg, #e8e0f0 0%, #f0e8f8 100%);
  border-left: 4px solid #3333B2;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-radius: 0 8px 8px 0;
}

.hook-icon {
  background: #3333B2;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
}

.hook-content {
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* Prerequisites */
.prerequisites-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.prerequisites-list li {
  background: #f5f5f5;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 12px;
  color: #555;
  border: 1px solid #e0e0e0;
}

/* Concepts Grid */
.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.concept-item {
  background: #fafafa;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
}

.concept-item strong {
  color: #3333B2;
  display: block;
  font-size: 13px;
  margin-bottom: 0.25rem;
}

.concept-item span {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}
