/* ============================================================
   ALL STYLES - 3-Column Card Layout
   Image between header and content
   ============================================================ */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fb;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
    color: #1a1a1a;
    line-height: 1.6;
    background-image: url("background1.jpg");
}


body {
    font-family: 'Noto Sans Myanmar', sans-serif;
}

/* Use any number from 100 to 900 */
h1 {
    font-weight: 700;
}

p {
    font-weight: 400;
}

.light {
    font-weight: 300;
}

.extra-bold {
    font-weight: 800;
}

.blog-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.blog-header { 
    text-align: center;
    <!-- margin-bottom: 2.5rem; -->   
}

.blog-header h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #1e293b;
}

.blog-header p {
    color: #64748b;
    <!--margin-top: 0.3rem;-->
    font-size: 1rem;
}

.blog-header .stats {
    color: #64748b;
    margin-top: 0.5rem;
    font-size: 0.95em;
}


/* ============================================================
   CARD GRID - 3 COLUMNS
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* ============================================================
   INDIVIDUAL CARD - Image between header and content
   ============================================================ */
.card {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05), 0 4px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.6);
    backdrop-filter: blur(2px);
    height: 100%;
    min-width: 0;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.07), 0 8px 16px rgba(0, 0, 0, 0.03);
    border-color: #d9e2ef;
}

/* Card Content - Wrapper for everything */
.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

/* Card Header - Title and Meta on top */
.card-header {
    padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.card-meta .author {
    color: #2563eb;
    font-weight: 500;
    text-transform: none;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
    margin-bottom: 0.3rem;
    transition: color 0.1s;
}

.card-title a {
    text-decoration: none;
    color: inherit;
}

.card-title a:hover {
    color: #2563eb;
}

/* Card Image - Between header and content */
.card-image {
    height: 200px;
    background: #e9eef4;
    overflow: hidden;
    position: relative;
    margin: 0.5rem 1.5rem 0.5rem 1.5rem;
    border-radius: 12px;
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* Image Fallback */
.card-image .fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #eef2f6, #e2e8f0);
    color: #64748b;
    font-size: 0.9rem;
    border-radius: 12px;
}

.card-image img:not([src]), 
.card-image img[src=""],
.card-image img[src*="error"] {
    display: none;
}

.card-image img:not([src]) + .fallback,
.card-image img[src=""] + .fallback,
.card-image img[src*="error"] + .fallback {
    display: flex;
}

/* Card Body - Content below image */
.card-body {
    padding: 0.5rem 1.5rem 0 1.5rem;
    flex: 1;
}

.card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
    font-family: "Myanmar Text", "Times New Roman", Times, serif;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #edf2f7;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    margin-top: 0.8rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.card-footer .date {
    color: #64748b;
}

.card-footer .read-more {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}

.card-footer .read-more:hover {
    text-decoration: underline;
}

/* ============================================================
   PAGINATION
   ============================================================ */
#pagination-container {
    margin: 2rem 0;
}

.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    min-width: 36px;
    text-align: center;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

.pagination .active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    font-weight: 600;
}

.pagination .disabled {
    color: #999;
    background: #f5f5f5;
    cursor: default;
    border-color: #e5e5e5;
}

.pagination .ellipsis {
    border: none;
    color: #666;
    cursor: default;
}

/* ============================================================
   CONTROLS
   ============================================================ */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
    gap: 10px;
}

.controls select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.controls select:hover {
    border-color: #2563eb;
}

.controls .info {
    color: #666;
    font-size: 0.95em;
}

/* ============================================================
   LOADING, ERROR, EMPTY STATES
   ============================================================ */
.loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    color: #666;
    grid-column: 1 / -1;
}

.error {
    text-align: center;
    padding: 60px 20px;
    background: #fee;
    color: #c00;
    border-radius: 12px;
    grid-column: 1 / -1;
}

.error .details {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    color: #666;
    grid-column: 1 / -1;
}

.retry-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #1d4ed8;
}

/* ============================================================
   BLOG FOOTER
   ============================================================ */
.blog-footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    padding-top: 1.8rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* 3 columns on large screens */
@media (min-width: 901px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns on tablets */
@media (max-width: 800px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .blog-header h1 {
        font-size: 1.8rem;
    }

    .card-image {
        height: 180px;
    }
}

/* 1 column on mobile */
@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    body {
        padding: 1rem 0.75rem;
    }

    .card-content {
        padding: 1.2rem;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-image {
        height: 180px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .controls label {
        display: block;
    }

    .pagination {
        gap: 4px;
        padding: 12px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        min-width: 30px;
        font-size: 12px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .pagination {
        gap: 3px;
        padding: 12px;
    }

    .pagination a,
    .pagination span {
        padding: 4px 8px;
        min-width: 26px;
        font-size: 11px;
    }

    .pagination .prev,
    .pagination .next {
        padding: 4px 10px;
        font-size: 11px;
    }
}