/* ===== FONT DECLARATIONS ===== */
@font-face {
    font-family: 'AIA';
    src: url('/fonts/AIA-Body.woff2') format('woff2'),
         url('/fonts/AIA-Body.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Kanit';
    src: url('/fonts/Kanit-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* ===== GLOBAL STYLES ===== */
body {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    background-color: #0d2723;
    color: #e0f2f7;
    overflow-x: hidden;
    background-image: url('/bg_content.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.main-wrapper {
    min-height: 100vh;
}

/* ===== SIDEBAR STYLES ===== */
.sidebar {
    background-image: url('/img/bg_sidebar.jpg');
    background-color: transparent;
    width: 280px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 0 20px;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #ffb300;
    border-radius: 10px;
}

/* Logo Area */
.logo-area {
    padding-left: 30px;
}

.logo-area .logo-img {
    max-width: 240px;
    height: auto;
}

.logo-area .school-name {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    font-size: 1.5em;
    color: #a7d3e4;
    font-weight: 300;
}

.logo-area .school-slogan {
    font-family: 'Kanit', 'Sarabun', sans-serif;
    font-size: 0.9em;
    color: #88a8b1;
    margin-top: 5px;
    font-weight: 300;
}

/* Navigation Menu */
.sidebar nav ul {
    padding-left: 0;
}

.sidebar nav ul li {
    margin-bottom: 5px;
}

.sidebar nav ul li a.menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    text-decoration: none;
    color: #ffb300;
    font-size: 1.1em;
    font-weight: 400;
    border-radius: 0 25px 25px 0;
    transition: background-image 0.3s ease, color 0.3s ease, padding-left 0.3s ease;
    background-image: url('Asset 4.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar nav ul li a.menu-item:hover,
.sidebar nav ul li a.menu-item.active {
    background-image: url('Asset 4.png');
    color: #ffffff;
    padding-left: 45px;
}

/* Social Icons */
.social-icons a {
    color: #b2d7e4;
    font-size: 1.8em;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: #ffb300;
}

/* ===== MAIN CONTENT AREA ===== */
.content {
    margin-left: 280px;
    padding: 10px;
    background-color: transparent;
    position: relative;
}

/* ===== MOBILE NAVIGATION ===== */
.hamburger-menu-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1050;
    background-color: #ffb300;
    border-color: #e09d00;
    color: #0c2020;
    font-size: 1.5em;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

.hamburger-menu-btn:hover {
    background-color: #e09d00;
    border-color: #cc8a00;
}

/* Offcanvas Styles */
.offcanvas {
    background-image: none;
    background-color: rgba(13, 39, 35, 0.9);
    color: #e0f2f7;
    width: 280px;
}

.offcanvas-header {
    border-bottom: 1px solid #1a4242;
}

.offcanvas-title {
    color: #ffb300;
    font-weight: 600;
}

.offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.offcanvas .logo-area {
    padding-left: 0;
    margin-top: 20px;
}

.offcanvas .logo-area .logo-img {
    max-width: 80px;
}

.offcanvas nav ul {
    padding-left: 0;
    text-align: center;
}

.offcanvas nav ul li {
    margin-bottom: 10px;
}

.offcanvas nav ul li a.menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    border-right: none;
    background-image: url('Asset 4.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #ffb300;
}

.offcanvas nav ul li a.menu-item:hover,
.offcanvas nav ul li a.menu-item.active {
    background-image: url('Asset 4.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.offcanvas nav ul li a.menu-item:hover {
    padding-left: 20px;
}

.offcanvas .social-icons {
    margin-top: auto;
    justify-content: center !important;
}

/* ===== SECTION STYLES ===== */
.section-content {
    padding: 40px 0;
    position: relative;
    min-height: calc(80vh - 50px);
    background-image: none;
    background-color: transparent;
    background-attachment: scroll;
}

.section-content:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background-color: transparent;
    z-index: 5;
    box-shadow: 0 10px 10px -10px rgba(0, 0, 0, 0.5) inset;
}

.section-title {
    color: #ffb300;
    font-size: 3.2em;
    margin-bottom: 5px;
    font-weight: 700;
    position: relative;
    padding-bottom: 5px;
}

.title-slide {
    color: #ffb300;
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    display: block;
    height: 4px;
    background-color: #ffb300;
    margin: 10px auto 0;
}


.news-section .section-title::after {
    width: 300px;
}

.calendar-section .section-title::after {
    width: 400px;
}

.articles-section .section-title::after {
    width: 400px;
}

.sub-title {
    font-size: 1.2em;
    color: #a7d3e4;
    margin-bottom: 40px;
    font-weight: 300;
}

/* ===== HOME SECTION & CAROUSEL ===== */
.home-section {
    min-height: 100vh;
    padding: 0px 0px 0px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
#homeNewsCarousel {
    height: 100vh; /* ให้ carousel สูงเต็มหน้าจอ */
    width: 100%; /* ให้ carousel กว้างเต็มพื้นที่ */
    position: relative; /* สำหรับ absolute positioning ภายใน */
}
.home-news-slide {
  /*  background-image: url('bg_news.jpg');*/
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* ให้พื้นหลังสไลด์คงที่เมื่อเลื่อน */
    position: relative; /* สำหรับ absolute positioning ของ carousel-controls */
}
/* เพิ่มคลาสใหม่สำหรับห่อหุ้มเนื้อหาภายในสไลด์ */
.slide-content-wrapper {
    height: 100%; /* ให้เต็มความสูงของ .home-news-slide */
    width: 100%; /* ให้เต็มความกว้างของ .home-news-slide */
    display: flex; /* ใช้ flexbox สำหรับการจัดวางเนื้อหาภายใน */
    flex-direction: column;
    align-items: center; /* จัดกึ่งกลางแนวนอน */
    justify-content: space-between; /* จัดเนื้อหาให้กระจายตัว (title บน, image กลาง, detail ล่าง) */
    padding-top: 10px; /* เว้นระยะจากขอบบนสำหรับ title */
    padding-bottom: 50px; /* เว้นระยะจากขอบล่างสำหรับ detail */
}
.news-overlay-top {
    position: relative; /* เป็นส่วนหนึ่งของ flex flow */
    width: 100%;
    text-align: center;
    z-index: 2; /* ให้ชื่อเรื่องอยู่ด้านหน้า */
    color: #e0f2f7; /* สีตัวอักษรสำหรับ overlay */
    padding: 0 20px; /* เพิ่ม padding ด้านข้าง */
}
.home-news-slide .section-title {
    margin-bottom: 5px; /* ลดระยะห่าง */
    font-size: 3.2em; /* ปรับขนาดตัวอักษรให้เท่ากับหัวข้อหลัก */
    line-height: 1.2;
    padding-bottom: 10px; /* ลด padding เส้นใต้ */
    color: #ffb300; /* สีทองสำหรับหัวข้อใหญ่ */
    padding: 10px 20px;
}
.home-news-slide .section-title::after {
    width: 80%; /* ปรับความกว้างเส้นใต้ให้เหมาะสม */
    margin: 10px auto 0; /* จัดกลางเส้นใต้ */
}
.home-news-slide .sub-title {
    margin-bottom: 10px; /* ลดระยะห่าง */
    font-size: 1.1em; /* ปรับขนาดตัวอักษรให้เหมาะสม */
    color: #a7d3e4; /* สีตัวอักษรสำหรับหัวข้อเล็ก */
    padding: 5px 15px;
}
/* สไตล์สำหรับรูปภาพที่แสดงผลโดยตรง */
.news-slide-image {
    max-width: 95%; /* กำหนดความกว้างสูงสุด */
    max-height: 50vh; /* กำหนดความสูงสูงสุดเพื่อไม่ให้รูปใหญ่เกินไป */
    object-fit: contain; /* ปรับขนาดรูปภาพให้พอดีกับกรอบโดยรักษาสัดส่วน */
    margin: 5px auto; /* จัดกึ่งกลางและเพิ่มระยะห่างแนวตั้ง */
    border-radius: 10px; /* ขอบมน */
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); /* เงา */
    z-index: 1; /* อยู่ด้านหน้าพื้นหลัง body */
}
/* เปลี่ยนชื่อคลาสจาก .news-content-wrapper เป็น .news-detail-container */
.news-detail-container {
    max-width: 80%; /* จำกัดความกว้างของเนื้อหา */
    margin: 0 auto; /* จัดกึ่งกลาง */
    padding: 10px;
    text-align: center;
    color: #e0f2f7;
    box-shadow: none; /* ลบ box-shadow ออกตามที่คุณต้องการ */
    z-index: 2; /* ให้เนื้อหารายละเอียดอยู่ด้านหน้า */
    margin-top: 5px; /* เพิ่มระยะห่างจากรูปภาพ */
}
.news-detail-box {
    padding: 15px;
   
    border-radius: 8px;
    margin-top: 5px; /* อาจจะไม่จำเป็นถ้า .news-detail-container มี margin-top แล้ว */
    width: 100%;
    max-width: 800px; /* จำกัดความกว้างของกล่องข้อความ */
}
.news-detail-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 0;
}
/* Custom styles for carousel controls */
.carousel-controls {
    position: absolute; /* จัดตำแหน่งแบบ absolute */
    bottom: 50px; /* ระยะห่างจากขอบล่าง */
    right: 10px; /* ระยะห่างจากขอบขวา */
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 3; /* ให้อยู่ด้านหน้าสุด */
}
.carousel-control-prev,
.carousel-control-next {
    position: static; /* เปลี่ยนจาก absolute เป็น static เพื่อให้อยู่ใน flow */
    transform: none; /* ลบ transform เดิมออก */
    width: auto;
    opacity: 1; /* ทำให้มองเห็นชัดเจนเสมอ */
    background-color: transparent; /* ลบพื้นหลังปุ่ม Bootstrap */
    border: none; /* ลบขอบปุ่ม Bootstrap */
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 40px; /* ขนาดไอคอน */
    height: 40px;
    background-color: rgba(255, 179, 0, 0.8); /* สีทองโปร่งแสง */
    border-radius: 50%; /* ทำให้กลม */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0c2020; /* สีไอคอนเข้ม */
    font-size: 1.5em; /* ขนาดไอคอนใหญ่ขึ้น */
    transition: background-color 0.3s ease;
}
.carousel-control-prev-icon:hover,
.carousel-control-next-icon:hover {
    background-color: #ffb300; /* สีทองเข้มขึ้นเมื่อ hover */
}
.carousel-control-prev-icon::before {
    content: '\f053'; /* Font Awesome chevron-left */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}
.carousel-control-next-icon::before {
    content: '\f054'; /* Font Awesome chevron-right */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
}
.carousel-label {
    color: #ffb300; /* สีทอง */
    font-size: 1.3em; /* ขนาดตัวอักษรใหญ่ขึ้น */
    font-weight: 500;
}

/* ===== PRAYER TIMES SECTION ===== */
.prayer-times-wrapper {
    background-color: rgba(26, 66, 66, 0.8);
    border: 2px solid #285454;
    border-radius: 15px;
}

.prayer-time-column .date-label {
    font-size: 1.3em;
    color: #d1e0e0;
    margin-bottom: 15px;
    font-weight: 500;
}

.prayer-table {
    width: 200px;
    border-collapse: collapse;
    color: #e0f2f7;
    font-size: 1.1em;
}

.prayer-table td {
    padding: 8px 15px;
    text-align: center;
    border-bottom: 1px solid #285454;
}

.prayer-table tr:last-child td {
    border-bottom: none;
}

.prayer-img-container .middle-image {
    max-width: 300px;
    height: auto;
}

.city-info {
    font-size: 1.4em;
    color: #a7d3e4;
    margin-top: 20px;
    font-weight: 500;
}

.city-info .city-name {
    font-weight: 700;
    color: #ffb300;
}

/* ===== NEWS & EVENTS SECTION ===== */
.news-item.card {
    background-color: rgba(26, 66, 66, 0.85);
    border: 1px solid #285454;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.news-item.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.news-item .news-thumb {
    width: 100%;
    height: 380px;
    object-fit: cover;
}

.news-item .card-body {
    padding: 15px 20px 20px;
}

.news-item .card-title {
    color: #ffffff;
    font-size: 1.6em;
    margin-bottom: 10px;
    font-weight: 600;
}

.news-item .card-text {
    font-size: 0.95em;
    line-height: 1.6;
    color: #d1e0e0;
}

.news-item .news-date {
    font-size: 0.85em;
    color: #a7d3e4;
    margin-top: 15px;
}

/* ===== CALENDAR SECTION ===== */
.quran-image-container {
    background-color: rgba(26, 66, 66, 0.85);
    border: 2px solid #285454;
    border-radius: 15px;
    padding: 30px;
}

.quran-image {
    max-width: 450px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ===== ARTICLES SECTION ===== */
.article-item.card {
    background-color: rgba(26, 66, 66, 0.85);
    border: 1px solid #285454;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.article-item .article-thumb,
.article-item .card-img-top {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.article-item .card-title {
    color: #ffffff;
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.article-item .card-text {
    color: #d1e0e0;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* ===== BUTTONS ===== */
.read-more,
.download-link {
    background-color: #ffb300;
    color: #0c2020;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
    font-size: 1.1em;
    border-radius: 5px;
    max-width: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.read-more i,
.download-link i {
    font-size: 1em;
    margin-right: 8px;
}

.read-more:hover,
.download-link:hover {
    background-color: #e09d00;
}

/* ===== ABOUT SECTION ===== */
.about-section p {
    max-width: 700px;
    margin: 0 auto 15px;
    font-size: 1.1em;
    line-height: 1.8;
    color: #e0f2f7;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.about-image {
    max-width: 70%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    margin-top: 20px;
    margin-bottom: 20px;
}

/* ===== CONTACT SECTION ===== */
.contact-section ul {
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(13, 39, 35, 0.5);
    border-radius: 5px;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

.contact-section ul li {
    font-size: 1.1em;
    color: #e0f2f7;
    line-height: 1.8;
}

.contact-section ul li strong {
    color: #ffb300;
}

/* ===== DOWNLOAD SECTION ===== */
.download-section ul {
    margin-top: 20px;
    padding: 0;
}

.download-section ul li {
    margin-bottom: 15px;
}

.download-section .download-link {
    background-color: rgba(26, 66, 66, 0.85);
    color: #e0f2f7;
    border: 1px solid #285454;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1em;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    max-width: 350px;
}

.download-section .download-link:hover {
    background-color: #285454;
    border-color: #3f6e6e;
}

.download-section .download-link i {
    color: #ffb300;
}

/* Download Grid */
.download-grid {
    max-width: 80%;
    margin: 0 auto;
}

.download-grid .download-item {
    background-color: rgba(26, 66, 66, 0.85);
    border: 1px solid #285454;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #e0f2f7;
    text-decoration: none;
}

.download-grid .download-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.download-grid .download-icon-wrapper {
    flex-shrink: 0;
}

.download-grid .download-icon {
    font-size: 2.5em;
    color: #ffb300;
}

.download-grid .download-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #ffffff;
}

.download-grid .download-description {
    font-size: 0.9em;
    color: #a7d3e4;
    line-height: 1.4;
}

/* ===== UTILITY CLASSES ===== */
.object-fit-cover {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ===== NEWS DETAIL PAGE STYLES ===== */
body.news-detail-page .main-wrapper {
    display: block;
}

body.news-detail-page .content {
    margin-left: 0;
    padding: 0;
    width: 100%;
}

body.news-detail-page .hamburger-menu-btn,
body.news-detail-page .offcanvas,
body.news-detail-page .sidebar {
    display: none;
}

body.news-detail-page .section-content {
    padding: 20px;
    background-image: url('bg_news.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991.98px) {
    .content {
        margin-left: 0;
        padding-top: 10px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .section-content {
        padding: 10px 15px;
        min-height: auto;
    }

    .section-content::after {
        height: 20px;
    }

    .section-title {
        font-size: 2.5em;
    }

    .sub-title {
        font-size: 1em;
        margin-bottom: 30px;
    }

    /* Home Section Responsive */
    .home-news-slide {
        padding-top: 0px;
        padding-bottom: 0px;
    }

    .news-overlay-top {
        top: 0px;
    }

    .home-news-slide .section-title {
        font-size: 2.5em;
        padding: 8px 5px;
    }

    .home-news-slide .section-title::after {
        width: 80%;
    }

    .home-news-slide .sub-title {
        font-size: 0.9em;
        padding: 5px 5px;
    }

    .news-slide-image {
        max-width: 95%;
        max-height: 200vh;
        margin: 15px auto;
    }

    .news-detail-text {
        font-size: 0.9em;
    }

    .news-detail-container {
        max-width: 95%;
        padding: 15px;
    }

    .carousel-label {
        font-size: 1em;
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 30px;
        height: 30px;
        font-size: 1.2em;
    }

    /* Prayer Times Responsive */
    .prayer-times-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .prayer-time-column {
        width: 100%;
    }

    .prayer-table {
        width: 100%;
    }

    .prayer-img-container .middle-image {
        max-width: 150px;
    }

    .city-info {
        font-size: 1.2em;
    }

    /* Buttons Responsive */
    .read-more,
    .download-link {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding: 10px 15px;
        font-size: 1em;
    }

    /* Cards Responsive */
    .news-grid.row > .col,
    .article-grid.row > .col {
        padding-left: 10px;
        padding-right: 10px;
    }

    .news-item .news-thumb,
    .article-item .card-img-top {
        height: 270px;
    }

    .news-item .card-title,
    .article-item .card-title {
        font-size: 1.3em;
    }

    .news-item .card-text,
    .article-item .card-text {
        font-size: 0.9em;
    }

    .quran-image {
        max-width: 300px;
    }

    .about-section p,
    .contact-section ul li {
        font-size: 1em;
    }

    .contact-section ul {
        padding: 15px;
    }

    /* Download Grid Responsive */
    .download-grid {
        max-width: 95%;
    }

    .download-grid .col {
        width: 100%;
    }

    .download-grid .download-item {
        flex-direction: column;
        text-align: center;
    }

    .download-grid .download-icon-wrapper {
        margin-right: 0 !important;
        margin-bottom: 10px;
    }

    .download-grid .download-title {
        font-size: 1.1em;
    }

    .download-grid .download-description {
        font-size: 0.8em;
    }
}

@media (max-width: 767.98px) {
    .home-news-slide .section-title {
        font-size: 2em;
    }

    .home-news-slide .sub-title {
        font-size: 0.8em;
    }

    .news-slide-image {
        max-height: 30vh;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .news-grid.row-cols-md-2 > .col,
    .article-grid.row-cols-md-2 > .col {
        flex: 0 0 auto;
        width: 50%;
    }

    .section-content {
        padding: 10px 20px;
    }

    .download-grid {
        max-width: 90%;
    }

    .download-grid .col-md-6 {
        width: 50%;
    }

    .download-grid .download-item {
        flex-direction: row;
        text-align: left;
    }

    .download-grid .download-icon-wrapper {
        margin-right: 15px !important;
        margin-bottom: 0;
    }

    .carousel-caption h2 {
        font-size: 1.5rem;
    }

    .carousel-caption p {
        font-size: 0.9rem;
    }
}



