/* --- Global Variables (Based on Tailwind/Design System) --- */
:root {
    --color-amber-700: #b54708;
    --color-amber-600: #d97706;
    --color-amber-100: #fef3c7;
    --color-amber-50: #fffbeb;
    --color-stone-900: #1c1917;
    --color-stone-700: #44403c;
    --color-stone-600: #57534e;
    --color-stone-500: #78716c;
    --color-stone-50: #fafaf9;
    --padding-container: 1rem; /* px-4 */
}

/* Base Layout and Container */
.mi-blog-archive {
    min-height: 100vh;
    background-color: var(--color-stone-50);
}
.mi-container {
    max-width: 1140px; /* Equivalent to max-w-7xl */
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--padding-container);
    padding-right: var(--padding-container);
}
.mi-text-center { text-align: center; }

/* --- 1. Header Section --- */
.mi-blog-header {
    background: linear-gradient(to right, var(--color-amber-700), var(--color-amber-600));
    color: white;
    padding-top: 4rem; /* py-16 */
    padding-bottom: 4rem;
}
.mi-header-title {
    color: white;
    font-size: 2.25rem; /* text-3xl */
    line-height: 2.5rem;
    margin-bottom: 1rem;
}
.mi-header-subtitle {
    font-size: 1.25rem; /* text-xl */
    color: var(--color-amber-50);
    max-width: 48rem; /* max-w-3xl */
    margin-left: auto;
    margin-right: auto;
}

/* --- 2. Categories Filter --- */
.mi-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem; /* gap-3 */
    margin: 3rem 0rem; /* mb-12 */
    justify-content: center;
}
.mi-category-button {
    padding: 0.5rem 1rem; /* px-4 py-2 */
    border-radius: 9999px; /* rounded-full */
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.875rem;
    
    background-color: white;
    color: var(--color-stone-700);
    border: 1px solid transparent;
}
.mi-category-button:hover {
    background-color: var(--color-amber-50);
}
.mi-category-button.active {
    background-color: var(--color-amber-700);
    color: white;
}

/* --- 3. Featured Post --- */
.mi-featured-post {
    background-color: white;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
    overflow: hidden;
    margin-bottom: 3rem;
    border-radius: 20px;
}
.mi-featured-grid {
    display: grid;
    grid-template-columns: 1fr;
}
/* Desktop Layout */
@media (min-width: 1024px) { /* lg:grid-cols-2 */
    .mi-featured-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.mi-featured-image-wrap {
    position: relative;
    height: 16rem; /* h-64 */
}
@media (min-width: 1024px) {
    .mi-featured-image-wrap {
        height: auto;
    }
}

.mi-featured-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}
.mi-featured-image.mi-placeholder {
    background-color: var(--color-stone-500);
}

.mi-featured-tag {
    position: absolute;
    top: 1.5rem; /* top-6 */
    left: 1.5rem; /* left-6 */
    padding: 0.25rem 0.75rem; /* px-3 py-1 */
    background-color: var(--color-amber-600);
    color: white;
    font-size: 0.875rem;
    border-radius: 9999px;
}

.mi-featured-content {
    padding: 2rem; /* p-8 */
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (min-width: 1024px) {
    .mi-featured-content {
        padding: 3rem; /* lg:p-12 */
    }
}

.mi-category-badge-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-amber-100);
    color: var(--color-amber-700);
    font-size: 0.875rem;
    border-radius: 9999px;
    margin-bottom: 1rem;
    width: fit-content;
}

.mi-featured-title {
    color: var(--color-stone-900);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}
.mi-featured-title a {
    text-decoration: none;
    color: inherit;
}

.mi-featured-excerpt {
    color: var(--color-stone-600);
    margin-bottom: 1.5rem;
}

/* Meta Data Row */
.mi-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem; /* gap-4 */
    font-size: 0.875rem; /* text-sm */
    color: var(--color-stone-500);
    margin-bottom: 1.5rem;
}
.mi-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem; /* gap-1 */
}
.mi-meta-item a {
    text-decoration: none;
    color: #333;
}
.mi-meta-item svg {
    flex-shrink: 0;
}

.mi-read-more-btn {
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
    background-color: var(--color-amber-700);
    color: white;
    border-radius: 0.5rem; /* rounded-lg */
    transition: background-color 0.2s;
    width: fit-content;
    text-decoration: none;
    font-weight: 500;
}
.mi-read-more-btn:hover {
    background-color: var(--color-amber-600);
}

/* --- 4. Blog Grid --- */
.mi-blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem; /* gap-6 */
}
@media (min-width: 768px) { /* md:grid-cols-2 */
    .mi-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) { /* lg:grid-cols-3 */
    .mi-blog-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.mi-card-link {
    text-decoration: none;
    /*height: 100%;*/
}

.mi-blog-card {
    background-color: white;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); /* shadow-sm */
    border-radius: 0.75rem; /* rounded-xl */
    overflow: hidden;
    transition: box-shadow 0.2s;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.mi-blog-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); /* shadow-md */
}

.mi-card-image-wrap {
    position: relative;
    height: 15rem; /* h-48 */
    overflow: hidden;
}
.mi-card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s;
}
.mi-blog-card:hover .mi-card-image {
    transform: scale(1.05);
}
.mi-card-image.mi-placeholder-sm {
    background-color: var(--color-stone-400);
}

.mi-card-category-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-amber-600);
    color: white;
    font-size: 0.75rem; /* text-xs */
    border-radius: 9999px;
}

.mi-card-content-area {
    padding: 1.5rem; /* p-6 */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.mi-meta-row.mi-text-xs {
    font-size: 0.75rem; /* text-xs */
    gap: 0.75rem; /* gap-3 */
    margin-bottom: 0;
}
.mi-meta-item-sm {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--color-stone-500);
}

.mi-card-title {
    font-size: 1.125rem; /* text-lg */
    color: var(--color-stone-900);
    margin-bottom: 0rem;
    transition: color 0.2s;
}
.mi-blog-card:hover .mi-card-title {
    color: var(--color-amber-700);
}

.mi-card-excerpt {
    font-size: 0.875rem; /* text-sm */
    color: var(--color-stone-600);
    margin-bottom: 1rem;
    /* Simulate line-clamp-3 (requires JS or complex CSS, using simple overflow for pure CSS) */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mi-author-line {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* gap-2 */
    font-size: 0.875rem;
    color: var(--color-stone-600);
    margin-top: auto; /* Push to bottom */
}

.mi-author-line a {
    text-decoration: none;
    color: #333;
}


/* --- 5. Pagination / Load More --- */
.mi-load-more {
    text-align: center;
    margin-top: 3rem; /* mt-12 */
}
.mi-load-more .page-numbers {
    padding: 0.75rem 2rem; /* px-8 py-3 */
    border: 2px solid var(--color-amber-700);
    color: var(--color-amber-700);
    border-radius: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    margin: 0 0.25rem;
    display: inline-block;
}
.mi-load-more .page-numbers:hover {
    background-color: var(--color-amber-50);
}
.mi-load-more .page-numbers.current {
    background-color: var(--color-amber-700);
    color: white;
}

/* --- 6. Newsletter CTA --- */
.mi-newsletter-cta {
    margin: 4rem 0rem; /* mt-16 */
    background: linear-gradient(to right, var(--color-amber-700), var(--color-amber-600));
    border-radius: 1rem; /* rounded-2xl */
    padding: 3rem; /* p-12 */
    color: white;
    text-align: center;
}
.mi-cta-title {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.875rem;
}
.mi-cta-subtitle {
    color: #ffffff;
    margin-bottom: 2rem; /* mb-8 */
    max-width: 30rem; /* max-w-2xl */
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.mi-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* gap-3 */
    max-width: 28rem; /* max-w-md */
    margin-left: auto;
    margin-right: auto;
}

.mi-newsletter-input {
    flex-grow: 1;
    padding: 0.75rem 1rem; /* px-4 py-3 */
    border-radius: 0.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--color-stone-900);
    transition: box-shadow 0.2s;
    font-family: "DM Sans", sans-serif;
}
.mi-newsletter-input:focus {
    box-shadow: 0 0 0 2px white, 0 0 #0000; /* focus:ring-2 focus:ring-white */
}

.mi-newsletter-button {
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
    background-color: white;
    color: #000;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}
.mi-newsletter-button:hover {
    background-color: var(--color-amber-50);
}


/* Mobile Responsiveness (Small screens, stack email form) */
@media (min-width: 640px) { /* sm:flex-row */
    .mi-newsletter-form {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .mi-header-title {
        font-size: 1.5rem;
    }
    .mi-featured-title {
        font-size: 1.3rem;
    }
    .mi-header-subtitle {
        font-size: 1rem;
    }
    .mi-featured-content {
        padding: 1.5rem;
    }
    .mi-meta-row {
        flex-wrap: wrap;
    }
    .mi-read-more-btn{
        font-size: 0.9rem;
    }
    .mi-cta-title {
        font-size: 1.5rem;
    }
}