:root {
  --forest: #143628;
  --forest-mid: #245c45;
  --moss: #3a7d5c;
  --sage: #e8f1ec;
  --sage-border: #c5dbce;
  --terracotta: #b85d3b;
  --terracotta-deep: #944528;
  --terracotta-light: #faece6;
  --bg: #faf9f5;
  --surface: #ffffff;
  --ink: #1a211d;
  --muted: #525e57;
  --border: #e1e3dc;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 2px 8px rgba(20, 54, 40, 0.05);
  --shadow: 0 10px 28px rgba(20, 54, 40, 0.08);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

h1, h2, h3, h4, .serif {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  color: var(--forest);
  letter-spacing: -0.015em;
}

section[id] {
  scroll-margin-top: 84px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* =========================================================
   Topbar & Header
   ========================================================= */
.topbar {
  background: var(--forest);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  padding: 7px 0;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-link {
  color: #f6cdb9;
  font-weight: 600;
}

.topbar-link:hover {
  text-decoration: underline;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--forest);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-weight: 800;
  font-size: 0.98rem;
  border: 2px solid var(--terracotta);
}

.brand-text strong {
  display: block;
  font-size: 1.04rem;
  color: var(--forest);
}

.brand-text span {
  display: block;
  font-size: 0.77rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-links a:not(.nav-admin) {
  color: var(--ink);
  padding: 6px 2px;
  transition: color 0.18s var(--ease);
}

.nav-links a:not(.nav-admin):hover {
  color: var(--terracotta);
}

.nav-admin {
  padding: 7px 14px;
  border-radius: 4px;
  background: var(--sage);
  color: var(--forest);
  border: 1px solid var(--sage-border);
  font-weight: 600;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-admin:hover {
  background: var(--forest);
  color: #fff;
}

.menu-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--forest);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.btn-primary {
  background: var(--forest);
  color: #fff;
}

.btn-primary:hover {
  background: var(--forest-mid);
}

.btn-terracotta {
  background: var(--terracotta);
  color: #fff;
}

.btn-terracotta:hover {
  background: var(--terracotta-deep);
}

.btn-outline {
  background: var(--surface);
  color: var(--forest);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--sage);
  border-color: var(--forest-mid);
}

.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.btn.is-loading { opacity: 0.7; pointer-events: none; }

/* =========================================================
   Portal Top Grid
   ========================================================= */
.portal-hero {
  padding: 26px 0 22px;
  background: var(--bg);
}

.portal-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 22px;
  align-items: stretch;
}

.portal-grid > *,
.history-layout > *,
.feedback-layout > *,
.map-grid > * {
  min-width: 0;
}

.featured-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.featured-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--forest);
}

.featured-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-caption-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 18px;
  background: linear-gradient(180deg, transparent, rgba(20, 54, 40, 0.88));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.featured-body {
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.featured-kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--terracotta);
  margin-bottom: 8px;
}

.featured-body h1 {
  font-size: clamp(1.48rem, 2.35vw, 2rem);
  margin-bottom: 10px;
}

.featured-body p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
}

.latest-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.latest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--forest);
}

.latest-head h2 {
  font-size: 1.08rem;
  margin: 0;
}

.latest-all-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--terracotta);
}

.latest-all-link:hover {
  text-decoration: underline;
}

.latest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.latest-item {
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
  cursor: pointer;
}

.latest-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.latest-item:hover h3 {
  color: var(--forest-mid);
}

.latest-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 5px;
}

.latest-item h3 {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.42;
  margin: 0 0 4px;
  color: var(--ink);
  transition: color 0.15s ease;
}

.latest-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Quick Facts Strip */
.stats-strip {
  padding: 6px 0 30px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--forest);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.stat-box:hover {
  box-shadow: var(--shadow);
  border-color: var(--moss);
}

.stat-box:nth-child(even) {
  border-left-color: var(--terracotta);
}

.stat-value {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--forest);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.84rem;
  color: var(--muted);
}

/* =========================================================
   Sections & Headings
   ========================================================= */
section {
  padding: 54px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

section.section-alt {
  background: var(--bg);
}

.section-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title-group {
  border-left: 4px solid var(--terracotta);
  padding-left: 14px;
}

.eyebrow {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  margin-bottom: 4px;
}

.section-title-group h2 {
  font-size: clamp(1.38rem, 2.2vw, 1.82rem);
  margin: 0;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 58ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--sage);
  color: var(--forest);
  border: 1px solid var(--sage-border);
}

.tag-earth {
  background: var(--terracotta-light);
  color: var(--terracotta-deep);
  border-color: rgba(184, 93, 59, 0.28);
}

.pin-badge {
  background: var(--terracotta-light);
  color: var(--terracotta-deep);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 0.72rem;
  border: 1px solid rgba(184, 93, 59, 0.25);
}

/* =========================================================
   News Board
   ========================================================= */
.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.pill-btn {
  padding: 9px 14px;
  border-radius: 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.pill-btn:hover {
  color: var(--forest);
}

.pill-btn.active {
  color: var(--forest);
  border-bottom-color: var(--forest);
}

.search-input {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 0.9rem;
  min-width: 240px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.post-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.post-card-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sage);
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.post-card:hover .post-card-cover img {
  transform: scale(1.03);
}

.post-photo-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 3px;
  background: rgba(20, 54, 40, 0.88);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
}

.post-card-inner {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.post-card:hover {
  border-color: var(--moss);
  box-shadow: var(--shadow);
}

.post-card.is-pinned {
  border-left: 4px solid var(--terracotta);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.post-card h3 {
  font-size: 1.06rem;
  margin-bottom: 8px;
}

.post-card p {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.read-more {
  color: var(--forest-mid);
  font-weight: 600;
  font-size: 0.86rem;
}

/* =========================================================
   History & Merge Layout
   ========================================================= */
.history-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 24px;
  align-items: start;
}

.predecessors-grid {
  display: grid;
  gap: 18px;
}

.place-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px 1fr;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.place-card:hover {
  border-color: var(--moss);
  box-shadow: var(--shadow);
}

.place-media {
  height: 100%;
  min-height: 170px;
  overflow: hidden;
  background: var(--sage);
}

.place-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.place-card:hover .place-media img {
  transform: scale(1.04);
}

.place-body {
  padding: 18px 20px;
}

.place-body h3 {
  font-size: 1.1rem;
  margin: 8px 0 6px;
}

.place-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.merge-banner {
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 22px;
  border-left: 5px solid var(--terracotta);
}

.merge-banner h3 {
  color: #fff;
  font-size: 1.06rem;
  margin-bottom: 6px;
}

.merge-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 28px;
  display: grid;
  gap: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: var(--sage-border);
}

.timeline-item {
  position: relative;
}

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--forest-mid);
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

.timeline-year {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--terracotta-deep);
  background: var(--terracotta-light);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.timeline-card h3 {
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.timeline-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* =========================================================
   Photo Feature Cards (Kinh tế – Giáo dục – Cảnh quan)
   ========================================================= */
.feature-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.photo-card:hover {
  border-color: var(--moss);
  box-shadow: var(--shadow);
}

.card-link-hint {
  margin-top: auto;
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest-mid);
}

.featured-media[data-post-id],
.featured-body h1[data-post-id] {
  cursor: pointer;
}

.modal-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 12px 0 14px;
  display: none;
}

.modal-image.show {
  display: block;
}

.photo-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--sage);
}

.photo-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.photo-card:hover .photo-media img {
  transform: scale(1.04);
}

.photo-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(20, 54, 40, 0.88);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.photo-body {
  padding: 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.photo-body h3 {
  font-size: 1.12rem;
  margin-bottom: 8px;
}

.photo-body p {
  margin: 0 0 12px;
  font-size: 0.91rem;
  color: var(--muted);
}

/* =========================================================
   FAQ Accordion
   ========================================================= */
.faq-list {
  display: grid;
  gap: 12px;
  max-width: 920px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item.open {
  border-color: var(--forest-mid);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  padding: 16px 20px;
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--forest);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.faq-icon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--sage);
  color: var(--forest);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.25s var(--ease);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--forest);
  color: #fff;
}

.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s var(--ease);
}

.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
}

.faq-answer-inner {
  overflow: hidden;
}

.faq-answer-content {
  padding: 12px 20px 16px;
  font-size: 0.91rem;
  color: var(--muted);
  border-top: 1px dashed var(--border);
}

/* =========================================================
   Feedback Form & Map / Contact
   ========================================================= */
.feedback-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 24px;
  align-items: start;
}

.feedback-pledge {
  background: var(--forest);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px;
  border-left: 5px solid var(--terracotta);
}

.feedback-pledge h3 {
  color: #fff;
  margin-bottom: 8px;
}

.feedback-pledge p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.feedback-highlights {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
}

.feedback-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--forest);
  margin-bottom: 5px;
}

.required { color: var(--danger); }

.form-control,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
}

.form-textarea {
  min-height: 110px;
  resize: vertical;
}

.form-hint {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
}

.form-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 14px;
  display: none;
}

.form-alert.show { display: block; }
.form-alert.success { background: var(--sage); color: var(--forest); border: 1px solid var(--sage-border); }
.form-alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; }

.map-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 22px;
  align-items: start;
}

#local-map {
  width: 100%;
  min-height: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #e9efe9;
  overflow: hidden;
  z-index: 1;
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 12px;
}

.contact-list li {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.9rem;
}

.contact-list li:last-child { border-bottom: none; padding-bottom: 0; }
.contact-list strong { display: block; color: var(--forest); margin-bottom: 2px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 54, 40, 0.62);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.modal-backdrop.open { display: grid; }

.modal-panel {
  width: min(840px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.modal-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#copyPostLinkBtn {
  white-space: nowrap;
  flex-shrink: 0;
}

.modal-close {
  border: 1px solid var(--border);
  background: var(--bg);
  width: 34px;
  height: 34px;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-body {
  white-space: pre-line;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  margin-top: 16px;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}

.modal-gallery.single {
  grid-template-columns: 1fr;
}

.modal-gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.2s var(--ease);
}

.modal-gallery.single img {
  height: auto;
  max-height: 380px;
}

.modal-gallery img:hover {
  transform: scale(1.015);
}

/* Lightbox phóng to ảnh */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 16, 0.92);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 140;
}

.lightbox-backdrop.open {
  display: grid;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 84vh;
  border-radius: 10px;
  object-fit: contain;
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
}

/* Upload & Admin Editor Grid */
.upload-dropzone {
  border: 2px dashed var(--sage-border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--forest-mid);
  background: var(--sage);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.upload-preview-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.upload-preview-item img {
  width: 100%;
  height: 86px;
  object-fit: cover;
}

.upload-preview-actions {
  display: flex;
  justify-content: space-between;
  padding: 4px 6px;
  background: #fff;
  font-size: 0.72rem;
}

.upload-preview-actions button {
  border: none;
  background: none;
  cursor: pointer;
  padding: 2px 4px;
  font: inherit;
  font-weight: 600;
}

/* Footer */
footer {
  background: var(--forest);
  color: rgba(255, 255, 255, 0.88);
  padding: 28px 0;
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Admin compatibility */
.admin-nav-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.admin-home-link { font-size: 0.9rem; font-weight: 600; color: var(--forest); padding: 6px 2px; }
.admin-home-link:hover { color: var(--terracotta); }
.admin-wrap { padding: 36px 0 64px; }
.login-box { max-width: 420px; margin: 48px auto; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; align-items: start; }
.admin-post-item { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #fff; margin-bottom: 12px; }
.admin-post-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.status-msg { padding: 10px 14px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 14px; display: none; }
.status-msg.show { display: block; }
.status-ok { background: var(--sage); color: var(--forest); border: 1px solid var(--sage-border); }
.status-err { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecdca; }
.tab-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab-btn { padding: 10px 16px; border-radius: 0; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; margin-bottom: -1px; }
.tab-btn:hover { color: var(--forest); }
.tab-btn.active { background: transparent; color: var(--forest); border-bottom-color: var(--forest); }
.badge-status { padding: 2px 8px; border-radius: 3px; font-size: 0.74rem; font-weight: 700; }
.badge-new { background: #fdebd3; color: #8c4a08; }
.badge-processing { background: #e0f2fe; color: #075985; }
.badge-resolved { background: var(--sage); color: var(--forest); }

@media (max-width: 960px) {
  .portal-grid,
  .history-layout,
  .feedback-layout,
  .map-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .topbar { padding: 4px 0; }
  .topbar-addr { display: none; }
  .topbar-right { width: 100%; justify-content: space-between; font-size: 0.78rem; }
  .topbar-link { display: inline-block; padding: 6px 0; }
  .menu-toggle { display: inline-block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 14px 4%;
    align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .featured-body { padding: 18px 18px 20px; }
  .featured-caption-bar { font-size: 0.76rem; padding: 10px 12px; }
  .featured-actions .btn { flex: 1 1 auto; }
  .modal-backdrop { padding: 10px; }
  .modal-panel { padding: 18px 16px; }
  .modal-header-actions { align-items: flex-start; }
  .tab-btn { flex: 0 1 auto; text-align: left; padding: 9px 12px; font-size: 0.84rem; }
  .place-card { grid-template-columns: 1fr; }
  .place-media { min-height: 190px; }
  .stats-grid,
  .feature-photo-grid,
  .news-grid,
  .form-row {
    grid-template-columns: 1fr;
  }
  .search-input {
    min-width: 0;
    width: 100%;
  }
}
