Theme Name: SAMCHAIWITAEDSUKSA SCHOOL Theme URI: http: //example.com/theme-uri/
Author: Nattapon Puangnoi (IT-MKP) URI: http: //example.com/author-uri/
Description: คำอธิบายธีมของคุณ Version: 1.0.0 License: GNU General Public License v2 or later License URI: www.gnu.org Text Domain: your-theme-textdomain @import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

body {
    background-color: #f0f2f5;
    font-family: 'Sarabun', sans-serif;
    line-height: 1.8;
    color: #333;
    font-size: 16px;
    margin: 0;
    padding: 0;
}

/* =========================================
   1. ส่วนหัวเว็บและแบนเนอร์
   ========================================= */
.school-banner {
    width: 100%;
    height: auto;
    display: block;
    background-color: #f0f0f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* =========================================
   2. เมนูหลักด้านบน (Top Navigation)
   ========================================= */
.top-nav {
    background: linear-gradient(180deg, #004d00 0%, #003300 100%) !important;
    border-bottom: 4px solid #FFD700 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    padding: 0;
    position: sticky !important;
    top: 0 !important;
    z-index: 1030 !important;
    width: 100% !important;
}

.top-nav .navbar-nav {
    margin: 0 !important;
    width: 100%;
    display: flex;
}

/* ปุ่มเมนูแบบหารความกว้างเท่ากัน (Desktop) */
.top-nav .nav-item {
    flex: 1 1 0 !important;
    display: flex;
    justify-content: center;
}

.top-nav .nav-link {
    width: 100% !important;
    color: #f8f9fa !important;
    font-size: 0.95rem !important;
    /* ขนาดเท่ากับหัวข้อ Widget */
    font-weight: 600;
    padding: 15px 5px !important;
    border-bottom: 5px solid transparent !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
}

/* เอฟเฟกต์ตอนเมาส์ชี้ (Hover) */
.top-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px);
    border-bottom: 5px solid #003300 !important;
    transform: translateY(-3px);
    color: #ffffff !important;
}

.top-nav .nav-link i {
    color: #FFD700;
    margin-right: 8px;
    font-size: 1.1rem;
}

/* ปุ่ม Toggle มือถือ */
.navbar-toggler {
    background-color: #ffffff;
    border: none;
    color: #003300;
    margin: 8px;
}

/* ปรับแต่งไอคอน Font Awesome ให้สมดุล */
.widget-header i,
.nav-link i,
.icon-box i {
    font-weight: 300 !important;
    /* บังคับสไตล์ Light */
    width: 1.25em;
    text-align: center;
}

/* ถ้าใช้การซ้อนไอคอน (Layering) */
.fa-layers {
    display: inline-block;
    height: 1em;
    position: relative;
    vertical-align: -0.125em;
    width: 1em;
}

/* =========================================
   3. วิดเจ็ตและกล่องเนื้อหา (Widgets & Content Box)
   ========================================= */
.widget-header {
    background: linear-gradient(180deg, #004d00 0%, #003300 100%);
    color: #fff;
    height: 55px;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
    border-bottom: 4px solid #FFD700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.content-box {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    padding: 10px !important;
    margin-bottom: 25px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

/* =========================================
   4. เมนูโรงเรียนใน Sidebar
   ========================================= */
.school-menu a {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    color: #444 !important;
    padding: 12px 15px !important;
    display: block;
    text-decoration: none;
    border-bottom: 1px solid #f1f1f1;
    font-size: 0.9rem;
}

.school-menu a:hover {
    background: #fdfdfd;
    border-left: 3px solid #ffc107;
    color: #004d00 !important;
    padding-left: 20px !important;
}

/* 1. เตรียมสถานะเริ่มต้นของเมนูย่อย (ซ่อนแบบเตรียมทำ Transition) */
.school-menu .submenu {
    max-height: 0;
    /* บีบความสูงให้เป็น 0 */
    overflow: hidden;
    /* ซ่อนเนื้อหาที่เกินออกมา */
    opacity: 0;
    /* ทำให้โปร่งใส */
    transition: all 0.4s ease-in-out;
    /* กำหนดความเร็วและลักษณะการเคลื่อนไหว */
    background-color: #f8f9fa;
    padding-left: 15px;
}

/* 2. เมื่อเอาเมาส์มาชี้ (Hover) ให้ขยายความสูงและแสดงออกมา */
.menu-item.dropdown:hover .submenu {
    max-height: 300px;
    /* กำหนดค่าให้มากกว่าความสูงจริงของเมนูย่อย */
    opacity: 1;
    /* ทำให้กลับมามองเห็น */
    padding-top: 5px;
    padding-bottom: 5px;
}

/* 3. ตกแต่งลูกศรให้หมุนได้ (Smooth Rotate) */
.menu-item .fa-chevron-down {
    transition: transform 0.3s ease;
}

.menu-item:hover .fa-chevron-down {
    transform: rotate(180deg);
    /* หมุนลูกศรกลับหัวเมื่อชี้ */
}

/* =========================================
   5. การ์ดข่าวและกิจกรรม
   ========================================= */
.index-news-card {
    border-radius: 12px;
    border: 1px solid #f0f0f0 !important;
    border-right: 5px solid transparent !important;
    transition: all 0.3s ease;
    background: #fff;
    overflow: hidden;
    position: relative;
}

.index-news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1) !important;
    border-right: 5px solid #ffc107 !important;
}

.index-img-wrapper {
    border-right: 4px solid #ffc107;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.index-img-wrapper img {
    transition: transform 0.6s ease;
    height: 110px;
    object-fit: cover;
    width: 100%;
}

.index-news-card:hover .index-img-wrapper img {
    transform: scale(1.1);
}

.index-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #004d00;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}

/* =========================================
   6. การปรับแต่งสำหรับมือถือ (Responsive)
   ========================================= */
@media (max-width: 991.98px) {

    /* เมนูหลักในมือถือ */
    .top-nav .navbar-nav {
        flex-direction: column !important;
    }

    .top-nav .nav-item {
        flex: none !important;
        width: 100%;
    }

    .top-nav .nav-link {
        justify-content: flex-start;
        padding: 12px 20px !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 0;
    }

    .top-nav .nav-link:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.05) !important;
        border-bottom: 1px solid #FFD700 !important;
    }

    /* ปรับระยะขยับของ Sidebar ในมือถือ (ถ้ามี) */
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

/* =========================================
   7. คลาสเสริมอื่นๆ
   ========================================= */
.text-success {
    color: #004d00 !important;
}

.bg-success-subtle {
    background-color: #e6f3e6 !important;
}

/* ปุ่มเขียว โชว์เหลือง*/
.widget-header .btn-success:hover {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

/* =========================================
   8. ลูกศรเปลี่ยนหน้า
   ========================================= */
/* สไตล์วงรี Modern Pill */
.pagination {
    margin: 40px 0;
    text-align: center;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    margin: 0 5px;
    border-radius: 50px;
    /* ทำให้เป็นวงรี */
    background: #fff;
    color: #004d00;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    text-decoration: none;
    font-weight: 600;
}

/* หน้าปัจจุบัน - เน้นสีเขียวขอบทอง */
.page-numbers.current {
    background: #004d00;
    color: #FFD700;
    border-color: #FFD700;
    box-shadow: 0 4px 10px rgba(0, 77, 0, 0.2);
}

/* เมื่อเอาเมาส์ไปชี้ */
.page-numbers:hover:not(.current) {
    background: #FFD700;
    color: #004d00;
    border-color: #FFD700;
    transform: translateY(-3px);
}

/* =========================================
   page-activity
   ========================================= */
.news-paper-card {
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.news-paper-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-bottom: 5px solid #FFD700;
}

.news-img-wrapper {
    height: 220px;
    overflow: hidden;
    position: relative;
    border-radius: 8px 8px 0 0;
    border-bottom: 4px solid #FFD700;
}

.news-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.news-paper-card:hover .news-img-wrapper img {
    transform: scale(1.1);
}

.date-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    text-align: center;
    overflow: hidden;
    min-width: 50px;
    z-index: 2;
}

.date-badge .month {
    background: #004d00;
    color: #FFD700;
    font-size: 0.75rem;
    padding: 2px 0;
    font-weight: bold;
    text-transform: uppercase;
}

.date-badge .day {
    color: #333;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 2px 0;
    line-height: 1;
}

/* =========================================
   page-news
   ========================================= */
.news-horizontal-card {
    border-radius: 12px;
    border: 1px solid #eee !important;
    border-right: 5px solid transparent !important;
    transition: all 0.3s ease;
}

.news-horizontal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-right: 5px solid #ffc107 !important;
}

.horizontal-card-img {
    height: 180px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-horizontal-card:hover .horizontal-card-img {
    transform: scale(1.1);
}

/* =========================================
   page-webboard
   ========================================= */
.hover-green:hover {
    color: #004d00 !important;
    text-decoration: underline !important;
}

.acf-field {
    border: none !important;
    padding: 10px 0 !important;
}

.acf-label label {
    font-weight: bold !important;
    font-size: 0.9rem !important;
    color: #444 !important;
}

.acf-input input,
.acf-input textarea {
    border-radius: 15px !important;
    border: 1px solid #ced4da !important;
    padding: 10px 15px !important;
}

.acf-input input:focus,
.acf-input textarea:focus {
    border-color: #004d00 !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 77, 0, 0.1) !important;
}

.btn-warning {
    background-color: #FFD700;
    border: none;
    color: #000;
}

.btn-warning:hover {
    background-color: #ffc107;
    color: #000;
}

.table td {
    vertical-align: middle;
}

.badge {
    font-weight: 500;
}

/* =========================================
   page-contact
   ========================================= */
.icon-box {
    width: 40px;
    height: 40px;
    background: #e9f7ef;
    color: #004d00;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.widget-header {
    background: linear-gradient(180deg, #004d00 0%, #003300 100%);
    color: #fff;
    padding: 12px 20px;
    font-weight: bold;
    border-radius: 10px 10px 0 0;
    border-bottom: 3px solid #FFD700;
}

.form-control:focus {
    border-color: #004d00;
    box-shadow: 0 0 0 0.25rem rgba(0, 77, 0, 0.1);
}

.border-bottom {
    border-bottom: 1px dashed #dee2e6 !important;
}

/* สี icon */
.social-contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: #e9f7ef;
    border: 1px solid #000000;
    border-radius: 50%;
    color: #004d00;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

/* เมื่อ Hover: Facebook (สีน้ำเงิน) */
.social-contact-btn.fb:hover {
    background-color: #1877F2 !important;
    border-color: #1877F2 !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
}

/* เมื่อ Hover: Line (สีเขียวสว่าง) */
.social-contact-btn.ln:hover {
    background-color: #06C755 !important;
    border-color: #06C755 !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(6, 199, 85, 0.3);
}

/* เมื่อ Hover: YouTube (สีแดง) */
.social-contact-btn.yt:hover {
    background-color: #FF0000 !important;
    border-color: #FF0000 !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
}

/* เมื่อ Hover: TikTok (สีดำ) */
.social-contact-btn.tt:hover {
    background-color: #000000 !important;
    border-color: #000000 !important;
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* =========================================
   page-executives
   ========================================= */
.org-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    transition: 0.3s;
    display: flex;
    overflow: hidden;
}

.card-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.img-fixed-ratio {
    width: 100%;
    aspect-ratio: 4 / 4;
    overflow: hidden;
    background: #f8f9fa;
}

.img-fixed-ratio img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-box {
    padding: 15px 8px;
    min-height: 65px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 45px;
}

.name {
    color: #004d00;
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 3px;
    line-height: 1.2;
}

.pos {
    font-size: 0.75rem;
    line-height: 1.2;
    margin: 0;
}

.section-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #004d00;
    font-weight: bold;
    font-size: 1rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    border-bottom: 2px solid #FFD700;
}

.section-divider:not(:empty)::before {
    margin-right: 1em;
}

.section-divider:not(:empty)::after {
    margin-left: 1em;
}

.org-card {
    transition: all 0.3s ease !important;
    border-bottom: 5px solid transparent !important;
    border-radius: 8px;
    overflow: hidden;
}

.org-card:hover {
    transform: translateY(-5px) !important;
    border-bottom: 5px solid #FFD700 !important;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.img-fixed-ratio {
    overflow: hidden;
}

.img-fixed-ratio img {
    transition: transform 0.5s ease;
}

.org-card:hover .img-fixed-ratio img {
    transform: scale(1.1);
}

/* =========================================
   content-webboard
   ========================================= */
.widget-header {
    background: linear-gradient(135deg, #004d00 0%, #003300 100%);
    color: #fff;
    padding: 12px 20px;
    font-weight: bold;
    border-radius: 10px 10px 0 0;
    border-bottom: 3px solid #FFD700;
}

.question-box {
    background-color: #f8fff9 !important;
}

/* =========================================
   content-news
   ========================================= */
.hover-zoom {
    transition: all 0.3s ease;
    cursor: zoom-in;
    display: block;
}

.hover-zoom:hover {
    transform: translateY(-5px);
    border-color: #2E8B57, !important;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.object-fit-cover {
    object-fit: cover;
}

.hover-card-related {
    transition: all 0.3s ease;
}

.hover-card-related:hover {
    transform: translateY(-3px);
    border-color: #FFD700 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
    content-activity
   ========================================= */
.hover-zoom {
    transition: all 0.3s ease;
    cursor: zoom-in;
    display: block;
}

.hover-zoom:hover {
    transform: translateY(-5px);
    border-color: #2E8B57 !important;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.object-fit-cover {
    object-fit: cover;
}

.hover-card-related {
    transition: all 0.3s ease;
}

.hover-card-related:hover {
    transform: translateY(-3px);
    border-color: #FFD700 !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
    อัพเดท
   ========================================= */
    .btn-home-custom {
        display: inline-flex;
        align-items: center;
        padding: 12px 35px;
        background-color: #4d974dff; /* สีเขียวอ่อน (Light Green) */
        color: #ffffff !important;
        text-decoration: none !important;
        border-radius: 50px;
        font-weight: 600;
        font-size: 1rem;
        transition: all 0.3s ease;
    }

    /* เมื่อเอาเมาส์ไปชี้: พื้นเหลือง / ตัวอักษรดำ */
    .btn-home-custom:hover {
        background-color: #FFD700 !important; /* สีเหลืองทอง */
        color: #000000 !important;
        box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
    }

    /* ปรับแต่ง Font Awesome Layers */
    .fa-layers {
        display: inline-block;
        position: relative;
        vertical-align: middle;
    }