/* ==========================================================
 *  สไตล์เสริม: ระบบหลายภาษา + การ์ดข่าวที่มีรูปภาพจริง
 *  (แยกไฟล์ไว้เพื่อไม่ให้กระทบ style.css เดิม)
 * ========================================================== */

/* ---------- ฟอนต์ตามภาษา ---------- */
body.lang-th,
body.lang-th .brand-title,
body.lang-th h1, body.lang-th h2, body.lang-th h3, body.lang-th h4 {
  font-family: "Noto Sans Thai", "DM Sans", Arial, sans-serif;
}
body.lang-lo,
body.lang-lo .brand-title,
body.lang-lo h1, body.lang-lo h2, body.lang-lo h3, body.lang-lo h4 {
  font-family: "Noto Sans Lao", "DM Sans", Arial, sans-serif;
}
body.lang-zh,
body.lang-zh .brand-title,
body.lang-zh h1, body.lang-zh h2, body.lang-zh h3, body.lang-zh h4 {
  font-family: "Noto Sans SC", "DM Sans", Arial, sans-serif;
}

/* ภาษาไทย/ลาว ต้องการ line-height มากกว่าปกติ เพราะมีสระบน-ล่าง */
body.lang-th, body.lang-lo { line-height: 1.75; }
body.lang-th h1, body.lang-lo h1 { line-height: 1.25; letter-spacing: 0; }
body.lang-th h2, body.lang-lo h2,
body.lang-th .section-head h2, body.lang-lo .section-head h2 { line-height: 1.35; letter-spacing: 0; }
body.lang-th .hero h1, body.lang-lo .hero h1 { font-size: clamp(1.9rem, 4.2vw, 3.4rem); }
body.lang-zh .hero h1 { letter-spacing: 0; }

/* ---------- เมนูเลือกภาษา ---------- */
.language-menu { position: relative; }
.language-menu > summary {
  list-style: none;
  cursor: pointer;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid rgba(75, 37, 121, .25);
  background: rgba(255, 255, 255, .55);
  font-weight: 700;
  font-size: .88rem;
  color: var(--purple-900);
  white-space: nowrap;
}
.language-menu > summary::-webkit-details-marker { display: none; }
.language-menu > summary:hover { background: #fff; }
.language-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 190px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid #c3a06a;
  box-shadow: 0 18px 44px rgba(45, 23, 77, .22);
  z-index: 60;
  display: grid;
  gap: 4px;
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 11px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--purple-900);
  transition: background .18s ease;
}
.lang-option:hover { background: rgba(75, 37, 121, .1); }
.lang-option.is-active { background: var(--purple-900); color: #fff; }

/* ---------- การ์ดข่าว: รองรับรูปภาพที่อัพโหลดจริง ---------- */
.news-visual.has-image { padding: 0; align-items: stretch; }
.news-visual .news-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.news-visual.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(45, 23, 77, .05) 35%, rgba(45, 23, 77, .78));
  z-index: 1;
}
.news-visual.has-image .news-kicker {
  position: absolute;
  z-index: 2;
  left: 22px;
  bottom: 20px;
  right: 22px;
}

/* ---------- ปุ่มดูข่าวทั้งหมด ---------- */
.news-actions { margin-top: 38px; display: flex; justify-content: center; }

/* ---------- หน้ารายการข่าว / รายละเอียดข่าว ---------- */
.page-section { padding: 70px 0 92px; }
.page-hero {
  padding: 62px 0 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--purple-900), var(--purple-700));
}
.page-hero h1 {
  margin: 10px 0 0;
  font: 800 clamp(1.9rem, 4vw, 3rem)/1.18 "Manrope", sans-serif;
  color: #fff;
}
.page-hero .section-tag { color: var(--gold); }
.page-hero p { color: #e4d6f6; max-width: 720px; margin: 14px 0 0; }

.article-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px;
  border-radius: var(--radius);
  background: linear-gradient(125deg, var(--theme-card-a, #e2ebce), var(--theme-card-b, #f0d1d9));
  border: 1px solid #c3a06a;
  box-shadow: 0 14px 38px rgba(37, 16, 51, .18);
}
.article-wrap .article-date {
  color: var(--purple-700);
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.article-wrap h1 {
  margin: 12px 0 20px;
  color: var(--purple-900);
  font: 800 clamp(1.6rem, 3.4vw, 2.5rem)/1.28 "Manrope", sans-serif;
}
.article-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #c3a06a;
  margin-bottom: 26px;
}
.article-body { color: #3c2d52; font-size: 1.02rem; }
.article-body p { margin: 0 0 18px; }
.article-back { display: inline-flex; gap: 8px; margin-top: 30px; font-weight: 800; color: var(--purple-700); }

/* ---------- แจ้งเตือนว่าไม่มีข่าว ---------- */
.empty-note {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed #c3a06a;
  background: rgba(255, 255, 255, .72);
  color: var(--purple-900);
  font-weight: 700;
}

@media (max-width: 1020px) {
  .language-menu > div { position: static; width: 100%; margin-top: 10px; }
}
@media (max-width: 600px) {
  .article-wrap { padding: 24px; }
}

/* ==========================================================
 *  แผนที่ Google ฝังในการ์ดติดต่อ
 * ========================================================== */
.map-card { display: block; }
.map-card .map-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 0;
}
.map-card .map-label {
  z-index: 2;
  left: 16px;
  right: 16px;
  bottom: 16px;
  padding: 13px 16px;
  text-decoration: none;
}
.map-card .map-label strong { font-size: 1rem; }
.map-card .map-label:hover { background: rgba(45, 23, 77, .94); }

/* ==========================================================
 *  สไลด์โปสเตอร์ / ประกาศ
 * ========================================================== */
.updates-section { padding: 78px 0 92px; }
#updates {
  --tile: 50% 50%;
  background-image: linear-gradient(var(--shade, rgba(28,15,39,.12)), var(--shade, rgba(28,15,39,.12))), url("../img/atlas-news.svg") !important;
}
.poster-slider { position: relative; }
.poster-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid #c3a06a;
  box-shadow: 0 14px 38px rgba(37, 16, 51, .28);
  background: var(--purple-900);
  touch-action: pan-y;
}
.poster-track {
  display: flex;
  transition: transform .7s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
.poster-slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  aspect-ratio: 2 / 1;
  max-height: 600px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* พื้นหลังเบลอจากรูปเดียวกัน เพื่อให้โปสเตอร์ทุกสัดส่วนดูเต็มกรอบสวยงาม */
.poster-bg {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(.62);
}
.poster-slide a { position: relative; z-index: 1; display: block; height: 100%; }
.poster-slide img {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  margin: 0 auto;
}
.poster-slide figcaption {
  position: absolute;
  z-index: 2;
  left: 0; right: 0; bottom: 0;
  padding: 34px 76px 62px;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  background: linear-gradient(180deg, transparent, rgba(45, 23, 77, .85));
}
.poster-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(45, 23, 77, .62);
  color: #fff;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  transition: background .18s ease;
}
.poster-nav:hover { background: var(--purple-700); }
.poster-nav.prev { left: 14px; }
.poster-nav.next { right: 14px; }
.poster-bar {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(45, 23, 77, .62);
}
.poster-toggle {
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: .62rem;
  cursor: pointer;
  letter-spacing: -1px;
}
.poster-dots { display: flex; gap: 8px; }
.poster-dot {
  width: 10px; height: 10px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.poster-dot.active { width: 26px; background: var(--gold); }
.poster-slide figcaption + * { margin: 0; }

@media (max-width: 760px) {
  .poster-slide { aspect-ratio: 4 / 3; }
  .poster-nav { width: 38px; height: 38px; font-size: 1.5rem; }
  .poster-nav.prev { left: 8px; }
  .poster-nav.next { right: 8px; }
  .poster-slide figcaption { padding: 28px 54px 52px; font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  .poster-track { transition: none; }
}
