.display-mobile {
    display: none !important;
    padding: 20px 15px 0 15px;
}

.login-mobile {
    display: none !important;
}

@media (min-width: 1560px) {
    .container {
        max-width: 1600px;
    }


    .padding {
        padding-left: 5rem;
    }

    .width {
        width: 70%;
    }

    .about-text p {
        font-size: 18px;
    }

    .hero-prev,
    .one-prev {
        left: 15%;
    }

    .hero-next,
    .one-next {
        right: 15%;
    }

    .partner-section {
        padding: 90px 0px;
    }
}

@media (max-width: 1560px) {
    .container {
        max-width: 1400px;
    }
}

/* เมนู hamburger เริ่มทำงานตั้งแต่ 1100px ลงมา (ดู nav.css) — เหนือ 1100 เมนูยังเป็นแนวนอน
   (ย่อฟอนต์/โลโก้/ไอคอนลงเป็นชั้น ๆ) ปุ่มปิด/เข้าสู่ระบบ/TH-EN ใน drawer จึงโผล่ตามช่วง <=1100 */
@media (min-width: 1101px) {
    #closeMenu {
        display: none;
    }
}

@media (max-width: 1100px) {
    #closeMenu {
        display: block;
        color: black;
    }

    .display-mobile {
        display: flex !important;
    }

    .login-mobile {
        display: block !important;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 1100px;
    }

    .hero-prev,
    .one-prev {
        left: 2%;
    }

    .hero-next,
    .one-next {
        right: 2%;
    }


    .padding {
        padding-left: 8rem;
    }

    .end {
        display: flex;
        justify-content: end;
    }

    .width {
        width: 80%;
    }

    .about-text p {
        font-size: 16px;
    }
}

@media (min-width: 1200px) {
    .executive-section-detail-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .one-slider {
        width: 65%;
    }

    /* จอที่ไม่ใช่คอม ภาพแบนเนอร์เตี้ยลงมาก แต่จุด pagination ยังลอยทับอยู่ในภาพ
       ลึกคงที่ ~18px (bottom:30px !important ใน style.css) จึงไปบังแถบข้อมูล
       ติดต่อด้านล่างของภาพ — ย้ายจุดลงมาไว้ใต้ภาพแทน
       และเปลี่ยนจุด active จากสีขาวเป็นสีชมพู เพราะพื้นหลังส่วนนี้เป็นสีอ่อน */
    .hero-pagination {
        position: static !important;
        bottom: auto !important;
        margin-top: 14px;
    }

    .hero-pagination .swiper-pagination-bullet-active {
        background: #B63D97;
        box-shadow: none;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }

    .padding {
        padding-left: 4rem;
    }

    .masonry-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-card-right {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        margin-top: 10px;
    }

    .news-card-right .news-card {
        width: 100%;
    }

    .about-section-detail-row-first {
        flex-direction: column;
        gap: 1.5rem;
    }


    .about-detail-text {
        padding: 0;
    }

    .about-detail-content-items-group {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .divider {
        display: none;
        width: 120px;
        transform: rotate(90deg);
    }

    .sun-info .title {
        font-size: 24px;
    }

    .stats-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-top: 30px;
    }

    .stat-item h2 {
        font-size: 28px;
    }

    .stat-item p {
        font-size: 13px;
    }

    .stat-item img {
        width: 100px;
    }
}


@media (max-width: 767px) {

    .container {
        max-width: 700px;
    }
  #closeMenu {
        display: block;
        color: black;
    }
    .search-popup-close {
        top: 60px;
        right: 10px;
    }

    .width {
        width: 100%;
    }

    .about-text h2 {
        font-size: 20px !important;
    }

    .about-text p {
        font-size: 16px !important;
    }

    .display-mobile {
        display: flex !important;
    }

    .login-mobile {
        display: block !important;
    }

    .footer-middle-content,
    .footer-bottom-content {
        gap: 10px;
    }

    .footer-contact {
        font-size: 14px;
    }

    .footer-bootom-logo p {
        font-size: 14px;
    }


    .partner-section {
        padding: 30px 20px;
    }

    .padding {
        padding-left: 0rem;
    }

  

    .about-section {
        padding: 40px 20px;
    }

    .about-section .title {
        font-size: 24px;
        margin-bottom: 3rem;
    }

    .about-row {
        flex-direction: column;
        gap: 30px;
        margin-top: 2rem;
    }

    .about-row.reverse {
        flex-direction: column-reverse;
    }

    .about-text h2 {
        font-size: 24px;
    }

    .about-text p {
        font-size: 14px;
    }

    .eservice {
        padding: 30px 0;
    }

    .eservice-title {
        font-size: 20px;
        margin: 20px;
    }

    .service-slider {
        padding: 0;
    }

    .service-card {
        height: auto !important;
        min-height: 150px;
        max-width: 130px;
        padding: 15px 10px 20px 10px;
    }

    .service-card img {
        height: 55px;
    }

    /* จองที่ 2 บรรทัดไว้เสมอ (line-height ช่วงนี้เป็น 1.3 จึงใช้ 2.6em)
       ถ้าไม่จอง การ์ดที่ชื่อสั้นบรรทัดเดียวจะมีที่ว่างเหลือมากกว่า
       margin:auto ของรูปกับของ p ก็จะหารที่ว่างนั้นคนละครึ่ง ทำให้รูปหล่นต่ำลง */
    .service-card p {
        font-size: 11px;
        line-height: 1.3;
        margin-top: 10px;
        min-height: 2.6em;
    }

    .tab-container {
        flex-direction: column;
        margin: 30px 0;
    }

    .tab-buttons {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-radius: 10px 10px 0 0;
    }

    .tablink {
        white-space: nowrap;
        padding: 12px 20px;
        font-size: 14px;
    }

    .tablink::after {
        width: 1px;
        height: 100%;
        left: auto;
        right: 0;
        top: 0;
    }

    .tabcontent {
        width: 100%;
        border-left: none;
        border-top: 1px solid #E7C0E0;
        padding: 20px;
    }

    .one-slider-section {
        padding: 40px 0;
    }

    .one-slider {
        width: 80%;
    }

    .news-card-right {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        margin-top: 10px;
        padding: 25px;
    }

    .news-card-right .news-card {
        width: 100%;
    }

    .image-partners {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .ncsa-logo {
        height: 55px !important;
    }

    .image-partners img {

        margin: auto;
    }



}

@media (min-width: 768px) and (max-width: 1199px) {
    .executive-section-detail-row {
        grid-template-columns: repeat(2, 1fr);
    }

    /* แท็บเล็ต / มือถือแนวนอน
       เดิม responsive หยุดปรับที่ 767px แต่หัวเว็บเปลี่ยนเป็นเมนู hamburger
       ตั้งแต่ 1573px ลงมา ช่วง 768-1573 จึงได้เนื้อหาขนาดเท่าจอคอม
       ทำให้ E-Service ดูใหญ่เกินหัวเว็บและแบนเนอร์ */
    .hero-slider-section {
        padding: 30px 0;
    }

    .eservice {
        padding: 30px 0;
    }

    .eservice-title {
        margin: 20px;
    }

    .service-slider {
        padding: 20px 45px;
    }

    /* 150px คือความกว้างต่ำสุดที่ชื่อยาวสุดยังจบใน 2 บรรทัด
       ถ้าแคบกว่านี้จะกลายเป็น 3 บรรทัด แล้วรูปในการ์ดนั้นจะไม่ตรงกับใบอื่น */
    .service-card {
        height: 150px;
        max-width: 150px;
        padding: 12px 10px;
    }

    .service-card img {
        height: 55px;
    }

    .one-slider {
        width: 75%;
    }
}

/* ความสูงหัวเว็บผูกกับ 2 อย่าง: ความกว้างโลโก้ (อัตราส่วน ~5.1:1 + padding 10px บน-ล่าง)
   และเส้นคั่น .v-line สูง 65px ที่ค้ำความสูงขั้นต่ำของแถวเครื่องมือขวาไว้

     จอ (โหมด)             โลโก้    ตัวค้ำความสูง         body padding-top
     1601px+  (แนวนอนเต็ม)  300px   โลโก้ ~79px           80px   (style.css)
     ≤1600    (แนวนอนย่อ1-2) 200/180 v-line 65px           68px   (style.css)
     ≤1250    (แนวนอนย่อ3)   150px   โลโก้/เมนู ~52px       57px   (style.css — ชั้นนี้ซ่อน v-line)
     ≤1100    (drawer)       220px   โลโก้ 63.1px           65px   (style.css)
     ≤600     (drawer)       180px   โลโก้ 55.3px           56px   (ไฟล์นี้ ด้านล่าง)
     ≤480     (drawer)       150px   โลโก้ 49.4px           50px   (ไฟล์นี้)

   ถ้าแก้ความกว้างโลโก้/v-line ใน nav.css ต้องแก้ padding-top ให้ตรงกันด้วย
   ไม่งั้นจะได้ช่องว่างขาวใต้หัวเว็บ (padding มากไป) หรือหัวเว็บทับเนื้อหา (padding น้อยไป) */
@media (max-width: 600px) {
    body {
        padding-top: 56px;
    }
}

@media (max-width: 576px) {
    .about-section {
        padding: 30px 15px;
    }

    .hero-pagination {
        gap: 0;
    }


    .about-section .title {
        font-size: 20px;
        margin-bottom: 2rem;
    }

    .about-row {
        gap: 20px;
    }

    .about-text h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .about-text p {
        font-size: 13px;
        line-height: 1.6;
    }

    .hero-prev,
    .hero-next,
    .one-prev,
    .one-next,
    .service-next,
    .service-prev {
        width: 25px;
        height: 25px;
    }

    .sun-info {
        padding: 20px;
    }

    .sun-info .title {
        font-size: 18px;
    }

    .stat-item h2 {
        font-size: 24px;
    }

    .stat-item p {
        font-size: 12px;
    }

    .stat-item img {
        width: 80px;
    }

    .doccument-section .title {
        font-size: 24px;
    }

    .tablink {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* height ที่ตั้งไว้เดิมไม่ทำงาน เพราะช่วง 767px ใส่ height:auto !important ไว้
       ต้องคุมด้วย min-height แทน */
    .service-card {
        min-height: 130px;
        max-width: 120px;
        padding: 10px 8px;
    }

    .service-card img {
        height: 50px;
    }

    .service-card p {
        font-size: 10px;
    }

    .one-slider {
        width: 82%;
    }

    .one-pagination {
        bottom: 10px;
    }

    .masonry-container {
        grid-template-columns: 1fr;
    }

    .about-section-head {
        padding: 20px 10px;
    }

    .title-about {
        font-size: 20px;
    }

    .about-descripsion {
        font-size: 16px;
    }

    .about-detail-text-title h2 {
        font-size: 18px;
    }

    .about-detail-text-description,
    .about-detail-content-description,
    .about-detail-content-description p {
        font-size: 14px;
        line-height: 1.5rem;
    }

    .about-detail-content-items-group {
        grid-template-columns: 1fr;
    }

    .content-item-image {
        height: auto;
    }

    .content-item-detail-title {
        margin: 10px 0;
    }


    .hero-slider-section {
        padding: 0;
    }

    .heroSwiper img,
    .one-slider img {
        border-radius: 20px;
    }

    .image-partners img {
        width: auto;
        height: 80px;
        margin: auto;
    }

    .image-partners {
        display: grid;
        grid-template-columns: repeat(2, 1fr);

    }

    .ncsa-logo {
        height: 55px !important;
    }

    .hero-text {
        left: 0;
        transform: translate(0, -50%);
        font-size: 16px;
        padding: 20px;
    }
}

@media (max-width: 425px) {
    .news-card-right {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        margin-top: 10px;
    }

    .news-card-right .news-card {
        width: 100%;
    }

}




@media (max-width: 480px) {
    /* หัวเว็บช่วงนี้สูง 49.4px (โลโก้ 150px ใน nav.css) — ดูตารางด้านบน */
    body {
        padding-top: 50px;
    }

    .executive-head-detail-content {
        max-width: 100%;
    }

    .executive-information-name {
        font-size: 14px;
    }

    .executive-information-position,
    .executive-information-tel {
        font-size: 12px;
    }

    .executive-head-detail-content {
        max-width: 250px;
    }

    .executive-section-detail-row-head {
        margin-top: 0;
    }

    .executive-title {
        margin: 3rem 0;
    }

    .executive-title h2 {
        font-size: 20px;
    }
}

@media (max-width: 375px) {
    .executive-detail-content-image {
        aspect-ratio: 1 / 1.2;
    }

    .executive-information-name {
        font-size: 10px;
    }

    .executive-information-position,
    .executive-information-tel {
        font-size: 9px;
    }

    .executive-section-detail-row {
        margin-top: 0;
    }
}