/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Visually hidden but accessible label */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Make skip link visible when focused */
.sr-only:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    padding: 0.75rem 1.5rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--primary);
    color: white;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
    font-weight: 600;
}

:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #00a8e8;
    --text-dark: #1a1f36;
    --text-gray: #555;
    --text-light: #7f8c8d;
    --border: #e8e8e8;
    --bg-light: #f8f9fa;
    --bg-lighter: #fafbfc;
    --bg-input: #f8f9fa;
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-dark: #e8e8e8;
    --text-gray: #b0b0b0;
    --text-light: #888;
    --border: #333;
    --bg-light: #1a1a1a;
    --bg-lighter: #121212;
    --bg-input: #1a1a1a;
}

html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-lighter);
    overflow-y: scroll;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Google Fonts now loaded in HTML head for better performance */
/* Note: font-display=swap is already included in the Google Fonts URL parameter */
/* This prevents font-related layout shifts */

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background 0.3s ease;
}

/* Dark mode: Use lighter gradient for better visibility */
[data-theme="dark"] h2 {
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

h4 {
    color: var(--text-dark);
    transition: color 0.3s ease;
}

p {
    color: var(--text-gray);
    line-height: 1.8;
    transition: color 0.3s ease;
}

p strong {
    color: var(--text-dark);
    font-weight: 600;
}

/* ===== Sections ===== */
section {
    display: none;
    padding: 2rem 0 2rem 0;
    animation: fadeIn 0.5s ease;
}

section.active {
    display: block;
}

#blogs.active {
    padding: 1rem 0 2rem 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Container ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    flex: 1;
    min-height: 80vh; /* Prevent layout shift when JS injects content */
    /* Reserve space immediately to prevent CLS */
    contain: layout style;
}

/* ===== Links ===== */
a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary);
}

/* ===== Navigation ===== */
nav {
    background: var(--bg-lighter);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
}

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

.nav-brand {
    flex-shrink: 0;
    white-space: nowrap;
    padding-left: 1.5rem;
}

.brand-link {
    display: inline-block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 300px;
}

.brand-link:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex: 1;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    cursor: pointer;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

/* Enhanced keyboard focus styles for better accessibility */
.nav-links a:focus-visible,
.brand-link:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

.theme-toggle:focus-visible,
.mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible,
.tag-filter-dropdown:focus-visible,
.search-page-input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.pagination-btn:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.search-icon {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-gray);
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
}

.search-icon:hover {
    color: var(--text-dark);
}

/* ===== Theme Toggle ===== */
.search-toggle {
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0.75rem;
}

.search-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: scale(1.1);
}

.search-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.search-toggle:hover svg {
    transform: scale(1.1);
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    color: var(--text-dark);
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: var(--bg-light);
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* ===== Mobile Menu Toggle (Hamburger) ===== */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    display: block;
}

.mobile-menu-toggle span:nth-child(1) {
    top: 3.5px;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 13.5px;
}

.mobile-menu-toggle span:nth-child(3) {
    top: 23.5px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    top: 13.5px;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    top: 13.5px;
    transform: rotate(-45deg);
}

/* ===== Blog Filter ===== */
.blogs-filter-wrapper {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-start;
    padding: 0 1.5rem;
}

.blogs-filter-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blogs-filter-container label {
    font-weight: 600;
    color: var(--text-dark);
}

.tag-filter-dropdown {
    padding: 0.6rem 1rem;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: var(--bg-lighter);
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tag-filter-dropdown:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.1);
}

.tag-filter-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* ===== Search Page ===== */
.search-page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
}

.search-page-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2rem;
    text-align: center;
}

.search-page-input-wrapper {
    margin-bottom: 2rem;
}

.search-page-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: var(--bg-lighter);
    color: var(--text-dark);
}

.search-page-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-page-input::placeholder {
    color: var(--text-light);
}

.search-page-results {
    text-align: left;
    margin-top: 2rem;
    min-height: 500px; /* Prevent layout shift when search results load */
}

.search-page-result-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-page-result-item:hover {
    background: var(--bg-light);
}

.search-page-result-item h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.search-page-result-item p {
    margin: 0.5rem 0 0 0;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.search-page-result-item .search-result-tags {
    margin-top: 0.8rem;
}

.search-results-content {
    padding: 0.75rem;
}

.search-result-item {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-light);
}

.search-result-item h4 {
    color: var(--text-dark);
    margin-bottom: 0.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
}

.search-result-item p {
    color: var(--text-light);
    font-size: 0.8rem;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.search-result-tag {
    display: inline-block;
    background: var(--bg-light);
    color: var(--text-light);
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.search-result-tag-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, #0052a3 100%);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-light);
}

/* ===== About Section ===== */
.about-content {
    display: grid;
    grid-template-columns: 0.7fr 2fr;
    gap: 4rem;
    align-items: start;
}

.profile-section-left {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.profile-name {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0052a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    transition: background 0.3s ease;
}

/* Dark mode: Use lighter gradient for profile name */
[data-theme="dark"] .profile-name {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-image {
    width: 280px;
    height: 280px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 40px rgba(0, 102, 204, 0.15);
    border: 4px solid var(--border);
    transition: all 0.3s ease;
    aspect-ratio: 1/1; /* Prevent layout shift */
}

.profile-image:hover {
    box-shadow: 0 20px 50px rgba(0, 102, 204, 0.25);
}

.profile-info {
    margin-top: 1.5rem;
    text-align: center;
}

.profile-badge {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1.2rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.badge-label {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-value {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 600;
}

.profile-links-professional {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.profile-link-badge {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.profile-link-badge,
.profile-link-badge:hover {
    color: var(--text-dark) !important;
}

.profile-link-badge svg {
    width: 16px;
    height: 16px;
    color: var(--text-dark);
    flex-shrink: 0;
}

.profile-link-badge span {
    flex: 1;
    text-align: left;
}

.profile-link-badge:hover {
    background: var(--bg-light);
    border-color: var(--primary);
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.profile-link-badge:hover svg {
    color: var(--text-dark);
}

/* LinkedIn specific styling - keep it blue */
.profile-link-linkedin svg,
.profile-link-linkedin:hover svg {
    color: #0077b5 !important; /* LinkedIn brand blue */
}

.profile-link-linkedin,
.profile-link-linkedin:hover {
    color: #0077b5 !important; /* LinkedIn brand blue */
}

.about-text p {
    margin-bottom: 1.2rem;
}

.skills {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.skill-category {
    margin-bottom: 1.5rem;
}

.skill-category h3 {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.skill-category p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ===== Skills List Layout ===== */
.skills-list {
    margin-top: 1.5rem;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-item:last-child {
    margin-bottom: 0;
}

.skill-category-name {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    transition: color 0.3s ease;
}

.skill-items {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    transition: color 0.3s ease;
}

/* ===== Projects Section ===== */
.projects-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Courses Section ===== */
.courses-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

.courses-content .project-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    max-width: 400px;
}

.courses-content .project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.courses-content .project-card:hover .project-thumbnail-logo {
    transform: scale(1.05);
}

.courses-content .project-thumbnail-wrapper,
.courses-content .courses-thumbnail-wrapper {
    padding: 1.5rem;
    height: auto;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.courses-content .project-thumbnail-logo,
.courses-content .courses-thumbnail-logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

/* Mobile: Adjust thumbnail */
@media (max-width: 768px) {
    .courses-content .project-thumbnail-wrapper,
    .courses-content .courses-thumbnail-wrapper {
        padding: 1rem;
        min-height: 100px;
    }
    
    .courses-content .project-thumbnail-logo,
    .courses-content .courses-thumbnail-logo {
        max-width: 180px;
    }
}

/* Desktop: Slightly larger thumbnail */
@media (min-width: 769px) {
    .courses-content .project-thumbnail-wrapper,
    .courses-content .courses-thumbnail-wrapper {
        min-height: 140px;
    }
    
    .courses-content .project-thumbnail-logo,
    .courses-content .courses-thumbnail-logo {
        max-width: 220px;
    }
}

.courses-content .project-info {
    padding: 1.25rem;
}

.courses-content .project-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary);
    line-height: 1.3;
}

.courses-content .project-info p {
    margin-bottom: 0;
    color: var(--text-gray);
    line-height: 1.5;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .courses-content {
        padding: 1rem 1rem !important;
    }
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.project-card {
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--bg-light);
}

.project-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.project-thumbnail-wrapper {
    width: 100%;
    height: 140px;
    background: var(--bg-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.project-thumbnail-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    aspect-ratio: 1/1; /* Prevent layout shift */
}

.project-thumbnail-overlay {
    text-align: center;
    color: var(--primary);
}

.project-thumbnail-overlay h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 600;
}

.project-info p {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.85rem;
    line-height: 1.5;
}

.project-url {
    font-size: 0.75rem !important;
    color: var(--primary) !important;
    margin-bottom: 0.5rem !important;
    font-weight: 500;
}

.project-tech-stack {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.tech-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem !important;
    display: block;
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-items span {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
    transition: all 0.3s ease;
}

.tech-items span:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}


/* ===== Blogs Grid ===== */
.blogs-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    min-height: 1000px; /* Increased to better match actual content height and prevent CLS */
}

#blogsContainer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ===== Blog Skeleton Loader ===== */
.blog-skeleton {
    min-height: 1000px; /* Match blogs-grid min-height - increased to prevent CLS */
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blog-skeleton-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    gap: 2.5rem;
    margin: 0;
    border-radius: 12px;
    border: 1px solid transparent; /* placeholder for border */
}

.blog-skeleton-image {
    width: 180px;
    height: 120px;
    background: var(--bg-light);
    border-radius: 8px;
    flex-shrink: 0;
    aspect-ratio: 3/2;
}

.blog-skeleton-content {
    flex: 1;
}

.blog-skeleton-title {
    height: 1.6rem;
    background: var(--bg-light);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    max-width: 600px;
}

.blog-skeleton-text {
    height: 1rem;
    background: var(--bg-light);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    max-width: 400px;
}

.blog-skeleton-meta {
    height: 0.85rem;
    background: var(--bg-light);
    border-radius: 4px;
    margin-top: 0.8rem;
    max-width: 120px;
}

/* ===== Footer ===== */
footer {
    background: var(--bg-light);
    color: var(--text-light);
    text-align: center;
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
    padding-inline: 2rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

footer * {
    margin: 0;
}

footer p {
    line-height: 1.4;
}

/* Footer Social Links with Icons */
.footer-social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--text-dark);
    background: var(--bg-light);
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0;
    position: relative;
    line-height: 0;
}

.footer-social-link,
.footer-social-link:hover {
    color: var(--text-dark) !important;
}

/* LinkedIn specific styling in footer - keep it blue */
.footer-social-link-linkedin svg,
.footer-social-link-linkedin:hover svg {
    color: #0077b5 !important; /* LinkedIn brand blue */
}

/* RSS Feed Icon - Orange */
a[href*="feed.xml"] svg {
    color: #FF9500 !important;
}

a[href*="feed.xml"]:hover svg {
    color: #FF9500 !important;
}

.footer-social-link-linkedin,
.footer-social-link-linkedin:hover {
    color: #0077b5 !important; /* LinkedIn brand blue */
}

.footer-social-link svg {
    width: 20px;
    height: 20px;
}

.footer-social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: var(--bg-light);
}

.footer-social-link:hover svg {
    opacity: 0.8;
}

.footer-social-link-linkedin:hover svg {
    opacity: 1;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.9rem 2.5rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(0, 102, 204, 0.35);
    transform: translateY(-2px);
}

/* ===== Blog Row ===== */
.blog-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    border-radius: 12px;
    gap: 2.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    margin: 0;
    border: 1px solid transparent;
}

/* Removed .blog-image-link as it is no longer used */

.blog-image {
    width: 180px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    aspect-ratio: 3/2; /* Prevent layout shift */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
    -ms-interpolation-mode: bicubic;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: transform;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    filter: contrast(1.02) brightness(1.01);
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
}

.blog-row:hover {
    background: var(--bg-lighter);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.blog-row:hover .blog-image {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.8rem 0 0.5rem 0;
}

.blog-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0052a3 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.blog-content {
    flex: 1;
}

.blog-content h3 {
    margin: 0 0 0.5rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    font-size: 1.4rem; /* Adjusted slightly for better proportion */
    letter-spacing: -0.01em;
    line-height: 1.4;
    color: var(--text-dark);
}

.blog-content p {
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-gray);
    font-weight: 400;
}

/* Article readability improvements */
.project-detail-content,
.blog-post-content {
    font-size: 1.0625rem; /* 17px - better for long-form reading */
}

.project-detail-content p,
.blog-post-content p {
    font-size: 1.0625rem; /* 17px - editorial feel */
}

/* Reduce space between title and date */
.blog-post-header h1,
.blog-post-title {
    margin-bottom: 1.0rem !important; /* was ~1.5rem */
}

.blog-post-meta,
.blog-date {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Reduce the HR spacing under the date */
.blog-post-header hr {
    margin-top: 0.75rem !important; /* was bigger */
    margin-bottom: 1rem !important;
}

/* Mobile blog layout - tighter spacing like Medium */
@media (max-width: 600px) {
    /* Reduce line-height for paragraphs on mobile */
    .blog-post-content {
        line-height: 1.55 !important; /* Medium uses 1.55 instead of 1.8 */
    }
    
    .blog-post-content p {
        line-height: 1.55 !important;
        margin: 0.75rem 0 !important; /* Reduced from 1.5rem */
    }
    
    /* Reduce H1 & H2 top margins */
    .blog-post-content h1,
    .blog-post-content h2 {
        margin-top: 1.5rem !important; /* Reduced from 2rem */
        margin-bottom: 0.75rem !important; /* Reduced from 1rem */
    }
    
    /* Reduce H3 margins */
    .blog-post-content h3 {
        margin-top: 1.25rem !important; /* Reduced from 1.5rem */
        margin-bottom: 0.5rem !important; /* Reduced from 0.75rem */
    }
    
    /* Reduce blog post container padding */
    .blog-post-container {
        padding: 1rem 1rem !important; /* Reduced from 2rem */
    }
    
    /* Reduce blog post header spacing */
    .blog-post-header {
        margin-bottom: 1.5rem !important; /* Reduced from 2rem */
        padding-bottom: 1rem !important; /* Reduced from 1.5rem */
    }
    
    /* Reduce Table of Contents padding and spacing */
    .table-of-contents,
    [class*="table-of-contents"],
    [id*="table-of-contents"] {
        padding: 1rem !important; /* Reduced from 1.5rem or 2rem */
        margin: 1rem 0 !important;
    }
    
    .table-of-contents ul,
    [class*="table-of-contents"] ul {
        line-height: 1.6 !important; /* Reduced from 1.8 */
    }
    
    .table-of-contents li,
    [class*="table-of-contents"] li {
        margin: 0.25rem 0 !important; /* Reduced from 0.4rem */
    }
    
    .table-of-contents a,
    [class*="table-of-contents"] a {
        margin: 0.25rem 0 !important;
    }
    
    /* Reduce project detail container padding */
    .project-detail-container {
        padding: 1rem 1rem !important; /* Reduced from 1.5rem */
    }
}

.blog-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.blog-date {
    font-size: 13px;
    opacity: 0.6;
    font-weight: 400;
    color: var(--text-dark);
    white-space: nowrap;
}

/* Dark mode blog date */
[data-theme="dark"] .blog-date {
    color: #cbd5f5; /* Lighter color for dark mode contrast */
}

/* ===== Pagination ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1.5rem;
    padding: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn:disabled {
    color: var(--text-light);
    border-color: var(--border);
    cursor: not-allowed;
    background: var(--bg-light);
    opacity: 0.5;
}

.pagination-dots {
    color: var(--text-light);
    margin: 0 0.2rem;
    font-weight: 500;
    font-size: 0.8rem;
}

/* ===== Responsive Design ===== */

@media (max-width: 768px) {
    /* Typography */
    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Navigation */
    .nav-container {
        flex-wrap: nowrap;
    }

    .nav-brand {
        flex-shrink: 0;
    }

    .brand-link {
        font-size: 1.1rem;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: var(--bg-lighter);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 0;
        margin: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
        width: 100%;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
    }

    .nav-links a.active::after {
        display: none;
    }

    .nav-links a.active {
        background: var(--bg-light);
        color: var(--primary);
        border-left: 3px solid var(--primary);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-right {
        gap: 0.75rem;
    }

    /* Overlay backdrop for mobile menu */
    .nav-links.active {
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }

    /* Add overlay backdrop */
    body::after {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 280px;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    body.menu-open::after {
        opacity: 1;
        pointer-events: auto;
    }

    /* Blog Filter */
    .blogs-filter-container {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    .tag-filter-dropdown {
        width: 100%;
    }

    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .profile-image {
        width: 240px;
        height: 240px;
    }


    /* Blog Row */
    .blog-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    /* Blog Skeleton - Mobile adjustments */
    .blog-skeleton {
        min-height: 600px; /* Reduced for mobile */
        padding: 1rem 0;
    }

    .blog-skeleton-item {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .blog-skeleton-image {
        width: 100%;
        max-width: 120px;
        height: 80px;
    }

    .blog-skeleton-title,
    .blog-skeleton-text {
        max-width: 100%;
    }

    /* Sections */
    section {
        padding: 2rem 0;
    }

    .container {
        padding: 0 1rem;
    }

    /* Search Modal */
    .search-container {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    /* Navigation */
    nav {
        padding: 1rem 0;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .nav-links a {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }

    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }

    .brand-link {
        font-size: 1rem;
    }

    .nav-brand {
        padding-left: 1rem;
    }

    /* Blog Row */
    .blog-row {
        padding: 1rem;
    }

    .blogs-filter-wrapper {
        padding: 0 1rem;
    }

    /* Blog Skeleton - Small mobile adjustments */
    .blog-skeleton {
        min-height: 500px; /* Further reduced for small screens */
        padding: 0.5rem 0;
    }

    .blog-skeleton-item {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .blog-skeleton-image {
        width: 100%;
        max-width: 120px;
        height: 80px;
    }

    .blog-meta {
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .blog-date {
        text-align: left;
    }

    /* Footer */
    footer {
        padding: 1.5rem;
    }

}

/* ===== Responsive Design ===== */

@media (max-width: 768px) {
    /* Typography */
    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.1rem;
}

    /* Navigation */
.nav-container {
        flex-wrap: nowrap;
}

.nav-brand {
    flex-shrink: 0;
}

.brand-link {
        font-size: 1.1rem;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: var(--bg-lighter);
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        padding: 0;
        margin: 0;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.3s ease;
}

    .nav-links.active {
    display: flex;
        transform: translateX(0);
}

    .nav-links li {
        width: 100%;
}

.nav-links a {
        display: block;
        padding: 1rem 2rem;
        width: 100%;
        font-size: 1rem;
        border-bottom: 1px solid var(--border);
}

    .nav-links a.active::after {
        display: none;
}

.nav-links a.active {
        background: var(--bg-light);
    color: var(--primary);
        border-left: 3px solid var(--primary);
    }

    .mobile-menu-toggle {
        display: flex;
}

    .nav-right {
        gap: 0.75rem;
    }

    /* Overlay backdrop for mobile menu */
    .nav-links.active {
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

    /* Add overlay backdrop */
    body::after {
        content: '';
        position: fixed;
        top: 60px;
        left: 0;
        right: 280px;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
}

    body.menu-open::after {
        opacity: 1;
        pointer-events: auto;
    }

    /* Blog Filter */
    .blogs-filter-container {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }

    .tag-filter-dropdown {
        width: 100%;
}

    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
}

    .profile-image {
        width: 240px;
        height: 240px;
    }


    /* Blog Row */
    .blog-row {
    flex-direction: column;
        align-items: flex-start;
    }

    /* Sections */
    section {
        padding: 2rem 0;
}

    .container {
        padding: 0 1rem;
    }

    /* Search Modal */
    .search-container {
        max-width: 90%;
}
}

@media (max-width: 600px) {
    #blogs.active {
        padding-top: 0.25rem;
}

.blogs-filter-wrapper {
        margin-bottom: 0.25rem;
}

    .blog-row {
    gap: 1rem;
        padding-top: 0.25rem;
        padding-bottom: 0.25rem;
    }

    .blogs-grid, 
    #blogsContainer {
        gap: 0.25rem;
}
}

@media (max-width: 480px) {
    /* Navigation */
    nav {
        padding: 1rem 0;
}

    .nav-container {
        padding: 0 1rem;
    }

    .nav-links a {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
}

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
}

    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }

    .brand-link {
    font-size: 1rem;
    }

    .nav-brand {
        padding-left: 1rem;
    }

    /* Blog Row */
    .blog-row {
        padding: 1rem;
}

    .blogs-filter-wrapper {
        padding: 0 1rem;
    }

    .blog-meta {
        flex-direction: row;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0.5rem;
}

    .blog-date {
    text-align: left;
}

    /* Footer */
    footer {
    padding: 1.5rem;
    }

}


/* ===== Project/Course Detail Pages ===== */
.project-detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem; /* Changed to 1.5rem to align with nav brand */
    position: relative;
}

/* Mobile padding adjustment */
@media (max-width: 480px) {
    .project-detail-container {
        padding: 1rem 1rem;
    }
}

.project-detail-header {
    margin-bottom: 0.75rem;      /* was 1rem */
    padding-bottom: 0.5rem;      /* was 0.75rem */
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}

.project-detail-header-content {
    flex: 1;
    min-width: 0;
}

.project-detail-title {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.35rem !important; /* was 0.25rem, tightened like blog posts */
    line-height: 1.3;
    color: var(--text-dark);
    letter-spacing: -0.02em;
    margin-top: 0;
    padding-top: 0;
}

.project-detail-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-top: 0 !important;
    margin-bottom: 0.35rem !important; /* tightened like blog posts */
}

.project-detail-thumbnail {
    width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    object-fit: contain;
    flex-shrink: 0;
}

.project-detail-content {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.75;
    font-size: 1.0625rem; /* 17px - better for long-form reading */
    color: var(--text-dark);
}

.project-detail-content h2 {
    font-size: 1.75rem;
    font-weight: 400;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    line-height: 1.4;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.project-detail-content h2:first-of-type {
    margin-top: 0;
}

.project-detail-content h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.project-detail-content p {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-size: 1.0625rem; /* 17px - editorial feel */
}

.project-detail-content ul {
    margin: 0.5rem 0;
    padding-left: 2rem;
}

.project-detail-content li {
    margin: 0.25rem 0;
    line-height: 1.5;
    color: var(--text-dark);
}

.project-tech-stack-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.project-tech-stack-detail .tech-items span {
    background: var(--primary);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.back-to-projects {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.back-to-projects:hover {
    text-decoration: underline;
}

.course-modules {
    margin: 0.25rem 0 1rem 0;
}

.course-module {
    display: flex !important;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
    text-decoration: none !important;
    color: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.module-thumbnail {
    flex-shrink: 0;
    width: 140px;
    height: 94px;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-light);
    border: 1px solid var(--border);
}

.module-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* Mobile: Make thumbnails larger */
@media (max-width: 768px) {
    .module-thumbnail {
        width: 120px;
        height: 80px;
    }
}

/* Desktop: Even larger thumbnails */
@media (min-width: 1024px) {
    .module-thumbnail {
        width: 160px;
        height: 107px;
    }
}

.course-module:hover .module-thumbnail img {
    transform: scale(1.05);
}

.module-text {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
}

.course-module * {
    text-decoration: none !important;
}

.course-module:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
    background-color: rgba(0, 102, 204, 0.08);
}

.course-module h3 {
    margin-top: 0;
    margin-bottom: 0.25rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

/* Remove old animation */
@media (prefers-reduced-motion: reduce) {
    .module-thumbnail img {
        transition: none;
}
    .course-module h3 {
        animation: none !important;
}
    html {
        scroll-behavior: auto;
    }
}

.course-module:hover p {
    color: var(--text-dark);
}

.course-module p {
    margin-bottom: 0;
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: #000;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    z-index: 1000;
}

.section-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem 0;
    padding: 0;
}

.section-nav-bubble {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    background: var(--bg-lighter);
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.section-nav-bubble:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.2);
}

.section-nav-bubble:active {
    transform: translateY(0);
}

.course-section {
    margin-bottom: 0.25rem;
}

.section-pill {
    width: 100%;
    margin: 1rem 0 0;
    padding: 0.5rem 0.75rem;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 1.1rem;
    scroll-margin-top: 180px; /* Account for sticky nav (72px) + TOC height (~108px) */
    position: relative;
    z-index: 1;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.section-pill:hover {
    background-color: var(--primary-dark);
}

.section-pill:active {
    transform: scale(0.98);
}

.section-pill-icon {
    width: 24px;
    height: 24px;
        flex-shrink: 0;
        display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.9;
    }

.section-pill:hover .section-pill-icon {
    opacity: 1;
    }

.section-pill-icon svg {
        width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: none;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
    }

.section-pill.collapsed .section-pill-icon {
    transform: rotate(-90deg);
    }

.section-pill-text {
    flex: 1;
    }

.section-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease 0.1s, margin 0.3s ease;
    opacity: 1;
    margin-top: 0;
}

.section-content.collapsed {
    max-height: 0 !important;
        opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, margin 0.3s ease;
    }

.section-content-inner {
    padding-top: 0;
}

.cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease;
    }

.btn-secondary:hover {
    background: rgba(0, 102, 204, 0.08);
    }

/* Gray styling for Coming Soon sections (6, 7, 8) */
#eval.section-pill,
#scale.section-pill,
#govern.section-pill {
    background: #6b7280;
    color: #fff;
    }

#eval.section-pill:hover,
#scale.section-pill:hover,
#govern.section-pill:hover {
    background: #4b5563;
    }

/* Disable pointer for coming soon sections */
#eval.section-pill,
#scale.section-pill,
#govern.section-pill {
    cursor: default;
    }

/* Style for non-clickable course modules (sections 6, 7, 8) */
.course-section:nth-of-type(6) .course-module,
.course-section:nth-of-type(7) .course-module,
.course-section:nth-of-type(8) .course-module {
    cursor: default;
    opacity: 0.7;
    }

.course-section:nth-of-type(6) .course-module:hover,
.course-section:nth-of-type(7) .course-module:hover,
.course-section:nth-of-type(8) .course-module:hover {
    border-color: var(--border);
    background-color: var(--bg-lighter);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

html {
    scroll-padding-top: 180px; /* Fallback for anchor scrolling - nav (72px) + TOC (~108px) */
}

/* ===== Share Buttons ===== */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-gray);
    cursor: pointer;
    transition: opacity 0.2s ease;
    text-decoration: none;
}

.share-btn:hover {
    opacity: 0.7;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Copy link - gray, blue on hover */
.share-btn.copy-link {
    color: var(--text-gray);
}

.share-btn.copy-link:hover {
    color: var(--primary);
    opacity: 1;
}

/* LinkedIn - always blue */
.share-btn.linkedin {
    color: #0077b5;
}

/* Twitter/X - black (white in dark mode) */
.share-btn.twitter {
    color: #000;
}

[data-theme="dark"] .share-btn.twitter {
    color: #fff;
}

.share-btn.copied {
    color: #22c55e;
}

/* Tooltip for copy button */
.share-btn.copy-link {
    position: relative;
}

.share-btn.copy-link::after {
    content: 'Copied!';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 4px;
    background: #22c55e;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.share-btn.copy-link.copied::after {
    opacity: 1;
}

/* Giscus Comments */
.giscus {
    width: 100%;
}

.giscus-frame {
    width: 100% !important;
    border: none;
}