/*
 * -----------------------------------------------------
 * 1. Global Styles & Typography
 * -----------------------------------------------------
 */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;700&family=Prompt:wght@700&display=swap');

:root {
    --primary-color: #C79A00;
    /* สีทอง/สีเน้น */
    --text-color: #333333;
    --background-color: #F9F9F9;
    --white-color: #FFFFFF;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 15px;
    /* ใส่ padding ด้านข้างสำหรับ Mobile */
}

h1,
h2,
h3,
h4 {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #A37E00;
    /* สีเข้มขึ้นเมื่อชี้ */
}

/* ปุ่มหลัก */
.btn-read-more,
.btn-all-news {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
    font-weight: 700;
}

.btn-read-more:hover,
.btn-all-news:hover {
    background-color: #A37E00;
    transform: translateY(-2px);
}

/*
 * -----------------------------------------------------
 * 2. Header & Navigation (Responsive Menu)
 * -----------------------------------------------------
 */
.main-header {
    background-color: var(--white-color);
    padding: 15px 0;
    border-bottom: 3px solid var(--primary-color);
    /* เพิ่มเส้นขอบสีทอง */
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* ให้เมนูลงบรรทัดใหม่เมื่อหน้าจอเล็ก */
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 40px;
    /* ขนาดโลโก้ */
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-color);
}

.main-nav ul {
    list-style: none;
    display: flex;
}

.main-nav li a {
    padding: 10px 15px;
    display: block;
    color: var(--text-color);
    font-weight: 400;
}

.main-nav li a.active,
.main-nav li a:hover {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/*
 * -----------------------------------------------------
 * 3. Hero Section (Full Width)
 * -----------------------------------------------------
 */
.hero-section {
    position: relative;
    overflow: hidden;
    height: 450px;
    /* กำหนดความสูง */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
}

.slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* ครอบคลุมพื้นที่ */
    filter: brightness(0.6);
    /* ทำให้ภาพมืดลงเล็กน้อยเพื่อให้อ่านข้อความง่าย */
}

.welcome-text {
    position: relative;
    z-index: 10;
    color: var(--white-color);
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.4);
    /* เพิ่มพื้นหลังทึบเล็กน้อย */
    border-radius: 10px;
}

.welcome-text h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--white-color);
}

.welcome-text p {
    font-size: 1.2rem;
}

/*
 * -----------------------------------------------------
 * 4. Chief Monk Message
 * -----------------------------------------------------
 */
.chief-monk-message {
    display: flex;
    gap: 40px;
    align-items: center;
    padding: 3rem 0;
}

.monk-photo {
    flex-shrink: 0;
    /* ไม่ให้ภาพหด */
}

.monk-photo img {
    width: 250px;
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.message-body {
    flex-grow: 1;
}

.message-body h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
}

/*
 * -----------------------------------------------------
 * 5. News & Announcements
 * -----------------------------------------------------
 */
.news-announcements {
    padding: 3rem 0;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* 3 คอลัมน์บน Desktop, ปรับอัตโนมัติ */
    gap: 30px;
    margin-bottom: 2rem;
}

.news-item {
    background-color: var(--white-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.news-item:hover {
    transform: translateY(-5px);
}

.news-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-item h4 {
    padding: 15px 15px 0;
    font-size: 1.2rem;
}

.news-item .date {
    padding: 0 15px 15px;
    font-size: 0.9rem;
    color: #888;
}

.text-center {
    text-align: center;
}

/*
 * -----------------------------------------------------
 * 6. Quick Links (Bento Grid Style)
 * -----------------------------------------------------
 */
.quick-links {
    padding: 3rem 0;
    background-color: var(--white-color);
}

.link-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quick-btn {
    display: block;
    text-align: center;
    padding: 30px 20px;
    background-color: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.quick-btn:hover {
    background-color: var(--primary-color);
    color: var(--white-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.quick-btn:hover .icon,
.quick-btn:hover p {
    color: var(--white-color);
}

.quick-btn .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
    transition: color 0.3s;
}

.quick-btn p {
    font-family: 'Prompt', sans-serif;
    font-weight: 700;
    margin: 0;
    color: var(--text-color);
    transition: color 0.3s;
}

/*
 * -----------------------------------------------------
 * 7. Statistics
 * -----------------------------------------------------
 */
.statistics {
    padding: 3rem 0;
    text-align: center;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    gap: 30px;
}

.stat-item h3 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-item p {
    font-weight: 300;
    font-size: 1.1rem;
}

/*
 * -----------------------------------------------------
 * 8. Footer
 * -----------------------------------------------------
 */
.main-footer {
    background-color: var(--text-color);
    color: #CCCCCC;
    padding: 40px 0;
    font-size: 0.9rem;
}

.main-footer .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-info,
.footer-nav {
    flex: 1;
    min-width: 250px;
}

.footer-info h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.footer-nav a {
    color: #CCCCCC;
    margin-right: 15px;
}

.copyright {
    width: 100%;
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #555;
}

/*
 * -----------------------------------------------------
 * 9. Media Queries (Responsive Design - Mobile First)
 * -----------------------------------------------------
 */
@media (max-width: 768px) {

    /* ปรับเมนูให้เป็นแนวตั้งสำหรับมือถือ */
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav {
        margin-top: 10px;
        width: 100%;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
    }

    /* ปรับส่วน Hero */
    .hero-section {
        height: 300px;
    }

    .welcome-text h2 {
        font-size: 1.8rem;
    }

    /* ปรับสารจากเจ้าคณะอำเภอ */
    .chief-monk-message {
        flex-direction: column;
        text-align: center;
    }

    .monk-photo img {
        width: 180px;
        height: 220px;
        margin-bottom: 1rem;
    }

    /* ปรับสถิติ */
    .stats-grid {
        flex-direction: column;
        gap: 20px;
    }

    /* ปรับ Footer */
    .main-footer .container {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .news-list {
        /* บังคับให้เป็น 1 คอลัมน์เต็มบนหน้าจอเล็กมาก */
        grid-template-columns: 1fr;
    }
}