/* home-patch.css : โหลดต่อจาก home.css (CSS เดิมของหน้าแรก) */
[hidden] { display: none !important; }

/* reveal: ไม่ซ่อนเนื้อหาถ้า JS ไม่ทำงาน */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(40px); transition: all .6s ease; }
.js .reveal.active { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .fade { animation: none; }
}

/* focus */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px var(--primary); }
#nav-list > li:focus-within .dropdown-menu { display: block; }
#main-content:focus { outline: none; }

/* หัวข้อ section (แทน inline style) */
.section-title { color: var(--primary); margin: 0; font-size: 2.2rem; font-weight: 700; }
.title-bar { width: 60px; height: 5px; background: var(--accent); margin: 15px auto 0; border-radius: 5px; }
.title-bar.left { margin-left: 0; margin-top: 10px; }
.dept-card h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.stat-note { text-align: center; color: var(--text-muted); font-size: .85rem; margin: 10px 0 0; }

/* ปุ่มหลัก (เหลือ 2 ปุ่ม) */
.card-meta { color: #64748b; }
.eservice-icon-box { background: #b45309; }
.eservice-row-card:hover .eservice-icon-box { background: #92400e; }

/* popup: ใช้ attribute hidden แทน inline display */
#specialDayPopup { background: rgba(0, 20, 60, .75); }
.popup-img { box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.enter-site-btn { background: var(--accent); color: var(--primary); }

/* embed กดก่อนโหลด */
.embed-btn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #0f172a; color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Kanit', sans-serif; }
.embed-btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.embed-btn i { position: relative; font-size: 72px; color: #fff; text-shadow: 0 4px 15px rgba(0,0,0,.5); transition: transform .2s; }
.embed-btn:hover i { transform: scale(1.1); }
.map-box { position: relative; }
.map-btn { flex-direction: column; gap: 12px; background: #e2e8f0; color: var(--primary); font-size: 1.1rem; }
.map-btn i { color: var(--primary); text-shadow: none; font-size: 56px; }
.embed-note { text-align: center; color: var(--text-muted); font-size: .85rem; margin: 12px 0 0; }

/* ข่าว */
.news-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 30px; flex-wrap: wrap; gap: 20px; }
.news-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.news-empty { grid-column: 1/-1; padding: 40px; text-align: center; color: #64748b; background: #fff; border-radius: 12px; border: 1px dashed #cbd5e1; }
.btn-all-news { display: inline-block; margin-top: 10px; padding: 10px 28px; border-radius: 50px; background: var(--primary); color: #fff; text-decoration: none; font-weight: 600; transition: .3s; }
.btn-all-news:hover { background: var(--accent); color: var(--primary); }

/* Facebook box */
.fb-box { background: #fff; border-radius: 12px; box-shadow: 0 5px 15px rgba(0,0,0,.05); overflow: hidden; padding: 20px; border: 1px solid #eee; text-align: center; margin-top: 20px; }
.fb-box p { color: #64748b; font-size: .95rem; margin: 0 0 15px; }
.fb-btn { background: #1877F2; color: #fff; border: none; padding: 10px 24px; border-radius: 30px; font-family: 'Kanit', sans-serif; font-weight: 600; cursor: pointer; }
.fb-link { display: block; margin-top: 12px; font-size: .85rem; color: #1877F2; }

/* chat */
.chat-close { background: none; border: 0; color: #fff; cursor: pointer; font-size: 1rem; }
.msg { white-space: pre-line; }
.chat-box { width: min(340px, calc(100vw - 40px)); }
#cookieConsent { display: block; }
#cookieConsent[hidden] { display: none !important; }
.access-card .access-icon, .access-card img { width: 70px; height: 70px; }

/* มือถือ */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-number { font-size: 2rem; }
  .section-title { font-size: 1.7rem; }
  .cookie-btns { width: 100%; }
  .cookie-btn { flex: 1; }
}