/* --- สไตล์สำหรับปุ่มดูเพิ่มเติม (หน้า index) --- */
.btn-view-all {
    /* display: inline-block;
    padding: 12px 30px; */
    /* border: 2px solid #1a4d2e; */
    color: #000000;
    font-weight: bold;
    /* border-radius: 5px; */
    transition: 0.3s;
}
.btn-view-all:hover {
    /* background-color: #e6c106; */
    color: #e6c106;
}

/* --- สไตล์หน้า all_news.php (ตามรูปตัวอย่าง) --- */

/* 1. Hero ใหญ่ */
.page-hero {
    /* เปลี่ยน URL เป็นรูปแบนเนอร์ใหญ่ๆ */
    background: url('../image/banner/sea4K.png') no-repeat center center/cover;
    background-size: cover;
    background-position: center 100%;
    height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
.hero-overlay {
    background: rgba(0, 0, 0, 0.5); /* พื้นหลังดำจางๆ */
    padding: 40px;
    width: 100%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.page-hero h1 {
    font-size: 3.5rem;
    color: white;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.page-hero p {
    color: #ddd;
    letter-spacing: 2px;
    font-size: 1.2rem;
}

/* 2. Intro Section */
.intro-section {
    padding: 60px 20px;
    text-align: center;
}
.intro-section h2 {
    font-size: 2.2rem;
    color: #333;
    text-transform: uppercase;
    font-weight: 800;
}
.separator-line {
    width: 50px;
    height: 4px;
    background-color: #2abad4; /* เส้นสีแดงตามตัวอย่าง */
    margin: 20px auto;
}
.intro-text {
    max-width: 700px;
    margin: 0 auto;
    color: #666;
    font-size: 0.95rem;
}

/* 3. Grid Layout */
.all-news-container {
    padding-bottom: 80px;
    background-color: #f4f6f9; /* พื้นหลังเทาอ่อนๆ */
    padding-top: 50px;
}
.grid-news-all {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* 4. News Card Pro (สไตล์แบบ Legal Services) */
.news-card-pro {
    background: white;
    padding: 40px 30px;
    text-align: left; /* จัดชิดซ้าย */
    transition: 0.3s;
    border-bottom: 3px solid transparent;
}
.news-card-pro:hover {
    transform: translateY(-5px);
    border-bottom: 3px solid #2abad4; /* เส้นสีแดงขึ้นตอนชี้ */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.card-img {
    width: 60px;
    height: 60px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white; /* ไอคอนสีขาว */
    /* background-color จะถูกใส่จาก JS */
}

.news-card-pro h3 {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #222;
    min-height: 50px; /* กันความสูงไม่เท่ากัน */
}

.news-date {
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-bottom: 15px;
}

.news-card-pro p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-read-more {
    font-size: 0.8rem;
    font-weight: bold;
    color: #555;
    text-transform: uppercase;
    border: 1px solid #ccc;
    padding: 8px 20px;
    transition: 0.3s;
}
.btn-read-more:hover {
    background: #333;
    color: white;
    border-color: #333;
}


/* แบบเต็มพื้นหลัง */
/* --- สไตล์ใหม่: News Overlay Card (เหมือนรูปเรือ) --- */

.news-overlay-card {
    position: relative;
    height: 450px; /* กำหนดความสูงให้ยาวเป็นแนวตั้ง */
    background-size: cover;
    background-position: center;
    overflow: hidden; /* ไม่ให้เนื้อหาล้นออกมา */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    /* ถ้าไม่มีรูป ให้ใช้สีพื้นหลัง */
    background-repeat: no-repeat;
}

.news-overlay-card:hover {
    transform: translateY(-5px); /* ลอยขึ้นนิดหน่อยเมื่อเอาเมาส์ชี้ */
}

/* เงาสีดำไล่ระดับ (Gradient) จากล่างขึ้นบน */
.card-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
}

/* ปุ่มลูกศรวงกลม มุมขวาบน */
.card-arrow-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    color: #333;
    font-size: 14px;
    transition: 0.3s;
}

.news-overlay-card:hover .card-arrow-icon {
    background-color: #d4a017; /* เปลี่ยนสีเมื่อ Hover การ์ด */
    color: white;
}

/* ส่วนเนื้อหาด้านล่าง */
.card-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 30px;
    z-index: 2;
    color: white;
    width: 100%;
}

.overlay-date {
    font-size: 0.8rem;
    opacity: 0.8;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

.card-content-overlay h3 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);

    overflow-wrap: break-word;
    word-break: break-word;
}

.card-content-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* โชว์แค่ 2 บรรทัด */
    -webkit-box-orient: vertical;
    overflow: hidden;

    overflow-wrap: break-word;
    word-break: break-word;
}

/* ลิงก์เปล่าๆ คลุมทั้งการ์ดเพื่อให้คลิกได้ทุกจุด */
.card-link-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* --- ส่วนตัวกรองจำนวนข่าว (Filter Bar) --- */
.news-filter-bar {
    display: flex;
    justify-content: flex-end; /* ชิดขวา */
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    color: #555;
    font-weight: bold;
}

.news-filter-bar select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
    font-family: 'Sarabun', sans-serif;
    cursor: pointer;
    background-color: white;
}

/* --- ส่วนปุ่มโหลดเพิ่ม (Load More) --- */
.load-more-container {
    text-align: center;
    margin-top: 50px;
}

.btn-load-more {
    background-color: transparent;
    border: 2px solid #aaa;
    color: #666;
    padding: 10px 40px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 30px;
    transition: 0.3s;
    font-weight: bold;
}

.btn-load-more:hover {
    border-color: #e6c106;
    color: #e6c106;
    transform: translateY(-2px);
}

/* ==================================================
   RESPONSIVE: หน้ารวมข่าว
   ================================================== */

/* Mobile (< 576px) - จอเล็กสุด */
@media screen and (max-width: 575px) {
    .page-hero h1 { font-size: 2rem; } /* ลดขนาดหัวข้อ */
    .intro-section { padding: 40px 15px; }
    
    /* ตัวกรอง (Filter) */
    .news-filter-bar {
        justify-content: center;
        flex-direction: column;
    }
    .news-filter-bar select { width: 100%; }
}

/* Small & Medium (576px - 991px) - มือถือจอใหญ่และ Tablet */
@media screen and (max-width: 991px) {
    .grid-news-all {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* บีบการ์ดให้เล็กลง */
        gap: 20px;
    }
}