/* Container settings */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Section for each category */
.category-section {
    margin-bottom: 40px; /* เพิ่มช่องว่างระหว่างแต่ละหมวดหมู่ */
}

/* Title for each category */
.category-title {
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
    color: #333;
}

/* Grid layout for news articles */
.news-articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Auto-adjust columns */
    gap: 20px; /* Space between items */
    justify-items: center; /* Center items within the grid */
}

/* News article card */
.news-article {
    border: 1px solid #ccc;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 250px; /* Fixed max-width for consistency */
}

/* Image within each news article */
.news-article img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* Heading within each news article */
.news-article h3 {
    font-size: 1.2em;
    margin: 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Paragraph within each news article */
.news-article p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hover effect for news articles */
.news-article:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modal settings */
.modal {
    display: none;
    position: fixed;
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* Grid layout for news articles */
.news-articles {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* กำหนดให้มี 4 คอลัมน์เท่ากัน */
    gap: 20px; /* Space between items */
    justify-items: center; /* Center items within the grid */
}

/* News article card */
.news-article {
    border: 1px solid #ccc;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 250px; /* Fixed max-width for consistency */
}

/* Image within each news article */
.news-article img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 5px;
}

/* Heading within each news article */
.news-article h3 {
    font-size: 1.2em;
    margin: 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Paragraph within each news article */
.news-article p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hover effect for news articles */
.news-article:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
/* Grid layout for news articles */
.news-articles {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* กำหนดให้มี 4 คอลัมน์ */
    gap: 20px; /* ช่องว่างระหว่างคอลัมน์ */
    justify-items: center; /* จัดให้อยู่กึ่งกลาง */
}

/* News article card */
.news-article {
    border: 1px solid #ccc;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 250px; /* ขนาดสูงสุดคงที่ */
}

/* Image within each news article */
.news-article img {
    width: 100%;
    height: 200px; /* กำหนดความสูงคงที่ */
    object-fit: cover; /* ทำให้ภาพครอบคลุมพื้นที่ที่กำหนด */
    border-radius: 5px;
    margin-bottom: 10px;
}

/* Heading within each news article */
.news-article h3 {
    font-size: 1.2em;
    margin: 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Paragraph within each news article */
.news-article p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Hover effect for news articles */
.news-article:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
