:root {
    --blue-900: #0a2342;
    --blue-700: #123D70;
    --blue-500: #1f6feb;
    --blue-300: #76a9ff;
    --slate-900: #0b0f19;
    --slate-700: #1a2233;
    --slate-100: #f4f6fb;
    --white: #ffffff;
}

/* Dark theme variables */
[data-theme="dark"] {
    --bs-body-bg: var(--slate-900);
    --bs-body-color: var(--slate-100);
    --bs-light: var(--slate-700);
    --bs-light-rgb: 26, 34, 51;
    --bs-dark: var(--slate-100);
    --bs-dark-rgb: 244, 246, 251;
}

/* System font stack */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    font-feature-settings: "kern";
    line-height: 1.6;
}

/* Bootstrap color overrides */
.bg-primary {
    background-color: var(--blue-500) !important;
}

.btn-primary {
    background-color: var(--blue-500);
    border-color: var(--blue-500);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--blue-700);
    border-color: var(--blue-700);
}

.btn-outline-primary {
    color: var(--blue-500);
    border-color: var(--blue-500);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--blue-500);
    border-color: var(--blue-500);
}

.text-primary {
    color: var(--blue-500) !important;
}

.badge.bg-primary {
    background-color: var(--blue-500) !important;
}

/* Dark theme adjustments */
[data-theme="dark"] .bg-light-subtle {
    background-color: var(--slate-700) !important;
}

[data-theme="dark"] .text-muted {
    color: #9ca3af !important;
}

[data-theme="dark"] .card {
    background-color: var(--slate-500);
    border-color: var(--slate-500);
}

[data-theme="dark"] .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.2);
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus,
.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(31, 111, 235, 0.25);
    outline: none;
}

/* Hero section */
.hero-section {
    min-height: 60vh;
    background: linear-gradient(135deg, var(--slate-100) 0%, var(--white) 100%);
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, var(--slate-900) 0%, var(--slate-700) 100%);
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-illustration {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 25px rgba(31, 111, 235, 0.1));
}

/* Card hover effects */
.post-card,
.category-card,
.related-post-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover,
.category-card:hover,
.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .post-card:hover,
[data-theme="dark"] .category-card:hover,
[data-theme="dark"] .related-post-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Blog post cards */
.blog-post-card .post-image {
    height: 200px;
    border-radius: 8px 8px 0 0;
}

.post-image {
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
}

/* Category cards */
.category-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: var(--blue-300);
}

[data-theme="dark"] .category-card {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .category-card:hover {
    border-color: var(--blue-300);
}

/* Filter buttons */
#filter-buttons .btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

#filter-buttons .btn.active {
    background-color: var(--blue-500);
    border-color: var(--blue-500);
    color: white;
}

/* Hidden posts for load more functionality */
.post-card.hidden {
    display: none;
}

/* Article content styling */
.article-content {
    font-size: 1.1rem;
    line-height: 1.75;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--blue-700);
}

[data-theme="dark"] .article-content h2 {
    color: var(--blue-300);
}

.article-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Code blocks */
pre {
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Newsletter form */
#newsletter-form .form-control {
    border-radius: 8px 0 0 8px;
}

#newsletter-form .btn {
    border-radius: 0 8px 8px 0;
    white-space: nowrap;
}

/* Footer */
footer a:hover {
    color: var(--blue-300) !important;
    transition: color 0.2s ease;
}

/* Theme toggle button */
#theme-toggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
    }

    .display-4 {
        font-size: 2rem;
    }

    .display-5 {
        font-size: 1.75rem;
    }

    .hero-illustration {
        width: 300px;
        height: 225px;
    }

    #filter-buttons {
        justify-content: center;
    }

    #filter-buttons .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }

    .article-content {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .display-4 {
        font-size: 1.75rem;
    }

    .hero-illustration {
        width: 250px;
        height: 190px;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 1rem;
    }

    #newsletter-form {
        flex-direction: column;
    }

    #newsletter-form .form-control {
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    #newsletter-form .btn {
        border-radius: 8px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Link hover effects */
a {
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Loading state for load more */
#load-more-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--blue-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--blue-500);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--slate-700);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--blue-300);
}

/* Coming Soon Ribbon */
.coming-soon-card {
    position: relative;
    overflow: hidden;
}

.coming-soon-ribbon {
    position: absolute;
    top: 35px;
    /* moves it lower */
    right: -50px;
    /* extend more outward so the diagonal fully spans */
    background: #dc3545;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 60px;
    /* wider so it covers corner nicely */
    transform: rotate(45deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 10;
}



/* Prevent clicking while it's "coming soon" */
.disabled-link {
    pointer-events: none;
    cursor: default;
}

/* White navbar with blue text */
#site-navbar {
    background-color: #fff !important;
    transition: box-shadow .25s ease, padding .25s ease;
}

/* Blue links with underline animation */
.navbar-light .navbar-nav .nav-link {
    color: var(--bs-primary);
    font-weight: 500;
    transition: color .2s ease;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: #0b5ed7;
}

.link-underline {
    position: relative;
}

.link-underline::after {
    content: "";
    position: absolute;
    left: .4rem;
    right: .4rem;
    bottom: .3rem;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
    opacity: .7;
}

.link-underline:hover::after,
.link-underline.active::after {
    transform: scaleX(1);
}

/* Hover animation only for buttons */
.button-hover {
    transition: transform .2s ease, box-shadow .2s ease;
}

.button-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1);
}

/* Shrink navbar on scroll */
#site-navbar.nav-scrolled {
    box-shadow: 0 .25rem .9rem rgba(0, 0, 0, .08);
    padding-top: .25rem;
    padding-bottom: .25rem;
}

@media (max-width: 991.98px) {
    .navbar-collapse.collapse:not(.show) {
        display: block;
        /* keep block so we can animate height */
        height: 0;
        overflow: hidden;
        transition: height .3s ease;
    }

    .navbar-collapse.collapsing {
        height: 0 !important;
        overflow: hidden;
    }

    .navbar-collapse.collapse.show {
        height: auto;
        transition: height .3s ease;
    }
}

@media (max-width: 991.98px) {
    .navbar-nav .nav-link {
        padding: .75rem 1rem;
        font-size: 1.05rem;
    }

    .button-hover {
        padding: .6rem 1rem;
    }
}

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1040;
}

.nav-overlay.show {
    display: block;
}

/* Footer Enhancements */
.footer-link {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-link:hover {
    opacity: 1 !important;
    transform: translateX(2px);
    color: var(--bs-light) !important;
}

.social-link {
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    opacity: 1 !important;
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
    color: var(--bs-light) !important;
}

.footer-newsletter-form .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background-color: #2d3238 !important;
}

.footer-newsletter-form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.back-to-top {
    transition: all 0.2s ease;
    border: none !important;
    font-size: 0.875rem;
}

.back-to-top:hover {
    opacity: 1 !important;
    transform: translateY(-1px);
    color: var(--bs-light) !important;
}

/* Responsive footer stats */
@media (max-width: 576px) {
    .footer-newsletter-form .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .social-link {
        width: 32px;
        height: 32px;
    }
}

.form-embed-wrapper {
    width: 100%;
    min-height: 500px;
    /* was 1300–1600px, now taller */
    overflow: hidden;
    position: relative;
}

.form-embed-wrapper iframe {
    width: 100%;
    height: 200%;
    border: none;
}

@media (max-width: 768px) {
    .form-embed-wrapper {
        min-height: 4000px;
        /* taller for tablets */
    }
}

@media (max-width: 576px) {
    .form-embed-wrapper {
        min-height: 4200px;
        /* extra tall on phones */
    }
}

.bg-extra {
    background-color: #fd7e14;
    /* amber orange */
    color: #fff;
}

[data-theme="light"] .bg-light-blue {
    background-color: #f4f6fb;
    /* only applied in dark theme */
}

[data-theme="light"] .bg-very-light-blue {
    background-color: #f8f8fa;
    /* only applied in dark theme */
}

h2.about-heading {
    font-weight: 700;
    background: linear-gradient(90deg, var(--blue-500), var(--blue-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}