/* Trang công khai. Không dùng style nội tuyến (CSP style-src 'self'). */
:root {
  --site-primary: #0b4f8a;
  --site-primary-dark: #083a66;
  --site-accent: #c8102e;
  --site-surface: #f4f6f9;
  --site-text: #1d2733;
  --site-focus: #f5b301;
}

body.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: var(--site-text);
  background: var(--site-surface);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: #fff;
  color: var(--site-primary-dark);
  border: 2px solid var(--site-primary);
  border-radius: 0.25rem;
}

.skip-link:focus {
  top: 1rem;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--site-focus);
  outline-offset: 2px;
  box-shadow: none;
}

.site-topbar {
  background: var(--site-primary-dark);
  color: #fff;
  font-size: 0.875rem;
}

.site-topbar .nav-link,
.site-topbar .btn-link {
  color: #fff !important;
}

.site-brand {
  background: var(--site-primary);
  color: #fff;
  padding: 1rem 0;
  border-bottom: 4px solid var(--site-accent);
}

.site-brand__title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
}

.site-brand__title:hover {
  color: #fff;
  text-decoration: underline;
}

.site-search {
  display: flex;
  gap: 0.5rem;
  min-width: min(100%, 22rem);
}

.site-nav {
  background: #fff;
  border-bottom: 1px solid #dde3ea;
}

.site-nav .nav-link {
  color: var(--site-primary-dark);
  font-weight: 600;
}

.site-nav .nav-link.active {
  color: var(--site-accent);
  border-bottom: 3px solid var(--site-accent);
}

.site-main {
  flex: 1 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.site-main:focus {
  outline: none;
}

.site-footer {
  background: var(--site-primary-dark);
  color: #e8eef5;
  padding: 1.5rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: #fff;
}

.site-footer__name {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.site-footer__copy {
  margin-top: 0.75rem;
  opacity: 0.8;
}

.home-intro {
  background: #fff;
  border-left: 4px solid var(--site-primary);
  padding: 1.5rem;
  border-radius: 0.25rem;
}

/* ===== Nội dung tin bài (Giai đoạn kiểm chứng) ===== */
.section-title { font-size: 1.15rem; font-weight: 700; color: var(--bs-primary); border-bottom: 2px solid var(--bs-primary); padding-bottom: .35rem; margin: 0 0 1rem; }
.page-title { font-size: 1.6rem; margin-bottom: 1rem; }
.article-list__item { display: flex; gap: .9rem; padding: .75rem 0; border-bottom: 1px solid var(--bs-border-color); }
.article-list__thumb { flex: 0 0 9rem; }
.article-list__thumb img { width: 9rem; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .25rem; }
.article-list__title { font-size: 1.05rem; margin: 0 0 .25rem; line-height: 1.35; }
.article-list__title a { text-decoration: none; }
.article-list__title a:hover, .article-list__title a:focus-visible { text-decoration: underline; }
.article-list__meta { font-size: .85rem; color: var(--bs-secondary-color); margin-bottom: .25rem; }
.article-list__excerpt { margin: 0; font-size: .95rem; }
@media (max-width: 575.98px) { .article-list__thumb { flex-basis: 6.5rem; } .article-list__thumb img { width: 6.5rem; } }
.home-featured__lead { margin-bottom: 1rem; }
.home-featured__image { width: 100%; max-height: 22rem; object-fit: cover; border-radius: .375rem; margin-bottom: .5rem; }
.home-featured__title { font-size: 1.35rem; }
.article__title { font-size: 1.75rem; line-height: 1.3; }
.article__meta { color: var(--bs-secondary-color); font-size: .9rem; }
.article__body { font-size: 1.05rem; line-height: 1.7; overflow-wrap: anywhere; }
.article__body img { max-width: 100%; height: auto; }
.article__body iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; }
.article__body table { max-width: 100%; }
.article__body .table-responsive { margin-bottom: 1rem; }
.article__body td, .article__body th { padding: .25rem .5rem; vertical-align: top; }
.article__files { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--bs-border-color); }
.related { margin-top: 2rem; }
.sidebar-box { background: #fff; border: 1px solid var(--bs-border-color); border-radius: .375rem; padding: .9rem 1rem; margin-bottom: 1rem; }
.sidebar-box__title { font-size: 1rem; font-weight: 700; color: var(--bs-primary); margin-bottom: .6rem; }
.sidebar-box__html img { max-width: 100%; height: auto; }
.sidebar-links li { padding: .3rem 0; border-bottom: 1px dashed var(--bs-border-color); }
.sidebar-links li:last-child { border-bottom: 0; }
.link-list summary { cursor: pointer; }

/* Menu chính nhiều mục cấp 1 (nhập từ Joomla): không ngắt dòng tên mục */
.site-nav .nav-link { white-space: nowrap; }
.site-nav .navbar-nav { flex-wrap: wrap; }

/* Bảng văn bản: màn hình hẹp hiển thị mỗi dòng thành một khối, nhãn cột lấy từ data-label. */
.doc-table__no { width: 3.5rem; text-align: center; }
.doc-table__number { width: 10rem; }
.doc-table__date { width: 8.5rem; text-align: center; white-space: nowrap; }
.doc-table__download { display: inline-block; margin-left: .5rem; font-size: .875rem; }
.document-detail__meta dt { font-weight: 600; }
@media (max-width: 575.98px) {
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table tr { border-bottom: 2px solid var(--site-surface); padding: .25rem 0; }
  .doc-table td { border: 0; text-align: left; width: auto; padding: .2rem .5rem; }
  .doc-table td::before { content: attr(data-label) ": "; font-weight: 600; }
  .doc-table td.doc-table__no { display: none; }
}

/* Góp ý dự thảo: nội dung người dân gửi là văn bản thuần (đã mã hóa HTML), giữ xuống dòng. */
.draft-feedback__item { border-bottom: 1px solid var(--site-surface); padding: .75rem 0; }
.draft-feedback__content { white-space: pre-line; overflow-wrap: anywhere; }
.alert.validation-summary-valid { display: none; }

/* Lịch công tác: nhóm theo ngày; văn bản thuần (đã mã hóa HTML) giữ xuống dòng. */
.ws-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.ws-print-title { display: none; }
.ws-table__time { width: 9rem; white-space: nowrap; text-align: center; }
.ws-text { white-space: pre-line; overflow-wrap: anywhere; }
.ws-day__heading th { background: var(--site-surface, #f1f4f8); font-weight: 700; }
@media (max-width: 575.98px) {
  .ws-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ws-table, .ws-table tbody, .ws-table tr, .ws-table th, .ws-table td { display: block; width: 100%; }
  .ws-table tr { border-bottom: 2px solid var(--site-surface, #e5e9ef); padding: .25rem 0; }
  .ws-table td { border: 0; text-align: left; width: auto; padding: .2rem .5rem; }
  .ws-table td::before { content: attr(data-label) ": "; font-weight: 600; }
  .ws-table td:empty { display: none; }
  .ws-table__time { width: auto; }
}
@media print {
  body:has(.ws) .site-header, body:has(.ws) .site-footer, body:has(.ws) .breadcrumb, body:has(.ws) .skip-link, .ws-nav, .ws .page-title { display: none !important; }
  .ws-print-title { display: block; font-size: 14pt; font-weight: 700; text-align: center; margin-bottom: .5rem; }
  .ws-table { font-size: 10.5pt; }
  .ws-table, .ws-table th, .ws-table td { border: 1px solid #000 !important; }
  .ws-day { break-inside: avoid; }
}

/* Hỏi đáp: câu hỏi là văn bản thuần (đã mã hóa HTML) giữ xuống dòng; danh sách dạng <details> như accordion của hệ cũ. */
.qa-item { border: 1px solid var(--site-surface, #e3e8ef); border-radius: .375rem; margin-bottom: .5rem; }
.qa-item > summary { cursor: pointer; padding: .75rem 1rem; font-weight: 600; list-style-position: inside; }
.qa-item[open] > summary { border-bottom: 1px solid var(--site-surface, #e3e8ef); }
.qa-item__body { padding: .75rem 1rem; }
.qa-question { white-space: pre-line; overflow-wrap: anywhere; }
.qa-answer { border-left: 4px solid var(--site-primary, #0b5394); padding-left: 1rem; margin-top: .75rem; }

/* Thư viện ảnh / video: lưới thẻ tự co theo bề rộng; ảnh giữ tỉ lệ cố định để trang không nhảy khi ảnh tải lười. */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 1rem; margin: 0 0 1rem; }
.media-card { display: flex; flex-direction: column; gap: .25rem; }
.media-card__link { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; }
.media-card__link:hover .media-card__title, .media-card__link:focus .media-card__title { text-decoration: underline; }
.media-card__thumb { display: block; aspect-ratio: 4 / 3; background: var(--site-surface, #e3e8ef); border-radius: .375rem; overflow: hidden; }
.media-card__thumb--video { aspect-ratio: 16 / 9; position: relative; }
.media-card__thumb--video::after { content: "▶"; position: absolute; inset: auto auto .5rem .5rem; padding: .1rem .5rem; border-radius: .25rem; background: rgba(0, 0, 0, .65); color: #fff; font-size: .85rem; }
.media-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card__title { font-weight: 600; color: var(--site-primary, #0b5394); }
.media-card__meta { font-size: .85rem; color: #6c757d; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: .75rem; margin: 1rem 0; }
.photo-grid__item a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: .25rem; background: var(--site-surface, #e3e8ef); }
.photo-grid__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid__caption { font-size: .85rem; margin-top: .25rem; overflow-wrap: anywhere; }
.photo-viewer { width: min(100vw - 1rem, 72rem); max-height: calc(100vh - 1rem); padding: .75rem; border: 0; border-radius: .5rem; background: #111; color: #fff; }
.photo-viewer::backdrop { background: rgba(0, 0, 0, .8); }
.photo-viewer__toolbar, .photo-viewer__nav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.photo-viewer__figure { text-align: center; margin: .5rem 0; }
.photo-viewer__figure img { max-width: 100%; max-height: calc(100vh - 10rem); object-fit: contain; }
.photo-viewer__caption { margin-top: .5rem; font-size: .9rem; overflow-wrap: anywhere; }
.video-detail__player { background: #000; border-radius: .375rem; overflow: hidden; }
.video-detail__player video { width: 100%; height: 100%; }

/* Khảo sát: mỗi câu hỏi một fieldset; thanh tỉ lệ ở trang kết quả chỉ để minh họa (số liệu nằm trong bảng). */
.survey-list__item { padding: .75rem 0; border-bottom: 1px solid var(--site-surface, #e3e8ef); }
.survey-question { border: 1px solid var(--site-surface, #e3e8ef); border-radius: .375rem; padding: .75rem 1rem; margin-bottom: .75rem; }
.survey-question--invalid { border-color: #dc3545; }
.survey-question__legend { float: none; width: auto; font-size: 1rem; font-weight: 600; margin-bottom: .5rem; overflow-wrap: anywhere; }
.survey-question__number { color: var(--site-primary, #0b5394); }
.survey-receipt dt { font-weight: 600; margin-top: .5rem; overflow-wrap: anywhere; }
.survey-receipt dd { margin-left: 1rem; }
.survey-result { margin-bottom: 1.25rem; }
.survey-result__bar-col { width: 35%; min-width: 6rem; }
.survey-result__bar { display: block; height: .75rem; min-width: 1px; border-radius: .25rem; background: var(--site-primary, #0b5394); }
