/* Import Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Set the default font for the entire page */
body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #1F1247;
    background-color: #FFFFFF;
}

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

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

::-webkit-scrollbar-thumb {
    background: #C9E975;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8d665;
}

/* Smooth transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: #1F1247;
}

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

a:hover {
    color: #C9E975;
}

/* Button Base Styles */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

/* Navigation Styles */
.nav-link {
    position: relative;
    font-weight: 500;
    color: #C9E975;
    text-decoration: none;
}

.nav-link:hover {
    color: #C9E975;
}

/* Mobile menu animation */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
    transform: translateX(0);
}

/* Card Styles */
.blog-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Tag Styles */
.tag {
    display: inline-block;
    background-color: rgba(201, 233, 117, 0.1);
    color: #1F1247;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(201, 233, 117, 0.3);
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #C9E975;
    color: #1F1247;
    transform: translateY(-2px);
    border-color: #C9E975;
}

/* Article Content Styles */
.article-content {
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #1F1247;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: #4B5563;
}

.article-content img {
    border-radius: 0.75rem;
    margin: 1.5rem 0;
    max-width: 100%;
    height: auto;
}

.article-content blockquote {
    border-left: 4px solid #C9E975;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6B7280;
}

.article-content code {
    background-color: rgba(201, 233, 117, 0.1);
    color: #1F1247;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875em;
}

.article-content pre {
    background-color: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Focus Styles for Accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: none;
    outline-offset: 0;
}


/* --- Responsive Media Queries --- */

/* For tablets and mobile devices (breakpoint: 768px) */
@media (max-width: 768px) {
    /* Adjust body font size slightly for better scaling */
    body {
        font-size: 15px;
    }

    /* Adjust header logo and title size */
    header .h-12 {
        height: 2.75rem; /* 44px */
    }
    header h1 {
        font-size: 1.25rem; /* 20px */
    }

    /* Adjust hero section typography on the main page */
    main section.text-center h2 {
        font-size: 2.25rem; /* 36px */
        line-height: 1.2;
    }
    main section.text-center p {
        font-size: 1rem; /* 16px */
    }

    /* Adjust padding for main content and footer */
    main.container, footer .container {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    /* Ensure blog cards stack in a single column */
    #posts-container {
        grid-template-columns: 1fr;
    }

    /* Improve readability of single post articles */
    .article-content {
        line-height: 1.7;
    }
    .article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }
    .article-content h1 { font-size: 1.8rem; }
    .article-content h2 { font-size: 1.5rem; }
    .article-content h3 { font-size: 1.3rem; }
    .article-content p { 
        margin-bottom: 1.25rem;
        font-size: 1rem;
    }
    .article-content pre {
        padding: 0.75rem;
    }
}

/* For smaller mobile devices (breakpoint: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    /* Further reduce header size */
    header .h-12 {
        height: 2.5rem; /* 40px */
    }
    header h1 {
        font-size: 1.1rem; /* ~18px */
    }

    /* Adjust hero section typography for small screens */
    main section.text-center h2 {
        font-size: 1.8rem; /* ~29px */
    }
    main section.text-center p {
        font-size: 0.95rem; /* ~15px */
    }

    /* Reduce padding on containers */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Further refine article typography */
    .article-content h1 { font-size: 1.6rem; }
    .article-content h2 { font-size: 1.35rem; }
    .article-content h3 { font-size: 1.2rem; }
    .article-content p { font-size: 0.95rem; }
}