body {
    font-family: 'Sarabun', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* ส่วนของ Header และ Navigation Bar */
.main-nav {
    background-color: #006475;
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap; 
}

.logo img {
    height: 40px;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.nav-links li {
    margin-left: 20px;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #4CAF50;
}

header {
    background-color: #5788b1;
    color: white;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
}

header p {
    font-size: 1rem;
}

/* ส่วนของ Article Card */
.article-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 20px;
    justify-content: center;
}

.article-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 300px;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.article-content {
    padding: 1rem;
}

.article-content h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.article-content p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: #4CAF50;
    text-decoration: none;
    font-weight: bold;
}

/* ส่วนของ Footer */
footer {
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
    background-color: #333;
    color: white;
}

/* โค้ดที่เพิ่ม: ส่วนบทความแนะนำใน Footer */
.recommended-articles-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

.recommended-articles-section h3 {
    margin-top: 0;
    color: #fff;
    font-size: 1.8rem;
}

#recommended-articles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

footer .article-card {
    background-color: #444444; /* สีพื้นหลังการ์ดใน footer */
    color: #fff;
    width: 250px;
}

footer .article-card .article-content h2 {
    color: #fff;
    font-size: 1.2rem;
}

footer .article-card .article-content p {
    color: #bbb;
}

footer .article-card .read-more {
    color: #90EE90;
}

/* ส่วนของ Go to Top Button (ปรับปรุงใหม่) */
.go-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #75b4e7; /* เปลี่ยนสีพื้นหลังเป็นสีฟ้า */
    color: white;
    width: 48px; /* เพิ่มขนาดปุ่มสำหรับมือถือ */
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* เพิ่มเงาให้ดูเด่นขึ้น */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    text-decoration: none;
    z-index: 999; /* เพิ่ม z-index ให้สูงขึ้น */
}

.go-to-top:hover {
    background-color: #5d9dd2; /* สีเข้มขึ้นเมื่อ Hover */
}

.go-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* @media query สำหรับมือถือ */
@media (max-width: 768px) {
    .go-to-top {
        width: 44px;
        height: 44px;
        bottom: 70px; /* ปรับตำแหน่งให้สูงขึ้นเพื่อไม่ให้ทับกับเมนูด้านล่าง */
    }
}

/* ส่วนของ Nav Toggle Icon */
.nav-toggle {
    display: none;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 101;
}

.hamburger {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    position: relative;
    transition: transform 0.2s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    position: absolute;
    transition: transform 0.2s ease-in-out, top 0.2s ease-in-out;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

.nav-toggle.is-active .hamburger {
    background: transparent;
}

.nav-toggle.is-active .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.nav-toggle.is-active .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

.breadcrumb-nav {
    padding: 1rem 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
}

.breadcrumb li + li::before {
    content: '/';
    margin: 0 0.5rem;
    color: #6c757d;
}

.breadcrumb a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb li[aria-current="page"] span {
    color: #6c757d;
}

.search-and-results-container {
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-form input {
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    outline: none;
    transition: border-color 0.3s;
}

.search-form input:focus {
    border-color: #4CAF50;
}

.search-form button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.search-form button svg {
    color: #fff;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.autocomplete-results a {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
}

.autocomplete-results a:hover,
.autocomplete-results a.active {
    background-color: #f0f0f0;
}

/* Media Queries สำหรับ Responsive Design */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        position: absolute;
        right: 20px;
        top: 20px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        text-align: center;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #333;
    }

    .nav-links.is-active {
        display: flex;
    }

    .nav-links li {
        margin: 0;
        width: 100%;
        border-top: 1px solid #555;
    }

    .nav-links li:first-child {
        border-top: none;
    }

    .nav-links li a {
        display: block;
        padding: 15px;
    }

    .nav-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-and-results-container {
        width: 100%;
        margin-top: 10px;
    }
    
    .search-form {
        width: 100%;
        justify-content: center;
    }
    .search-form input {
        width: calc(100% - 40px);
    }
    
    header {
        text-align: left;
    }

    .article-container {
        margin: auto ;
        padding: 30px 30px;
         justify-content: center;
    }

    .article-card {
        width: calc(50% - 10px);
    }

    footer .article-card {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .article-card {
        width: 100%;
    }
}

/* Sticky Footer Navigation */
.mobile-bottom-nav {
    display: none; /* ซ่อนไว้บนเดสก์ท็อป */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #006475;
    color: white;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: white;
    font-size: 12px;
}

.mobile-bottom-nav .nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.mobile-bottom-nav .nav-item:hover {
    color: #0003ce;
}

/* แสดงบนหน้าจอขนาดเล็กเท่านั้น */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    .main-nav .nav-container {
        /* ปรับให้มีพื้นที่สำหรับ navigation bar ด้านล่าง */
        margin-bottom: 60px;
    }
}

/* ส่วนของรูปภาพที่ปรับขนาดอัตโนมัติ */
.responsive-image {
    max-width: 100%; /* กำหนดความกว้างสูงสุดให้ไม่เกิน container */
    height: auto; /* ให้ความสูงปรับตามสัดส่วนของรูปภาพ */
    display: block; /* ลบช่องว่างที่อาจเกิดขึ้นด้านล่างของรูปภาพ */
    border-radius: 8px; /* เพิ่มขอบมนเล็กน้อยให้ดูสวยงามขึ้น */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* เพิ่มเงาให้ดูโดดเด่น */
}

  .tags {
            margin-top: 40px;
            font-size: 0.9em;
            color: #666;
        }