/* ============================================================
   Content pages: network, news, docs, ITA, calendar, contact, about, login
   ============================================================ */

/* ---- Filter bar ---- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter-chip { padding: 9px 20px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: #fff; font-family: var(--font-head); font-weight: 600; font-size: .95rem; color: var(--ink-700); transition: all .15s ease; }
.filter-chip:hover { border-color: var(--brand-400); color: var(--brand-700); }
.filter-chip.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }

/* ================= NETWORK MAP ================= */
.netmap-layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.netmap-aside { position: sticky; top: 200px; }
.netmap-search { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: #fff; color: var(--ink-500); margin-bottom: 14px; }
.netmap-search:focus-within { border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-50); }
.netmap-search__input { flex: 1; border: none; background: transparent; padding: 10px 0; font-family: var(--font-body); font-size: .98rem; min-width: 0; }
.netmap-search__input:focus { outline: none; }
.facility-list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding: 2px; }
.facility-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: #fff; text-align: right; transition: all .14s ease; }
.facility-item:hover { border-color: var(--brand-300); background: var(--brand-50); }
.facility-item.is-sel { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
.facility-item__ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--brand-100); color: var(--brand-700); }
.facility-item__ic.is-hq { background: var(--emergency); color: #fff; }
.facility-item__txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facility-item__name { font-family: var(--font-head); font-weight: 600; font-size: .98rem; color: var(--ink-900); }
.facility-item__tambon { font-size: .85rem; color: var(--ink-500); }
.facility-item__arrow { color: var(--ink-300); flex: none; }
.facility-empty { padding: 24px; text-align: center; }

.netmap-main { display: flex; flex-direction: column; gap: 20px; }
.netmap { position: relative; aspect-ratio: 16/10; background: linear-gradient(160deg, #eef7f2, #def0e7); overflow: hidden; padding: 0; }
.netmap__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.netmap__legend { position: absolute; top: 14px; right: 14px; z-index: 4; display: flex; flex-direction: column; gap: 7px; background: rgba(255,255,255,.94); padding: 12px 16px; border-radius: var(--r-md); box-shadow: var(--shadow-sm); font-family: var(--font-head); font-size: .84rem; }
.netmap__legend-item { display: flex; align-items: center; gap: 8px; color: var(--ink-700); }
.netmap__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand-600); }
.netmap__dot--hq { background: var(--emergency); }
.netmap__pin { position: absolute; transform: translate(50%, -50%); width: 30px; height: 30px; display: grid; place-items: center; background: var(--brand-600); color: #fff; border-radius: 50% 50% 50% 0; rotate: 45deg; box-shadow: var(--shadow-md); border: 2px solid #fff; cursor: pointer; transition: transform .14s ease; z-index: 2; }
.netmap__pin .icon { rotate: -45deg; }
.netmap__pin:hover { transform: translate(50%, -60%) scale(1.1); z-index: 5; }
.netmap__pin.is-hq { background: var(--emergency); width: 40px; height: 40px; z-index: 3; }
.netmap__pin.is-sel { background: var(--gold-600); transform: translate(50%, -64%) scale(1.18); z-index: 6; }
.netmap__pin-label { position: absolute; top: 112%; right: 50%; transform: translateX(50%); rotate: -45deg; white-space: nowrap; font-family: var(--font-head); font-size: .68rem; font-weight: 600; color: var(--ink-800); background: rgba(255,255,255,.9); padding: 1px 6px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .14s ease; }
.netmap__pin:hover .netmap__pin-label, .netmap__pin.is-sel .netmap__pin-label { opacity: 1; }

.facility-detail { padding: 24px; }
.facility-detail__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.facility-detail__badge { padding: 5px 14px; border-radius: var(--r-pill); background: var(--brand-100); color: var(--brand-700); font-family: var(--font-head); font-weight: 700; font-size: .85rem; }
.facility-detail__badge.is-hq { background: #fbe6e4; color: var(--emergency-dark); }
.facility-detail__name { font-size: 1.4rem; }
.facility-detail__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 20px; }
.fd-item { display: flex; gap: 12px; align-items: flex-start; }
.fd-item__ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--brand-50); color: var(--brand-600); }
.fd-item div { display: flex; flex-direction: column; gap: 2px; }
.fd-item__label { font-size: .82rem; color: var(--ink-500); }
.fd-item__value { font-family: var(--font-head); font-weight: 600; color: var(--ink-900); }
.facility-detail__services { padding: 18px 0; border-top: 1px solid var(--line); }
.fd-services-label { display: block; font-family: var(--font-head); font-weight: 600; font-size: .92rem; color: var(--ink-700); margin-bottom: 10px; }
.fd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.facility-detail__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ================= NEWS LIST ================= */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card { display: flex; flex-direction: column; text-align: right; overflow: hidden; padding: 0; }
.news-card__img { width: 100%; aspect-ratio: 16/9; --is-bg: var(--brand-100); border-radius: 0; }
.news-card__body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.news-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.news-card__title { font-size: 1.12rem; line-height: 1.4; color: var(--ink-900); }
.news-card__excerpt { margin-top: 10px; font-size: .94rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.news-card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-family: var(--font-head); font-weight: 600; color: var(--brand-700); align-self: flex-end; }
.news-card:hover .news-card__more { gap: 10px; }

/* ================= ARTICLE ================= */
.article-wrap { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }
.article__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.article__hero { width: 100%; aspect-ratio: 16/8; --is-bg: var(--brand-100); margin-bottom: 26px; }
.article__body { font-size: 1.06rem; line-height: 1.85; color: var(--ink-800); }
.article__lead { font-size: 1.18rem; font-weight: 500; color: var(--ink-900); margin-bottom: 20px; }
.article__body h3 { font-size: 1.3rem; margin: 28px 0 12px; color: var(--brand-800); }
.article__body p { margin-bottom: 16px; }
.article__list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; padding-right: 8px; }
.article__list li { position: relative; padding-right: 26px; }
.article__list li::before { content: ""; position: absolute; right: 4px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); }
.article__share { display: flex; align-items: center; gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.article__share a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); }
.article__share a:hover { background: var(--brand-700); color: #fff; }
.article-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 200px; }
.aside-card { padding: 22px; }
.aside-card__title { font-size: 1.12rem; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 2px solid var(--brand-100); }
.attach { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 10px; color: var(--ink-800); }
.attach:hover { border-color: var(--brand-300); background: var(--brand-50); text-decoration: none; }
.attach > span { flex: 1; display: flex; flex-direction: column; }
.attach .icon:first-child { color: var(--emergency); }
.attach__name { font-family: var(--font-head); font-weight: 600; font-size: .95rem; }
.attach__size { font-size: .82rem; color: var(--ink-500); }
.aside-news { display: flex; flex-direction: column; }
.aside-news li { border-bottom: 1px solid var(--line); }
.aside-news li:last-child { border-bottom: none; }
.aside-news button { display: flex; flex-direction: column; gap: 5px; width: 100%; text-align: right; padding: 13px 0; border: none; background: transparent; }
.aside-news__title { font-family: var(--font-head); font-weight: 600; font-size: .96rem; color: var(--ink-800); line-height: 1.4; }
.aside-news button:hover .aside-news__title { color: var(--brand-700); }
.aside-news__date { font-size: .82rem; }

/* ================= DOCUMENTS ================= */
.doc-list { display: flex; flex-direction: column; gap: 12px; }
.doc-row { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.doc-row__type { width: 54px; height: 54px; flex: none; display: grid; place-items: center; border-radius: var(--r-md); font-family: var(--font-head); font-weight: 800; font-size: .82rem; background: var(--brand-50); color: var(--brand-700); }
.doc-row__type--pdf { background: #fbe6e4; color: var(--emergency-dark); }
.doc-row__type--docx { background: var(--info-100); color: var(--info-600); }
.doc-row__info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.doc-row__title { font-family: var(--font-head); font-weight: 600; font-size: 1.06rem; color: var(--ink-900); }
.doc-row__meta { font-size: .88rem; color: var(--ink-500); }
.doc-row__btn { flex: none; }

/* ================= ITA ================= */
.ita-banner { display: flex; align-items: center; gap: 20px; padding: 24px 28px; margin-bottom: 28px; border-right: 5px solid var(--gold-500); flex-wrap: wrap; }
.ita-banner__ic { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--gold-100); color: var(--gold-700); }
.ita-banner__txt { flex: 1; min-width: 240px; }
.ita-banner__title { font-size: 1.3rem; margin-bottom: 6px; }
.ita-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.ita-card { padding: 24px; }
.ita-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ita-card__code { padding: 5px 12px; border-radius: var(--r-sm); background: var(--brand-700); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .82rem; }
.ita-card__title { font-size: 1.2rem; }
.ita-card__list { display: flex; flex-direction: column; }
.ita-card__list li { border-bottom: 1px solid var(--line); }
.ita-card__list li:last-child { border-bottom: none; }
.ita-card__list a { display: flex; align-items: center; gap: 11px; padding: 13px 4px; color: var(--ink-800); }
.ita-card__list a:hover { color: var(--brand-700); text-decoration: none; }
.ita-card__list a .icon:first-child { color: var(--brand-500); flex: none; }
.ita-card__list a span { flex: 1; }
.ita-card__arrow { color: var(--ink-300); }
.ita-card__list a:hover .ita-card__arrow { color: var(--brand-600); }

/* ================= CALENDAR ================= */
.cal-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.cal { padding: 24px; }
.cal__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.cal__head h3 { font-size: 1.4rem; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal__dow { text-align: center; font-family: var(--font-head); font-weight: 600; font-size: .88rem; color: var(--ink-500); padding-bottom: 8px; }
.cal__cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px solid transparent; border-radius: var(--r-md); background: var(--surface-2); position: relative; }
.cal__cell.is-empty { background: transparent; }
.cal__cell.has-ev { background: #fff; border-color: var(--line); cursor: pointer; }
.cal__cell.has-ev:hover { border-color: var(--brand-400); }
.cal__cell.is-sel { border-color: var(--brand-600); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
.cal__cell:disabled { cursor: default; }
.cal__num { font-family: var(--font-head); font-weight: 600; font-size: 1.04rem; color: var(--ink-800); }
.cal__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); }
.cal__dot--info { background: var(--info-600); } .cal__dot--gold { background: var(--gold-500); } .cal__dot--warn { background: var(--warn-600); }
.cal-events__title { font-size: 1.2rem; margin-bottom: 16px; }
.cal-event { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; margin-bottom: 12px; cursor: pointer; transition: all .14s ease; }
.cal-event:hover { border-color: var(--brand-300); }
.cal-event.is-sel { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-100); }
.cal-event__date { width: 56px; height: 56px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-700); }
.cal-event__date--info { background: var(--info-100); color: var(--info-600); } .cal-event__date--gold { background: var(--gold-100); color: var(--gold-700); } .cal-event__date--warn { background: var(--warn-100); color: var(--warn-600); }
.cal-event__day { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.cal-event__mon { font-size: .72rem; font-family: var(--font-head); }
.cal-event__title { font-size: 1.04rem; line-height: 1.35; }
.cal-event__meta { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; font-size: .86rem; color: var(--ink-500); }
.cal-event__meta span { display: inline-flex; align-items: center; gap: 6px; }
.cal-event__meta .icon { color: var(--brand-500); }

/* ================= CONTACT ================= */
.contact-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }
.contact-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.contact-tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: #fff; font-family: var(--font-head); font-weight: 600; font-size: .98rem; color: var(--ink-700); }
.contact-tab.is-active { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.contact-form { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-size: .98rem; color: var(--ink-800); cursor: pointer; }
.checkbox-row input { width: 20px; height: 20px; accent-color: var(--brand-600); }
.sent-card { padding: 40px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-aside { display: flex; flex-direction: column; gap: 18px; }
.contact-hotline { display: flex; align-items: center; gap: 16px; padding: 22px; border-right: 5px solid var(--emergency); }
.contact-hotline__ic { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--emergency); color: #fff; }
.contact-hotline__label { font-size: .88rem; color: var(--ink-500); }
.contact-hotline__num { font-family: var(--font-head); font-weight: 800; font-size: 2rem; color: var(--emergency-dark); line-height: 1.1; }
.contact-info-card { padding: 22px; }
.contact-info { display: flex; flex-direction: column; gap: 14px; }
.contact-info li { display: flex; gap: 12px; align-items: flex-start; font-size: .96rem; color: var(--ink-700); line-height: 1.5; }
.contact-info .icon { color: var(--brand-600); flex: none; margin-top: 2px; }
.contact-social { display: flex; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.contact-social a { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); }
.contact-social a:hover { background: var(--brand-700); color: #fff; }
.contact-map { padding: 0; overflow: hidden; }
.contact-map__placeholder { aspect-ratio: 16/10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(160deg, #eef7f2, #def0e7); color: var(--brand-600); font-family: var(--font-head); font-weight: 600; }

/* ================= ABOUT ================= */
.about-intro { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; margin-bottom: 44px; }
.about-intro__img { width: 100%; aspect-ratio: 4/3; --is-bg: var(--brand-100); }
.vmv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 48px; }
.vmv-card { padding: 28px; text-align: center; }
.vmv-card__ic { width: 60px; height: 60px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-600); }
.vmv-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.org-section { margin-bottom: 44px; }
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.dir-card { padding: 28px; text-align: center; }
.dir-card__photo { width: 120px; height: 120px; margin: 0 auto 16px; --is-bg: var(--brand-100); }
.dir-card__name { font-size: 1.14rem; margin-bottom: 4px; }
.dir-card__role { font-size: .94rem; }
.stats-band--inline { border-radius: var(--r-xl); overflow: hidden; }
.stats-band--inline .stats-grid { padding-block: 36px; }

/* ================= LOGIN ================= */
.login-page { min-height: 70vh; display: grid; place-items: center; padding: clamp(30px, 6vw, 70px) var(--gutter); }
.login-card { width: 100%; max-width: 440px; padding: 40px; text-align: center; position: relative; }
.login-back { position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--ink-500); font-family: var(--font-head); font-weight: 600; font-size: .9rem; }
.login-back:hover { color: var(--brand-700); }
.login-card .logo-mark { margin: 0 auto; }
.login-title { font-size: 1.5rem; margin-top: 16px; }
.login-sub { margin-top: 6px; }
.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 26px; text-align: right; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .92rem; }
.login-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; padding: 14px 16px; background: var(--brand-50); border-radius: var(--r-md); font-size: .88rem; color: var(--brand-700); text-align: right; }
.login-note .icon { flex: none; margin-top: 2px; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1080px) {
  .netmap-layout { grid-template-columns: 1fr; }
  .netmap-aside { position: static; }
  .facility-list { max-height: 280px; }
  .article-wrap { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .ita-grid { grid-template-columns: 1fr; }
  .cal-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .about-intro { grid-template-columns: 1fr; }
  .vmv-grid, .dir-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .news-grid { grid-template-columns: 1fr; }
  .facility-detail__grid { grid-template-columns: 1fr; }
  .doc-row { flex-wrap: wrap; }
  .doc-row__btn { width: 100%; }
  .contact-tabs { flex-direction: column; }
}
