/*
================================================
TABLE OF CONTENTS
================================================
1. GLOBAL STYLES & ANIMATIONS
2. LAYOUT & HELPERS
3. COMPONENT STYLES
4. POST CONTENT (Mobile-First)
    4.1. Typography
    4.2. Images
5. RESPONSIVE STYLES
    5.1. Small Screens (sm)
    5.2. Large Screens (lg)
================================================
*/


/* --- 1. GLOBAL STYLES & ANIMATIONS --- */
body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(to bottom right, #bad9f1, #ebf2f7, #bad9f1);
    background-size: 200% 200%;
    background-attachment: fixed;
    animation: gradientAnimation 15s ease infinite;
}

@keyframes gradientAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


/* --- 2. LAYOUT & HELPERS --- */
.equal-height-grid {
    grid-auto-rows: 1fr;
}

.content-gradient {
    background: linear-gradient(to bottom right, rgb(243 232 255 / 0.8), rgb(231 223 252 / 0.9));
}


/* --- 3. COMPONENT STYLES --- */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.nav-link {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    transition: all 0.5s ease-in-out;
}

.nav-link.active {
    color: #0f172a;
    background-color: #dec5f7;
    font-weight: 500;
    border-bottom-color: transparent;
}

.nav-link:not(.active):hover {
    background-color: #e9e1fc;
}

.video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    margin-bottom: 1.25rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.image-top-shadow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 12px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.07), transparent);
    pointer-events: none;
    z-index: 1;
}

.dark-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.05); 
    z-index: 1; /* Ensure it's above the image */
}


/* --- 4. POST CONTENT (Mobile-First) --- */

/* 4.1. Typography */
.post-content {
    /* Set a smaller base font for mobile (13px) to scale all rem units down */
    font-size: 0.9rem;
    letter-spacing: -0.05em;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    font-weight: bold;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.post-content h1 {
    font-size: 1.3rem;
}

.post-content h2 {
    font-size: 1.2rem;
}

.post-content h3 {
    font-size: 1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.post-content a {
    color: #3b82f6;
    text-decoration: underline;
}

.post-content :not(pre)>code {
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 6px;
}

.post-content pre code {
    padding: 1em;
    display: block;
    overflow-x: auto;
}

.post-content pre {
    margin-bottom: 1.5rem;
    font-size: inherit;
}

.post-content ul {
    list-style-type: disc;
    padding-left: 2em;
    margin-bottom: 1em;
}

.post-content ol {
    list-style-type: decimal;
    padding-left: 2em;
    margin-bottom: 1em;
}

.post-content blockquote {
    border-left: 4px solid #cbd5e1;
    padding-left: 1em;
    margin-left: 0;
    font-style: italic;
    color: #475569;
}

/* 4.2. Images */
.post-content>img,
.post-content p>img,
.post-content .image-card img {
    max-width: 100%;
    display: block;
    margin-left: auto;
    margin-right: auto;
    max-height: 50rem;
}

.post-content>img,
.post-content p>img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.post-content .image-card {
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    margin: 2em auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    background-color: #f8fafc;
}

.post-content .image-card img {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.post-content .image-card .image-caption {
    padding: 0.5em 1em;
    text-align: center;
    font-size: 0.7rem;
    color: #475569;
}


/* --- 5. RESPONSIVE STYLES --- */

/* 5.1. Small Screens ('sm' breakpoint, 640px) and up */
@media (min-width: 640px) {

    .post-content>img,
    .post-content p>img,
    .post-content .image-card img {
        /* Calculation: 56rem container - 3rem outer padding - 6rem inner padding */
        max-height: 47rem;
    }
    .post-content pre {
    margin-bottom: 1.6rem;
}
}

/* 5.2. Large Screens ('lg' breakpoint, 1024px) and up */
@media (min-width: 1024px) {

    /* Adjust image max-height */
    .post-content>img,
    .post-content p>img,
    .post-content .image-card img {
        /* Calculation: 56rem container - 4rem outer padding - 8rem inner padding */
        max-height: 44rem;
    }

    /* Adjust typography for desktop */
    .post-content {
        /* On large screens, align with prose-xl which sets a 20px base font */
        font-size: 1rem;
    }

    .post-content h1 {
        font-size: 2.25rem;
    }

    .post-content h2 {
        font-size: 1.875rem;
    }

    .post-content h3 {
        font-size: 1.5rem;
    }

    .post-content p {
        margin-bottom: 1.6rem;
        line-height: 2.2;
    }

    .post-content .image-card .image-caption {
        padding: 0.75em 1em;
        font-size: 0.9rem;
    }
}