/* ══════════════════════════════════════
       /article/all - News & Articles
       ══════════════════════════════════════ */
.ap-page {
    background: var(--bs-bg-page);
    padding-bottom: 56px;
}

/* ── แบนเนอร์หัวหน้า ── */
.ap-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* ── แถวบน: การ์ดเด่น | ยอดนิยม-แนะนำ ── */
/* ต้องเป็น minmax(0, …) ไม่ใช่ 1fr เฉย ๆ
   เพราะ 1fr = minmax(auto, 1fr) คอลัมน์จะถูกความกว้างขั้นต่ำของเนื้อหาดันจนสัดส่วนเพี้ยน
   (ก่อนรูปโหลดเสร็จ คอลัมน์ขวากว้างเกิน บีบคอลัมน์ซ้ายจนแคบ แล้วค่อยขยายทีหลัง
    ซึ่งทำให้ owl ที่วัดความกว้างตอน ready ได้ค่าผิด) */
.ap-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 34px;
    padding: 40px 0 8px;
}

/* หัวข้อมีขีดน้ำเงินคั่นด้านซ้าย */
.ap-lead {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--bs-primary-900);
    border-left: 4px solid var(--bs-primary-500);
    padding-left: 14px;
    margin: 0 0 20px;
}

.ap-em {
    color: var(--bs-primary-500);
}

/* ── การ์ดเด่น ── */
.ap-feat-card {
    display: block;
    text-decoration: none;
}

.ap-feat-cover {
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
    box-shadow: 0 4px 16px rgba(33, 48, 105, .12);
}

.ap-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ap-feat-cover .ap-cover-img {
    aspect-ratio: 4 / 3;
}

.ap-feat-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--bs-primary-900);
    margin: 16px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* แถวสถิติ (component x-article.stats) */
.ap-meta {
    font-size: 12.5px;
    color: #677088; /* เข้มขึ้นจาก #8B93A7 ให้คอนทราสต์ผ่าน 4.5:1 */
    gap: 6px !important;
}

.ap-meta i {
    margin-right: 2px;
}

.ap-feat-owl .owl-dots {
    text-align: center;
    margin-top: 16px;
    line-height: 0;
}

.ap-feat-owl .owl-dot span {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #C6CEDE !important;
    margin: 0 4px;
}

.ap-feat-owl .owl-dot.active span {
    background: var(--bs-secondary-900) !important;
}

/* ── ฝั่งขวา: แท็บ + รายการแนวนอน ── */
/* แท็บ ยอดนิยม/แนะนำ ใช้ component .app-tabs / .app-tab - นิยามอยู่ที่ main.css */

.ap-pane {
    display: none;
}

.ap-pane.on {
    display: block;
}

.ap-row {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #E9EEF7;
    border-radius: 10px;
    box-shadow: 0 3px 14px rgba(33, 48, 105, .06);
    padding: 16px;
    margin-bottom: 16px;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
}

.ap-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(33, 48, 105, .14);
}

.ap-row-cover {
    flex: 0 0 195px;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
}

.ap-row-cover .ap-cover-img {
    aspect-ratio: 4 / 3;
}

.ap-row-body {
    flex: 1;
    min-width: 0;
}

.ap-row-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--bs-primary-900);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ap-row-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #677085; /* เข้มขึ้นจาก #7B8499 ให้คอนทราสต์ผ่าน 4.5:1 */
    margin: 8px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Latest News Update ── */
.ap-latest {
    padding-top: 34px;
}

.ap-heading {
    font-size: 26px;
    font-weight: 700;
    color: var(--bs-primary-900);
    margin: 0 0 18px;
}

.ap-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.ap-filter-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--bs-primary-900);
    margin: 0;
    white-space: nowrap;
}

/* ตัวเลือกหมวด ใช้ component select-dropdown (.app-dd / .app-dd-menu) - นิยามอยู่ที่ main.css */

/* การ์ดในตาราง - article-list.css ให้พื้นกรมท่าตัวหนังสือขาว
   หน้านี้ตามแบบเป็นการ์ดขาวตัวหนังสือกรมท่า จึงทับเฉพาะในขอบเขต .ap-latest */
.ap-latest .container {
    max-width: 100%;
    padding: 0;
    margin: 0;
}

.ap-latest .grid-article {
    gap: 24px;
}

.ap-latest .card-article {
    border: 1px solid #E9EEF7;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    color: var(--bs-primary-900);
    box-shadow: 0 3px 14px rgba(33, 48, 105, .08);
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}

.ap-latest .card-article:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(33, 48, 105, .16);
}

.ap-latest .card-article img {
    border-radius: 0;
    height: 190px;
}

.ap-latest .card-body.article {
    background: #fff;
    border-radius: 0;
    height: auto;
}

.ap-latest .card-body.article .title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--bs-primary-900);
    border: 0;
    height: auto;
    min-height: calc(2 * 1.5em);
    margin-bottom: 10px;
}

.ap-latest .card-body.article .stats {
    font-size: 12.5px;
    color: #677088; /* เข้มขึ้นจาก #8B93A7 ให้คอนทราสต์ผ่าน 4.5:1 */
}

/* .ap-empty → .empty-state / .empty-state-boxed (main.css) */

/* ── Responsive ── */
@media (max-width: 991.98px) {
    .ap-top {
        /* ต้องเป็น minmax(0, 1fr) ด้วยเหตุผลเดียวกับกฎจอใหญ่ข้างบน
           1fr เฉย ๆ = minmax(auto, 1fr) คอลัมน์จึงย่อต่ำกว่า min-content ไม่ได้
           ข้างในเป็น owl carousel ที่คิดความกว้าง .owl-stage จากคอนเทนเนอร์
           เลยกลายเป็นลูป: stage กว้างขึ้น -> คอลัมน์กว้างขึ้น -> stage กว้างขึ้น
           จนชนเพดาน layout ของเบราว์เซอร์ (33,554,432px) ทั้งหน้าพังทันทีที่จอแคบกว่า 992px */
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .ap-lead,
    .ap-heading {
        font-size: 21px;
    }
}

@media (max-width: 575.98px) {
    .ap-row {
        gap: 12px;
        padding: 12px;
    }

    .ap-row-cover {
        flex-basis: 84px;
    }

    .ap-filter {
        flex-wrap: wrap;
    }
}
