body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
}

header {
    background-color: #003366;
    color: white;
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo h1 {
    margin-left: 20px;
}

header nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-right: 20px;
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

main {
    padding: 20px;
}

.featured {
    margin-top: 20px;
}

.featured h2 {
    font-size: 24px;
    color: #003366;
}

/* แถวแรก (3 คอลัมน์) */
.cards-row1 {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap; /* ให้การ์ดสามารถไหลลงได้เมื่อหน้าจอเล็ก */
}

.cards-row2plus {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap; /* ให้การ์ดสามารถไหลลงได้เมื่อหน้าจอเล็ก */
}

/* การ์ด */
.card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

}

.card a {
    text-decoration: none; /* ยกเลิกเส้นใต้เฉพาะในลิงก์ของการ์ด */
    color: #03cef1; /* ตั้งสีให้เหมาะสม */
}

.card a:hover {
    text-decoration: none; /* ไม่มีเส้นใต้เมื่อชี้เมาส์ */
    color: #007bff; /* เปลี่ยนสีลิงก์เมื่อชี้เมาส์ */
}


/* แถวแรก: 3 คอลัมน์ (คงที่แต่ย่อขนาดได้) */
.cards-row1 .card {
    flex: 1 1 calc(33.33% - 10px); /* 3 กล่องในแถว, คำนวณขนาดให้เหมาะสม */
}

/* แถวที่สองและถัดๆไป: 6 คอลัมน์ (คงที่แต่ย่อขนาดได้) */
.cards-row2plus .card {
    flex: 1 1 calc(16.66% - 10px); /* 6 กล่องในแถว, คำนวณขนาดให้เหมาะสม */
}

/* สำหรับหน้าจอที่มีขนาดกว้างกว่า 768px */
@media (max-width: 768px) {
    .cards-row1 .card {
        flex: 1 1 calc(50% - 20px); /* 2 กล่องในแถว */
    }

    .cards-row2plus .card {
        flex: 1 1 calc(50% - 20px); /* 2 กล่องในแถว */
    }
}

/* สำหรับหน้าจอที่มีขนาดกว้างกว่า 480px */
@media (max-width: 480px) {
    .cards-row1 .card {
        flex: 1 1 calc(100% - 20px); /* 1 กล่องเต็มแถว */
    }

    .cards-row2plus .card {
        flex: 1 1 calc(100% - 20px); /* 1 กล่องเต็มแถว */
    }
}



footer {
    background-color: #003366;
    color: white;
    display: flex;
    text-align: center;
    padding: 10px 0;
}
.ad-banner img {
    width: 100%; /* Ensures the ad image stretches across the full width */
    height: auto; /* Maintains the aspect ratio of the image */
}
@media screen and (max-width: 480px) {
    header nav ul {
        flex-direction: column;
        align-items: center;
    }

    header nav ul li {
        margin: 10px 0;
    }

    .ad-banner {
        padding: 10px;
    }

    .card {
        width: 90%;
    }

    .footer {
        font-size: 14px;
    }
}

