/* === CONTENT SECTIONS === */
.section-container {
    padding: 40px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    color: var(--jp-navy);
    border-bottom: 3px solid var(--jp-blue-light);
    display: inline-block;
    padding-bottom: 5px;
    font-size: 2rem;
}

/* === FEATURED CAROUSEL (สไลด์บทความเด่น) === */
.carousel-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto 60px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 43, 91, 0.15);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 300%;
    /* 3 slides = 300% */
}

.carousel-slide {
    width: 33.333%;
    /* 100% / 3 slides */
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
    filter: brightness(0.65);
    /* ดรอปแสงภาพเพื่อให้ตัวหนังสือชัด */
}

.carousel-content {
    position: absolute;
    bottom: 40px;
    left: 50px;
    right: 50px;
    color: var(--white);
    text-align: left;
}

.carousel-content span.badge {
    background: var(--jp-blue-light);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 10px;
    display: inline-block;
}

.carousel-content h3 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-content p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 700px;
    margin-bottom: 15px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    color: var(--jp-navy);
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background: var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

/* === GRID SYSTEM (บทความทั่วไป 3x2) === */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.card {
    background: white;
    border: 1px solid #eee;
    padding: 20px;
    transition: 0.3s;
    text-align: center;
    border-radius: 4px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.article-card {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.article-card img {
    height: 180px;
    width: 100%;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.article-card h3 {
    font-size: 1.1rem;
    margin: 10px 0;
    color: var(--jp-navy);
    line-height: 1.4;
}

.article-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
    flex-grow: 1;
}

.read-more {
    color: var(--jp-blue-light);
    font-weight: 500;
    font-size: 0.95rem;
    display: inline-block;
    margin-top: auto;
}

.read-more:hover {
    color: var(--jp-navy);
    text-decoration: underline;
}

/* === PAGINATION (แถบควบคุมหน้า) === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: var(--white);
    color: var(--text-main);
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: 0.3s;
}

.page-btn:hover {
    border-color: var(--jp-navy);
    color: var(--jp-navy);
}

.page-btn.active {
    background: var(--jp-navy);
    color: var(--white);
    border-color: var(--jp-navy);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #ddd;
    color: var(--text-light);
}

.page-btn.disabled:hover {
    background: var(--white);
    border-color: #ddd;
}

/* Responsive */
@media (max-width: 992px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .carousel-content h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .carousel-slide img {
        height: 300px;
    }

    .carousel-content {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}