/*
=========================================================
  STYLE SHEET — จัดระเบียบ CSS
  โครงสร้าง:
  01. Global / พื้นฐาน
  02. Navigation
  03. Typography
  04. Layout / Container / Main / Article
  05. Heading Bars
  06. Blog / Card Grid
  07. Documents
  08. Footer / Banner
  09.0 TEXT BOX GRID/กรอบข้อความ
  09.1 GALLERY ใช้งานร่วมกับ .text-box
  09.2 QUICK LINKS
  09.3 ICON LINKS
  10. NEWS MARQUEE
  11. Responsive Design
=========================================================
*/

/* =========================================================
   01. GLOBAL / พื้นฐาน
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    margin: 0;
    padding: 50px 0 0;
    overflow-x: hidden;
    background-image: url(../img_main/bg_samchukratana.jpg);
    background-attachment: fixed;
}


/* =========================================================
   02. NAVIGATION / เมนูหลัก
   ========================================================= */

nav {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    width: 1000px;
    background: rgb(48, 0, 49);
    color: #fff;
    font-family: "Futura";
    transform: translateX(-50%);
}

nav .logo {
    padding: 0 30px;
    font-size: 20px;
}

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

nav ul li {
    position: relative;
}

nav ul li a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    color: #fff;
    text-decoration: none;
    transition: 0.2s;
}

nav ul li a:hover,
nav ul li a.active {
    background: #fff;
    color: #000;
}

/* เมนูย่อย */
nav ul li .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    width: 200px;
    padding: 8px;
    border-radius: 0 0 10px 10px;
    background: rgb(48, 0, 49);
}

nav ul li .submenu li {
    width: 100%;
    box-sizing: border-box;
}

nav ul li .submenu li a {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

nav ul li:hover > .submenu {
    display: block;
}

nav ul li:has(.submenu) > a::after {
    margin-left: 5px;
    content: " ▾";
    font-size: 12px;
}

/* =========================================================
   03. TYPOGRAPHY / ตัวอักษร
   ========================================================= */

.ratana1 {
    font-size: 16px;
    font-family: Verdana, Geneva, sans-serif;
}




/* =========================================================
   04. LAYOUT / โครงสร้างหน้า
   ========================================================= */

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 10px;
    background-color: #fff;
    align-items: center;
}

.container img {
    max-width: 100%;
    height: auto;
}

/* Header / ภาพหัวเว็บ */
.container > head {
    display: block;
    width: 100%;
}

main {
    display: flex;
    width: 100%;
    max-width: 960px;
    margin: 25px auto;
    padding: 0 10px;
}

article {
    width: 770px;
    padding: 20px;
    border-radius: 15px;
    background: #fff;
    font-family: "Futura";
}


/* =========================================================
   05. HEADING BARS / แถบหัวข้อ
   ========================================================= */

/* ระดับที่ 1 */
.bar_1 {
    position: relative;
    margin: 25px 5px 15px;
    padding: 12px 20px 12px 24px;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        rgb(48, 0, 49),
        rgb(93, 40, 94)
    );
    box-shadow: 0 4px 12px rgba(48, 0, 49, 0.18);
    color: #fff;
    font-family: "Futura", "Tahoma", sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
}

.bar_1::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: #e8b84a;
    content: "";
}

.bar_1::after {
    position: absolute;
    bottom: 0;
    left: 24px;
    width: 70px;
    height: 3px;
    border-radius: 3px;
    background: #e8b84a;
    content: "";
}

/* ระดับที่ 2 */
.bar_2 {
    position: relative;
    max-width: 100%;
    margin: 20px 5px 12px;
    padding: 8px 16px 8px 18px;
    border-left: 4px solid rgb(150, 78, 151);
    border-radius: 0 8px 8px 0;
    background: linear-gradient(
        to right,
        rgba(150, 78, 151, 0.12),
        rgba(150, 78, 151, 0.03)
    );
    color: rgb(93, 40, 94);
    font-family: "Futura", "Tahoma", sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* ระดับที่ 3 */
.bar_3 {
    position: relative;
    margin: 16px 5px 10px;
    padding: 6px 12px 6px 14px;
    border-left: 3px solid #e8b84a;
    border-radius: 0 6px 6px 0;
    background: rgba(150, 78, 151, 0.06);
    color: rgb(93, 40, 94);
    font-family: "Futura", "Tahoma", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}


/* =========================================================
   06. BLOG / CARD GRID
   ========================================================= */

.blog-col3,
.blog-col4,
.blog-col5 {
    display: grid;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    gap: 12px;
    align-items: start;
}

.blog-col3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.blog-col4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.blog-col5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.blog-item {
    width: 100%;
    min-width: 0;
}

.blog-item:hover {
    transform: translateY(-3px);
    /* box-shadow:
        0 8px 20px rgba(48, 0, 49, 0.15); */
}

.blog-item img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 15px;
}

.blog-item .p1 {
    margin-top: 0;
    padding: 10px 5px;
    border-radius: 15px;
    background: rgb(150, 78, 151);
    color: #fff;
    font-size: 16px;
}

.blog-item a {
    text-decoration: none;
}

.blog-item a:hover {
    font-weight: bolder;
}

/* =========================================================
   07. DOCUMENTS / รายการเอกสาร
   ========================================================= */

.documents {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.document {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 20px;
    padding: 14px 18px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.06);
}

.document:hover {
    /* transform: translateY(-3px); */
    box-shadow: 0 8px 20px rgba(48, 0, 49, 0.15);
}

.document-date {
    flex: 0 0 115px;
    min-width: 115px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f1e7f7;
    color: #684276;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.document-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    line-height: 1.5;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 5px 11px;
    border-radius: 5px;
    background: #d9c2e9;
    color: #4a3157;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

/* =========================================================
   08. FOOTER / BANNER
   ========================================================= */

footer {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

footer img {
    display: block;
    width: 100%;
    height: auto;
}

.responsive-banner {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.responsive-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.site-head {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================================================
   09.0 TEXT BOX GRID/กรอบข้อความ
   ========================================================= */

.text-box-grid-1,
.text-box-grid-2,
.text-box-grid-3,
.text-box-grid-4,
.text-box-grid-5  {
    display: grid;
    width: 100%;
    gap: 15px;
}

/* 1 คอลัมน์ */
.text-box-grid-1 {
    grid-template-columns: 1fr;
}

/* 2 คอลัมน์ */
.text-box-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 3 คอลัมน์ */
.text-box-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 4 คอลัมน์ */
.text-box-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
/* 5 คอลัมน์ */
.text-box-grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.text-box {
    position: relative;
    margin: 15px 0;
    padding: 25px 28px;
    border: 2px solid #964e97;
    border-radius: 15px;
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #faf4fc 100%
    );

    box-shadow:0 4px 12px rgba(48, 0, 49, 0.10);
    color: #333;
    line-height: 1.8;
    transition: 0.25s ease;
}


/* เส้นตกแต่งด้านบน */
.text-box::before {
    content: "";
    position: absolute;
    top: -2px;
    left: 25px;
    width: 80px;
    height: 4px;
    border-radius: 0 0 5px 5px;
    background: #d4af37;
}


/* Hover */
.text-box:hover {
    /* transform: translateY(-3px); */
    box-shadow:0 8px 20px rgba(48, 0, 49, 0.15);
}


/* หัวข้อ */
.text-box-title {
    margin: 0 0 12px;
    color: #6b2872;
    font-size: 20px;
    font-weight: bold;
}

/* ข้อความ */
.text-box-content {
    margin: 0;
    font-size: 16px;
    line-height: 1.8;
}

/* ข้อความเน้น */
.text-box-highlight {
    color: #964e97;
    font-weight: bold;
}

/* =========================================================
   09.1 GALLERY ใช้งานร่วมกับ .text-box
   ========================================================= */
.gallery3, 
.gallery4,
.gallery5 {
    display: grid;
    gap: 15px;
    width: 100%;
}

.gallery3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gallery4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}   

.gallery5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}   

.gallery-item-teacher,
.gallery-item {
    overflow: hidden;
    width: 100%;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(48, 0, 49, 0.10);
    transition: 0.25s ease;
}

.gallery-item-teacher:hover,
.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(48, 0, 49, 0.15);
}

.gallery-item-teacher img {
    display: block;
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: 0.3s ease;
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: 0.3s ease;
}

.gallery-item-teacher:hover img,
.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    padding: 10px 12px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* ========================================
   09.2 QUICK LINKS
======================================== */

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 20px 15px;
    border: 1px solid #ead8ed;
    border-radius: 12px;
    background: #fff;
    color: #333;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(48, 0, 49, 0.08);
    transition: 0.25s ease;
}

.quick-link:hover {
    transform: translateY(-4px);
    border-color: #964e97;
    box-shadow: 0 6px 16px rgba(48, 0, 49, 0.15);
}

.quick-link-icon {
    margin-bottom: 10px;
    color: #964e97;
    font-size: 32px;
    line-height: 1;
}

.quick-link-title {
    margin-bottom: 5px;
    color: #6b2872;
    font-size: 17px;
    font-weight: bold;
}

.quick-link-desc {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}

/* ========================================
   09.3 ICON LINKS
======================================== */

.icon-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    gap: 10px;
    width: 100%;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid #ead8ed;
    border-radius: 8px;
    background: #fff;
    color: #6b2872;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(48, 0, 49, 0.06);
    transition: 0.2s ease;
}

.icon-link i {
    color: #964e97;
    font-size: 16px;
}

.icon-link:hover {
    border-color: #964e97;
    background: #f7eff9;
    color: #300031;
    transform: translateY(-2px);
}

.icon-link:hover i {
    color: #300031;
}

/* =========================================================
   10. NEWS MARQUEE
   ========================================================= */
.news-marquee {
    display: flex;
    align-items: center;
    width: 100%;
    height: 42px;
    overflow: hidden;
    border-radius: 8px;
    background: #300031;
    color: #fff;
}


/* ป้ายด้านซ้าย — ไม่วิ่ง */
.news-label {
    flex: 0 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    background: #964e97;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
}


/* พื้นที่ข้อความวิ่ง */
.news-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}


/* ข้อความ */
.news-text {
    display: inline-block;
    padding-left: 100%;
    font-size: 16px;
    animation: news-marquee 18s linear infinite;
}


/* Animation */
@keyframes news-marquee {

    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }

}

/* =========================================================
   10. Facebook Messenger Floating Button
   ========================================================= */

.school-messenger {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 20px 12px 12px;
  border-radius: 50px;
  background: #0866ff;
  color: #fff;
  text-decoration: none;
  font-family: "Sarabun", "Noto Sans Thai", Arial, sans-serif;

  box-shadow: 0 6px 24px rgba(0, 45, 120, 0.25);
  transition: transform .2s ease, box-shadow .2s ease;
}

.school-messenger:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 9px 28px rgba(0, 45, 120, 0.32);
}

.school-messenger:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 4px;
}

.school-messenger__icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #0866ff;
}

.school-messenger__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.school-messenger__text strong {
  font-size: 16px;
  line-height: 1.4;
}

.school-messenger__text small {
  font-size: 12px;
  line-height: 1.4;
  opacity: .9;
}

@media (prefers-reduced-motion: reduce) {
  .school-messenger {
    transition: none;
  }
}


/* =========================================================
   11. RESPONSIVE DESIGN / รองรับหน้าจอ
   ========================================================= */

/* Tablet : ไม่เกิน 900px */
@media (max-width: 900px) {
    .container {
        padding: 0 8px;
    }

    .blog-col5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        /* gap: 10px; */
    }

    .text-box-grid-5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    } 

    .gallery5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

}

/* Mobile / Tablet แนวตั้ง : ไม่เกิน 700px */
@media (max-width: 700px) {
    .container {
        padding: 0 6px;
    }

    main {
        margin: 15px auto;
        padding: 0 6px;
    }

    .document {
        align-items: stretch;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .document-date {
        flex: 0 0 auto;
        min-width: 105px;
        font-size: 14px;
    }

    .document-title {
        flex: 1 1 calc(100% - 120px);
        font-size: 15px;
    }

    .btn-view {
        margin-top: 6px;
        margin-left: 0;
    }

    .blog-col4,
    .blog-col5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        /* gap: 8px; */
    }

    .text-box-grid-4,
    .text-box-grid-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gallery4,
    .gallery5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .text-box {
        padding: 20px;
    }

    .text-box-title {
        font-size: 18px;
    }

    .text-box-content {
        font-size: 15px;
    }

    .news-label {
        padding: 0 12px;
        font-size: 14px;
    }

    .news-text {
        font-size: 14px;
    }

    .gallery-caption {
        font-size: 13px;
    }

    .school-messenger {
    right: 14px;
    bottom: 14px;
    gap: 9px;
    padding: 9px 15px 9px 9px;
  }

  .school-messenger__icon {
    width: 40px;
    height: 40px;
  }

  .school-messenger__text strong {
    font-size: 14px;
  }

  .school-messenger__text small {
    font-size: 11px;
  }

}

/* โทรศัพท์ : ไม่เกิน 480px */
@media (max-width: 480px) {
    .container {
        padding: 0 4px;
    }

    main {
        margin: 12px auto;
        padding: 0 4px;
    }

    .document {
        display: block;
        padding: 10px;
    }

    .document-date {
        display: inline-block;
        min-width: 0;
        margin-bottom: 7px;
        padding: 5px 9px;
        font-size: 13px;
    }

    .document-title {
        display: block;
        width: 100%;
        font-size: 14px;
        line-height: 1.6;
    }

    .btn-view {
        display: inline-flex;
        margin-top: 8px;
        padding: 6px 10px;
        font-size: 12px;
    }

    .blog-col3,
    .blog-col4,
    .blog-col5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

     /* .text-box-grid-2, */
    .text-box-grid-3,
    .text-box-grid-4,
    .text-box-grid-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery3,
    .gallery4,
    .gallery5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* โทรศัพท์จอเล็กมาก : ไม่เกิน 360px */
@media (max-width: 360px) {
    .blog-col3,
    .blog-col4,
    .blog-col5 {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }

    .text-box-grid-2, 
    .text-box-grid-3,
    .text-box-grid-4,
    .text-box-grid-5 {
        grid-template-columns: 1fr;
    }

    .gallery3,
    .gallery4,
    .gallery5 {
        grid-template-columns: 1fr;
    }

    .document-title {
        font-size: 13px;
    }

    .btn-view {
        font-size: 11px;
    }
}
