/* ==== iOS overlap fix (clean version) ==== */
@media (max-width: 767.98px){
  .news-slider-section,
  .news-slider-section .swiper,
  .news-slider-section .swiper-container,
  .news-slider-section .carousel,
  .news-slider-section .carousel-inner {
    position: relative !important;
    overflow: hidden !important;
    isolation: isolate;
  }

  .news-slider-section::after {
    content: ""; display: block; height: 28px;
  }

  .programs-section {
    position: relative; z-index: 2;
    margin-top: 0;
    -webkit-transform: translateZ(0);
  }
}

@supports (-webkit-touch-callout: none) {
  .news-slider-section,
  .news-slider-section .swiper,
  .news-slider-section .swiper-container {
    overflow: hidden !important;
  }
}

/* Remove legacy pseudo icon for "เลือกรับฟังรายการ" */
.programs-section h2::before {
  content: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
}

/* จัดระยะหัวข้อเมื่อใช้ FA icon */
.programs-section h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* Kill pseudo icon for programs */
.programs-section h2::before {
  content: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
}
/* Force remove pseudo icon (stronger selector) */
body .programs-section h2::before {
  content: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  display: none !important;
}
body .news-slider-section h2::before {
  content: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  display: none !important;
}
/* ปิด pseudo icons เก่า */
body .news-slider-section h2::before,
body .programs-section h2::before {
  content: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  display: none !important;
}
/* Admin news thumbnails: force 4:3 and uniform size */
.table .thumb-cell {
  width: 180px;              /* ความกว้างคอลัมน์ (ปรับได้) */
  text-align: center;
  vertical-align: middle;
}

.thumb-frame {
  width: 110px;          /* กำหนดความกว้างคงที่ */
  aspect-ratio: 16 / 9;  /* คุมให้เป็นแนวนอน */
  border-radius: 6px;
  overflow: hidden;
  background: #f3f4f6;
  display: inline-block;
}

.thumb-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* ครอบรูปให้เต็มกรอบ */
  display: block;
}
/* ==== Hover Effects for Thumbnails ==== */
.thumb-frame img {
  transition: all 0.3s ease;
}

.thumb-frame img:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transform: scale(1.02); /* ขยายเบาๆ */
}

/* ==== Border for Thumbnails ==== */
.thumb-frame {
  border: 1px solid #ddd;   /* เทาอ่อน */
  border-radius: 6px;       /* มุมโค้ง */
}
/* Popup overlay */
#imgPreviewOverlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
#imgPreviewOverlay img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.5);
  background: #fff;
}

/* จัดระยะให้ verse-box align กับ grid ด้านล่าง */
.verse-section {
  padding-left: 0px !important;
  padding-right: 0px !important;
}

.verse-box {
  margin: 0 auto;              /* กึ่งกลาง */
  max-width: 100%;             /* ขยายเต็ม */
  border-radius: 12px;
}
/* ===================================
   Mobile: Program Card Text Smaller (Force Override)
   =================================== */
@media (max-width: 768px) {
    /* ชื่อรายการภาษาไทย - Force Override */
    .program-card .program-info .program-title,
    .program-info .program-title,
    .program-title {
        font-size: 0.8rem !important;
        font-weight: 400 !important;
        margin-bottom: 0.2rem !important;
        line-height: 1.25 !important;
    }
    
    /* ชื่อรายการภาษาอังกฤษ - Force Override */
    .program-card .program-info .program-title-en,
    .program-info .program-title-en,
    .program-title-en,
    .program-title span {
        font-size: 0.65rem !important;
        font-weight: 300 !important;
        margin-top: 0.1rem !important;
        opacity: 0.85 !important;
    }
    
    /* ปรับ padding */
    .program-card .program-info,
    .program-info {
        padding: 0.7rem !important;
    }
}

/* สำหรับมือถือเล็กมาก */
@media (max-width: 400px) {
    .program-title {
        font-size: 0.75rem !important;
        font-weight: 400 !important;
    }
    
    .program-title-en,
    .program-title span {
        font-size: 0.6rem !important;
        font-weight: 300 !important;
    }
}


