/* ============================================================
   🌿 Thapthan Health - Main Stylesheet (Professional + Responsive)
   ============================================================ */


/* ==================== RESET ==================== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-image: url('/img/background.gif');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  font-family: 'IBM Plex Sans Thai', sans-serif;
  color: #333;
}


/* ================================================
   หัวข้อภายใน .container — Responsive Pro Level
   ================================================ */
.container h2 {
  padding-top: 35px !important;
  margin-top: 0 !important;
  color: #1A76D1 !important;
  font-weight: 600 !important;

  /* 📌 ปรับขนาดตัวอักษรอัตโนมัติตามขนาดจอ */
  font-size: clamp(2rem, 3vw, 3rem) !important;
}


/* ============================================================
   PAGE TITLE (ข่าว/กิจกรรม) — Professional Version
   ============================================================ */

.page-title {
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 700;
  color: #1A76D1;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 30px;
  padding-bottom: 10px;
  letter-spacing: 1px;
  position: relative;
}

/* เส้นคั่นหัวข้อ */
.page-title::after {
  content: "";
  width: 90px;
  height: 4px;
  background: #1A76D1;
  display: block;
  margin: 12px auto 0;
  border-radius: 6px;
}



/* ============================================================
   CONTAINER — กล่องเนื้อหา สีขาวกลางหน้า
   ============================================================ */

.container {
  max-width: 1300px;
  margin: 0px auto; /* เว้นขอบด้านบน 30px และจัดกลางแนวนอน */
  padding: 20px 25px;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
  margin-top: 10px !important;   /* เว้นระยะจาก header ด้านบน */
  margin-bottom: 10px !important;/* เว้นระยะจาก footer ด้านล่าง */
    transition: margin 0.3s ease;  /* เพิ่มเอฟเฟกต์เล็กน้อยเวลาเปลี่ยนขนาดจอ */
}

/* ✅ บังคับให้หัวข้อภายในกล่องขยับลงจากขอบบน */
.container h1 {
  padding-top: 35px !important;   /* ✅ เพิ่มระยะห่างภายในกล่อง */
  margin-top: 0 !important;       /* ✅ ป้องกันไม่ให้ดันทั้งกล่องลง */
  color: #1A76D1 !important;
  font-size: 2rem !important;
  font-weight: 600 !important;
}



/* ============================================================
   HEADER SECTION
   ============================================================ */

.header {
  display: grid;
  grid-template-columns: 125px auto;
  height: 125px;
  margin-top: 7px;
  margin-left: 5px;
  grid-gap: 4px;
  position: relative;
  z-index: 10;
}

.header-logo img {
  width: 110px;
  height: auto;
}

.header-office {
  font-size: 10pt;
  color: #00622e;
  margin-top: 20px;
  text-shadow: 3px 5px 8px #3b3b3b;
}

.header-office h1 {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.5;
}



/* ============================================================
   MENU
   ============================================================ */

.grid-menu {
  display: grid;
  height: 35px;
  background: #cdcdcd;
  position: relative;
  z-index: 20;
}

ul.menu {
  display: grid;
  grid-template-columns: repeat(5, 20%);
  margin: 0;
  padding: 0;
  justify-items: center;
  align-items: center;
}

ul.menu li {
  list-style: none;
}

ul.menu li a {
  text-decoration: none;
  color: #2b2b2b;
  text-transform: uppercase;
  padding: 5px 10px;
  font-weight: bold;
  transition: 0.3s ease-in-out;
}

ul.menu li a:hover {
  background: #40a170;
  color: #ffffff;
  border-radius: 5px;
}



/* ============================================================
   CONTENT NEWS — ข่าว/กิจกรรม
   ============================================================ */

.content-news {
  width: 100%;
  margin-bottom: 50px;
  padding-bottom: 10px;
  
}

.content-news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  width: 95%;
  max-width: 1300px;
  margin: 30px auto;
}

.content-news-item {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-news-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.content-news-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-bottom: 4px solid #1A76D1;
  background-color: white;
}

.content-news-item p {
  padding: 12px 15px 20px;
  text-align: justify;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

/* ลิงก์อ่านเพิ่มเติม */
.cr {
  text-align: right;
  border-top: 1px solid #e4e4e4;
  padding: 8px 15px;
}

.content-news-item a {
  color: #1A76D1;
  font-weight: bold;
  text-decoration: none;
}

.content-news-item a:hover {
  text-decoration: underline;
}

/* indent */
.indent {
  text-indent: 2em;
}



/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  width: 100%;
  height: 90px;
  display: grid;
  justify-items: center;
  align-items: center;
  background: #303030;
}

.copytext {
  color: #979797;
  text-align: center;
  font-size: 13px;
  line-height: 1.4;
}



/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Desktop */
@media (min-width: 1201px) {
  .content-news-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Laptop */
@media (max-width: 1200px) {
  .content-news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet */
@media (max-width: 900px) {
  .content-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .content-news-grid {
    grid-template-columns: 1fr;
  }

  .header {
    grid-template-columns: 80px auto;
  }

  ul.menu {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }
}

/* ปรับปุ่มในมือถือ */
@media (max-width: 768px) {
  .btn-more {
    padding: 6px 14px;
    font-size: 0.7rem;
    border-radius: 20px;
  }
}


/* ============================================================
   READ MORE BUTTON — ปุ่มอ่านข่าวเพิ่มเติม (ชิดขวาเสมอ)
   ============================================================ */

.read-more {
  display: flex;
  justify-content: flex-end !important;   /* ➜ ชิดขวาตลอดทุกอุปกรณ์ */
  margin-top: 20px;
  margin-bottom: 10px;
}

.btn-more {
  background: #1A76D1;
  color: #ffffff;
  padding: 10px 22px;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  transition: 0.25s ease-in-out;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.btn-more:hover {
  background: #155a9c;
  transform: translateY(-2px);
}

/* ปรับขนาดเฉยๆ — ไม่แตะตำแหน่งปุ่ม */
@media (max-width: 600px) {
  .btn-more {
    padding: 8px 18px;
    font-size: 0.85rem;
  }
}
