/* --- General Setup --- */
body {
    padding-top: 0; 
    font-family: 'Mulish', 'Sarabun', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    color: #212529;
}

/* --- Navbar Styles --- */
.navbar {
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
#mainNavbar.top-nav {
    background-color: transparent !important;
    box-shadow: none;
}
#mainNavbar.top-nav .nav-link,
#mainNavbar.top-nav .navbar-brand,
#mainNavbar.top-nav i { 
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
#mainNavbar.scrolled-nav {
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}
#mainNavbar.scrolled-nav .nav-link,
#mainNavbar.scrolled-nav .navbar-brand, 
#mainNavbar.scrolled-nav i {
    color: #333333 !important;
    text-shadow: none;
}
#mainNavbar.scrolled-nav .nav-link:hover,
#mainNavbar.scrolled-nav .nav-link.active {
    color: #0d6efd !important;
}
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    font-family: 'Mulish', sans-serif;
}

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0)), url('../images/top-background4.jpg');
    background-size: cover;
    background-position: center;
    min-height: 400px;
	height: auto; overflow: auto;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}
.hero-stats {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(25,25,25,0.6);
    padding: 15px 0;
    backdrop-filter: blur(2px);
}

/* --- Unified Image Zoom Wrapper --- */
.img-zoom-wrapper {
    overflow: hidden;
    display: block;
    position: relative;
    width: 100%;
}
.img-zoom-wrapper img {
     transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* --- Feature Cards --- */
.feature-card {
    border: none;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
    background-color: #fff;
    height: 100%;
}
.feature-card .img-zoom-wrapper {
    height: 140px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.feature-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}
.feature-card:hover .img-zoom-wrapper img {
    transform: scale(1.1);
}
.feature-card-body { padding: 1.25rem; text-align: left; }
.feature-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; color: #222; }
.feature-desc { font-size: 0.85rem; color: #666; line-height: 1.5; margin-bottom: 0; }

/* --- Notification Bar --- */
.notification-bar-container {
    background-color: #fff5f5;
    border-left: 6px solid #dc3545;
    padding: 20px 25px;
    border-radius: 4px;
    color: #333;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.notification-title { font-weight: 800; color: #212529; margin-bottom: 5px; text-transform: uppercase; }
.notification-text { font-size: 0.95rem; color: #495057; line-height: 1.5; margin-bottom: 0; }

/* --- News Vertical Card --- */
.news-vertical-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 100%;
    transition: box-shadow 0.3s ease;
}
.news-vertical-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.news-vertical-card .img-zoom-wrapper {
    height: 220px;
}
.news-vertical-card:hover .img-zoom-wrapper img {
    transform: scale(1.1);
}
.news-vertical-body {
    padding: 1.5rem;
}
.news-vertical-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #2c3e50;
}
.news-vertical-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0;
}
.btn-see-more {
    border: 1px solid #ced4da;
    color: #6c757d;
    padding: 8px 30px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s;
    background: transparent;
}
.btn-see-more:hover {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

/* --- Special Collection Styles --- */
.collection-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 100%;
    transition: box-shadow 0.3s ease;
}
.collection-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.collection-card .img-zoom-wrapper {
    height: 400px;
}
.collection-card:hover .img-zoom-wrapper img {
    transform: scale(1.1);
}
.collection-body {
    padding: 1.25rem;
}
.collection-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}
.collection-desc {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* --- Tabs --- */
.nav-tabs .nav-link { color: #555; border: none; border-bottom: 3px solid transparent; font-weight: 700; padding: 12px 25px; }
.nav-tabs .nav-link:hover { border-color: transparent; color: #0d6efd; }
.nav-tabs .nav-link.active { color: #0d6efd; border-bottom: 3px solid #0d6efd; background-color: transparent; }

/* --- Sidebar Styles --- */
.sidebar-container {
   /* background-color: white;*/
    height: 100%; 
    padding: 2rem;
    /*border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);*/
}

.sidebar-boxs {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}
.sidebar-badge { width: 100%; margin-bottom: 15px; border-radius: 5px; }

/* --- FOOTER STYLES --- */
.footer-login-bar {
    background-color: #e9ecef;
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.95rem;
}
.footer-login-text {
    border-left: 4px solid #4a69bd; 
    padding-left: 12px;
    color: #333;
    font-weight: 500;
}
.footer-login-text a { color: #4a69bd; font-style: italic; text-decoration: none; }
.footer-login-text a:hover { text-decoration: underline; }

.main-footer {
    background-color: #ffffff;
    padding: 60px 0 40px 0;
    position: relative;
    font-size: 0.9rem;
    color: #212529;
    overflow: hidden; 
}
.footer-map-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: url('https://upload.wikimedia.org/wikipedia/commons/8/80/World_map_-_low_resolution_gray.svg') no-repeat center right;
    background-size: 60%; 
    opacity: 0.05; 
    pointer-events: none; 
    z-index: 0;
}
.footer-content { position: relative; z-index: 1; }
.footer-logo-text { font-family: 'Playfair Display', serif; font-size: 2rem; color: #003366; line-height: 1; margin-bottom: 10px; }
.footer-logo-sub { font-family: 'Mulish', sans-serif; font-size: 0.8rem; color: #e67e22; letter-spacing: 1px; font-weight: 700; margin-bottom: 20px; }

.footer-links-list { list-style: none; padding: 0; margin: 0; }
.footer-links-list li { margin-bottom: 10px; display: flex; align-items: flex-start; }
.footer-links-list li i { font-size: 0.7rem; margin-top: 5px; margin-right: 8px; color: #b0b0b0; }
.footer-links-list li a { color: #003366; text-decoration: none; font-weight: 600; font-size: 0.85rem;  transition: color 0.2s; } /*text-transform: uppercase;*/
.footer-links-list li a:hover { color: #4a69bd; }

.footer-contact-title { color: #003366; font-weight: 800; text-transform: uppercase; margin-bottom: 15px; }
.footer-contact-text { line-height: 1.6; margin-bottom: 15px; }

.footer-bottom { background-color: #002d62; color: white; padding: 20px 0; text-align: center; font-size: 0.85rem; }

/* ... (โค้ดเดิมทั้งหมด) ... */

/* --- [NEW] Article/Content Page Styles --- */

/* ปรับ Hero Section สำหรับหน้าเนื้อหา */
.hero-section.article-header {
    height: 350px; /* ลดความสูงลงนิดหน่อยสำหรับหน้าอ่าน */
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0)), url('../images/top-background4.jpg');
    background-size: cover;
    background-position: center;
}

.article-meta-tag {
    display: inline-block;
    background-color: #e67e22;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.article-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
}

.article-authors {
    font-size: 1.1rem;
    font-weight: 300;
    color: #ddd;
}

/* Sidebar Navigation (Sticky) */
.article-sidebar {
    position: sticky;
    top: 100px; /* ให้ติดอยู่ด้านบนเมื่อเลื่อนลงมา (เว้นที่ให้ Navbar) */
}

.btn-action {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    text-align: left;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
}
.btn-download { background-color: #003366; color: white; border: none; }
.btn-download:hover { background-color: #002244; color: white; }
.btn-cite { background-color: white; color: #333; border: 1px solid #ddd; }
.btn-cite:hover { background-color: #f8f9fa; }

.toc-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    border-left: 2px solid #eee;
}
.toc-list li { margin-bottom: 0; }
.toc-list a {
    display: block;
    padding: 8px 15px;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    margin-left: -2px;
    transition: all 0.2s;
}
.toc-list a:hover, .toc-list a.active {
    color: #003366;
    border-left-color: #003366;
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Main Content Area */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2c3e50;
}
.article-content h2 {
    color: #003366;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.article-content p { margin-bottom: 20px; }

.abstract-box {
    background-color: #f1f8ff;
    border-left: 5px solid #0d6efd;
    padding: 25px;
	padding-top: 5px;
    margin-bottom: 30px;
    border-radius: 4px;
}
.abstract-title {
    font-weight: 800;
    color: #003366;
    margin-bottom: 10px;
    /*text-transform: uppercase;*/
    font-size: 0.9rem;
}

.references-list li {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #555;
}

/* ... (โค้ดเดิม) ... */

/* --- [NEW] Image Zoom & Figures Styles --- */

/* ปรับแต่งรูปภาพในเนื้อหา */
figure {
    margin: 30px 0;
    text-align: center;
    scroll-margin-top: 100px; /* แก้ปัญหารูปถูก Navbar บังเมื่อ Scroll มา */
}

.figure-img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

/* Class สำหรับรูปที่คลิกขยายได้ */
.img-zoomable {
    cursor: zoom-in; /* เปลี่ยนเมาส์เป็นรูปแว่นขยาย */
}
.img-zoomable:hover {
    transform: scale(1.02); /* ขยายเล็กน้อยเมื่อชี้ */
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.figure-caption {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 10px;
    font-style: italic;
}

/* --- [NEW] Table of Figures (Sidebar) --- */
.tof-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}
.tof-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #333;
    border: 1px solid transparent;
}
.tof-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #003366;
}
.tof-thumb {
    width: 50px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
    background-color: #eee;
}
.tof-text {
    font-size: 0.85rem;
    line-height: 1.3;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Modal Image Styling */
/*#imageModal .modal-body {
    padding: 0;
    background-color: black;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}*/
#imageModal .modal-img-full {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}
/*#imageModal .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1056;
    background-color: white;
    border-radius: 50%;
    opacity: 0.8;
}*/

/* ... (โค้ดเดิม) ... */

/* --- [NEW] Gallery Navigation Styles --- */
#imageModal .modal-body {
    /* ปรับให้รองรับการวางปุ่มแบบ Absolute */
    position: relative; 
    text-align: center;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    
    /* --- ปรับสีและขนาดให้ชัดเจน --- */
    background-color: #0d6efd; /* สีน้ำเงิน (Bootstrap Primary Color) */
    color: white; /* สีไอคอน */
    border: 2px solid white; /* เพิ่มขอบขาวตัดให้เด่น */
    
    width: 60px; /* เพิ่มขนาดปุ่มให้ใหญ่ขึ้น (เดิม 50px) */
    height: 60px;
    border-radius: 50%; /* ทรงกลม */
    font-size: 1.5rem; /* ขนาดลูกศร */
    
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1060; /* ให้ลอยอยู่เหนือรูปแน่นอน */
    
    /* จัดไอคอนให้อยู่ตรงกลาง */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* เพิ่มเงาให้ปุ่มลอยออกมา */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    opacity: 0.8; /* โปร่งแสงนิดๆ เพื่อความสวยงาม */
}

/* Effect ตอนเอาเมาส์ไปชี้ */
.gallery-nav:hover {
    background-color: #0b5ed7; /* สีเข้มขึ้นเมื่อชี้ */
    transform: translateY(-50%) scale(1.1); /* ขยายใหญ่ขึ้นนิดหน่อย */
    opacity: 1; /* ทึบแสง 100% */
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* ตำแหน่งปุ่มซ้าย-ขวา */
.prev-btn {
    left: 20px; /* ขยับออกมาจากขอบซ้ายอีกนิด */
}

.next-btn {
    right: 20px; /* ขยับออกมาจากขอบขวาอีกนิด */
}

/* ปรับปุ่ม Close (กากบาท) ให้ชัดขึ้นด้วย */
#imageModal .btn-close {
    background-color: white; /* พื้นหลังขาว */
    opacity: 1;
    top: 20px;
    right: 20px;
    position: fixed;
    border-radius: 50%; /* กลม */
    padding: 10px; /* เพิ่มพื้นที่กด */
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1070;
}
/* --- [NEW] Mobile Bottom Navigation & Responsive Adjustments --- */

/* 1. ซ่อน Sidebar บนมือถือ (จะถูก override ด้วย d-none d-lg-block ใน HTML) */
/* เราจะใช้ class ของ Bootstrap ใน HTML แทนการเขียน CSS ตรงนี้ */

/* 2. Mobile Bottom Bar Styling */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1040; /* อยู่เหนือ Content แต่อยู่ใต้ Modal */
    padding: 10px 0;
    display: none; /* ซ่อนบนจอใหญ่ */
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid #eee;
}

/* แสดงเฉพาะบนจอเล็ก (ต่ำกว่า 992px) */
@media (max-width: 991.98px) {
    .mobile-bottom-nav {
        display: flex;
    }
    /* เพิ่มพื้นที่ด้านล่าง body ไม่ให้เนื้อหาถูกบาร์บัง */
    body {
        padding-bottom: 80px; 
    }
    /* ปรับ Hero Section บนมือถือให้เล็กลงหน่อย */
    .hero-section.article-header {
        height: 350px;
    }
    .article-title {
        font-size: 1.8rem;
    }
}

.mobile-nav-item {
    text-align: center;
    color: #666;
    text-decoration: none;
    background: none;
    border: none;
    padding: 5px;
    flex-grow: 1;
    transition: color 0.2s;
}

.mobile-nav-item:hover, .mobile-nav-item:active {
    color: #003366; /* สีหลัก */
}

.mobile-nav-item i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.mobile-nav-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ปรับแต่ง Offcanvas (แผ่นที่เลื่อนขึ้นมา) */
.offcanvas-bottom {
    height: auto !important;
    max-height: 80vh; /* ไม่ให้สูงเกิน 80% ของจอ */
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}
.offcanvas-header {
    border-bottom: 1px solid #eee;
}
.offcanvas-title {
    font-weight: 800;
    color: #003366;
    font-size: 1rem;
}

/* ปรับ Link ใน Offcanvas ให้กดง่ายขึ้น */
.offcanvas-body .toc-list a,
.offcanvas-body .tof-item {
    padding: 12px 10px; /* เพิ่มพื้นที่กด */
    border-bottom: 1px solid #f8f9fa;
}


.txt-link{
	text-decoration: none;
}

/* ... (โค้ดเดิม) ... */


/* --- [NEW] Scrollable List of Figures --- */
.scrollable-list {
    /* คำนวณความสูงคร่าวๆ: 
       1 item สูงประมาณ 60px (รวม padding/margin) 
       3 items = 180px - 200px 
    */
    max-height: 200px; 
    overflow-y: auto; /* แสดง Scrollbar แนวตั้งเมื่อเนื้อหาเกิน */
    
    /* ปรับแต่ง Scrollbar ให้สวยงาม (Webkit browsers: Chrome, Safari) */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ced4da #f8f9fa; /* Firefox */
}

/* Scrollbar styling for Chrome/Safari/Edge */
.scrollable-list::-webkit-scrollbar {
    width: 6px;
}
.scrollable-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}
.scrollable-list::-webkit-scrollbar-thumb {
    background-color: #ced4da;
    border-radius: 4px;
}
.scrollable-list::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd;
}

/* ... (โค้ดเดิม) ... */

/* --- [NEW] Scrollable Table of Contents --- */
.scrollable-toc {
    /* คำนวณความสูง: 
       แต่ละ Link สูงประมาณ 40px 
       8 รายการ x 40px = 320px 
    */
    max-height: 320px; 
    overflow-y: auto; /* แสดง Scrollbar แนวตั้ง */
    padding-right: 5px; /* เว้นระยะขวาไม่ให้ Scrollbar ทับตัวหนังสือ */
    
    /* สไตล์ Scrollbar (เหมือน scrollable-list) */
    scrollbar-width: thin;
    scrollbar-color: #ced4da #f8f9fa;
}

.scrollable-toc::-webkit-scrollbar { width: 6px; }
.scrollable-toc::-webkit-scrollbar-track { background: #f8f9fa; border-radius: 4px; }
.scrollable-toc::-webkit-scrollbar-thumb { background-color: #ced4da; border-radius: 4px; }
.scrollable-toc::-webkit-scrollbar-thumb:hover { background-color: #adb5bd; }


/* --- Editorial Board Styles --- */
.editorial-title {
    color: #4a90e2; /* สีฟ้าตามรูป */
    text-align: center;
    font-weight: 800;
    margin-bottom: 40px;
    font-family: 'Mulish', sans-serif;
}

.editorial-section-header {
    font-weight: 800;
    color: #333;
    margin-bottom: 15px;
    border-left: 5px solid #333; /* ลูกเล่นเพิ่มแถบข้างหน้า */
    padding-left: 15px;
}

.editorial-card {
    /*border-bottom: 1px solid #ddd;*/
    background: #fff;
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); /* เงาจางๆ */
    border-radius: 4px;
}

.editorial-img-wrapper {
    /*background-color: #f8f9fa;*/
    padding: 10px;
    text-align: center;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editorial-img {
    width: 100%;
    max-width: 250px; /* จำกัดขนาดไม่ให้ใหญ่เกิน */
    height: auto;
    object-fit: cover;
    border: 1px solid #eee;
}

.info-label {
    font-weight: 800;
    color: #2c3e50;
    font-size: 0.95rem;
}

.info-value {
    color: #555;
    font-size: 0.95rem;
}

.info-row {
    margin-bottom: 8px; /* ระยะห่างระหว่างบรรทัด */
}

.orcid-link {
    color: #4a90e2;
    text-decoration: none;
}
.orcid-link:hover {
    text-decoration: underline;
}

ol {
    list-style: none;
    counter-reset: item;
}

ol li {
    counter-increment: item;
}

ol li::before {
    content: "[" counter(item) "] ";
    font-weight: bold;
}