/* ============================================
   Cổng VHXH xã Yên Lãng — Design System
   ============================================ */
:root {
  --primary: #0c2d4a;
  --primary-light: #1a4a6e;
  --accent: #c41e3a;
  --accent-dark: #9a1830;
  --gold: #d4a017;
  --gold-light: #f0c75a;
  --success: #2d6a4f;
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --text: #1a2332;
  --text-muted: #5a6a7e;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(12, 45, 74, 0.08);
  --shadow-lg: 0 12px 48px rgba(12, 45, 74, 0.15);
  --radius: 12px;
  --radius-lg: 20px;
  --font: 'Be Vietnam Pro', system-ui, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Top Bar ---- */
.top-bar {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  padding: 6px 0;
}

.top-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-bar__left { display: flex; gap: 12px; align-items: center; }
.top-bar__left .sep { opacity: 0.4; }
.top-bar__right { display: flex; gap: 8px; align-items: center; }

.top-bar__btn {
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 6px;
  transition: var(--transition);
}

.top-bar__btn:hover { background: rgba(255,255,255,0.1); }
.top-bar__btn--accent {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.top-bar__btn--accent:hover { background: var(--accent-dark); }

/* ---- Header ---- */
.header {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.header.scrolled { box-shadow: var(--shadow-lg); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.brand__emblem {
  width: 56px;
  height: 56px;
  color: var(--accent);
  flex-shrink: 0;
}

.brand__emblem svg { width: 100%; height: 100%; }

.brand__unit {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.brand__title {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.brand__slogan {
  display: block;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
}

/* ---- Navigation ---- */
.nav__list {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav__link {
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav__link:hover,
.nav__link.active {
  background: rgba(12, 45, 74, 0.08);
  color: var(--primary);
}

.nav__link--highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff !important;
  font-weight: 600;
}

.nav__link--highlight:hover {
  background: linear-gradient(135deg, var(--accent-dark), #7a1228);
  transform: translateY(-1px);
}

.nav__item--dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
  z-index: 100;
}

.nav__item--dropdown:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  color: var(--text);
  transition: var(--transition);
}

.dropdown a:hover {
  background: var(--bg);
  color: var(--primary);
}

.dropdown__item { position: relative; }
.dropdown__item--has-flyout > .dropdown__parent {
  display: block;
  padding: 10px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
  color: var(--text);
  cursor: default;
  font-weight: 600;
}
.dropdown__item--has-flyout:hover > .dropdown__parent {
  background: var(--bg);
  color: var(--primary);
}
.dropdown--flyout {
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 4px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
}
.dropdown__item--has-flyout:hover .dropdown--flyout {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(196, 30, 58, 0.35);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(196, 30, 58, 0.45);
}

.btn--outline {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}

.btn--outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: #fff;
}

.btn--outline-light {
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.btn--outline-light:hover { background: rgba(255,255,255,0.1); }

.btn--incense {
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  width: 100%;
  transition: var(--transition);
}

.btn--incense:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212, 160, 23, 0.4); }

.btn--full { width: 100%; }

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: clamp(500px, 56vw, 680px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding-bottom: 56px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background: #061018;
}

.hero__bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: brightness(0.58) saturate(0.9);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(4, 10, 20, 0.98) 0%, rgba(4, 10, 20, 0.9) 32%, rgba(4, 10, 20, 0.62) 58%, rgba(4, 10, 20, 0.42) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 24px 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__intro {
  max-width: 720px;
}

.hero__badge {
  display: inline-block;
  background: rgba(212, 160, 23, 0.24);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.05em;
}

.hero__title {
  font-size: clamp(1.65rem, 3.6vw, 2.6rem);
  font-weight: 800;
  line-height: 1.28;
  margin: 0 0 14px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.65);
}

.hero__title span {
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.55));
}

.hero__desc {
  font-size: clamp(0.92rem, 1.6vw, 1.02rem);
  opacity: 0.98;
  max-width: 620px;
  margin: 0;
  line-height: 1.7;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
}

.hero__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 12px 28px;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  max-width: 640px;
}

.stat { text-align: left; }

.stat__num {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1.1;
  margin-bottom: 4px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.stat__label {
  font-size: 0.8rem;
  opacity: 0.92;
  line-height: 1.35;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

/* ---- Utilities ---- */
.utilities {
  margin-top: -24px;
  position: relative;
  z-index: 10;
  padding-bottom: 48px;
}

.utilities__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.utility-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 12px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.utility-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.utility-card--featured {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  border-color: transparent;
}

.utility-card--featured:hover { box-shadow: 0 12px 40px rgba(196, 30, 58, 0.35); }

.utility-card__icon { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.utility-card__title { font-size: 0.78rem; font-weight: 600; line-height: 1.3; }

/* ---- Section common ---- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-header--center {
  flex-direction: column;
  text-align: center;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
}

.section-title--light { color: #fff; }

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 8px;
}

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }

.tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.tab.active,
.tab:hover {
  background: var(--primary);
  color: #fff;
}

.tag {
  display: inline-block;
  background: rgba(196, 30, 58, 0.1);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tag--small { font-size: 0.7rem; padding: 2px 8px; }

/* ---- News ---- */
.news-section { padding: 64px 0; }

.news-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.news-featured {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.news-featured__img {
  height: 220px;
  position: relative;
  overflow: hidden;
  background: #eef4fa;
}

.news-featured__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-featured__body { padding: 24px; }

.news-featured__body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 12px 0;
  line-height: 1.4;
  color: var(--primary);
}

.news-featured__body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.news-featured__body time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.news-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.news-item {
  padding: 14px 16px;
  border-radius: 10px;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
}

.news-item:last-child { border-bottom: none; }

.news-item:hover { background: var(--bg); }

.news-item time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.news-item h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 4px 0;
  line-height: 1.4;
}

.news-item h4 a:hover { color: var(--accent); }

/* ---- Departments ---- */
.departments {
  padding: 64px 0;
  background: linear-gradient(180deg, var(--bg) 0%, #e8edf3 100%);
}

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

.dept-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.dept-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: var(--transition);
}

.dept-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.dept-card:hover::before { transform: scaleX(1); }

.dept-card--accent {
  background: linear-gradient(135deg, #1a0a0a, #3d1515);
  color: #fff;
  border-color: var(--accent);
}

.dept-card--accent::before { background: var(--gold); }

.dept-card__icon { font-size: 2rem; margin-bottom: 12px; }

.dept-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.dept-card p {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-bottom: 16px;
  line-height: 1.5;
}

.dept-card__links li {
  font-size: 0.78rem;
  padding: 4px 0;
  opacity: 0.7;
  position: relative;
  padding-left: 14px;
}

.dept-card__links li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.dept-card--accent .dept-card__links li::before { color: var(--gold); }

.dept-card__cta {
  display: inline-block;
  margin-top: 12px;
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
}

.dept-card__cta:hover { color: #fff; }

/* ---- Leadership ---- */
.leadership { padding: 64px 0; }

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

.leader-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.leader-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.leader-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border: 3px solid var(--gold);
}

.leader-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

.leader-card__role {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  margin: 4px 0;
}

.leader-card__field {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.leader-card__contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.leader-card__avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  border: 3px solid var(--gold);
}

.leader-card__bio {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 8px 0;
  text-align: center;
}

.leader-card__bio--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.leader-card__more {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
}

.leader-card__more:hover { text-decoration: underline; }

.public-org-chart {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
  width: 100%;
}

.public-org-chart__root {
  width: 100%;
  max-width: 960px;
  display: flex;
  justify-content: center;
}

.public-org-chart__group {
  text-align: center;
  width: 100%;
}

.public-org-chart__group-title {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.public-org-chart__children {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
}

/* Cấp gốc: Trưởng phòng trên, nhóm Phó phòng full-width bên dưới */
.public-org-chart > .public-org-chart__root > .public-org-chart__group > .public-org-chart__children {
  flex-direction: column;
  align-items: center;
}

.public-org-chart > .public-org-chart__root > .public-org-chart__group > .public-org-chart__children > .public-org-chart__branch {
  flex: 0 1 auto;
  width: 100%;
  max-width: 280px;
}

.public-org-chart > .public-org-chart__root > .public-org-chart__group > .public-org-chart__children > .public-org-chart__branch:has(> .public-org-chart__group) {
  max-width: 960px;
}

/* Nhóm con (vd. Phó Trưởng phòng): lưới thẻ ngang */
.public-org-chart__group .public-org-chart__group > .public-org-chart__children {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  justify-items: center;
  width: 100%;
}

.public-org-chart__branch {
  flex: 0 1 260px;
  width: 100%;
  max-width: 280px;
}

.public-org-chart__group .public-org-chart__group .public-org-chart__branch {
  flex: unset;
  max-width: none;
}

.public-org-chart__branch .leader-card {
  height: 100%;
}

.leader-modal__head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.leader-modal__head .leader-card__avatar,
.leader-modal__head .leader-card__avatar-img {
  margin: 0;
  flex-shrink: 0;
}

.leader-modal__bio {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
}

.intro-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.intro-block__resolution,
.intro-block__functions {
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 12px;
}

.intro-block__file { margin-top: 8px; }

.grave-map-modal__directions {
  margin-right: auto;
  margin-left: 12px;
}

/* ---- Martyrs Section ---- */
.martyrs {
  background: #0d1117;
  color: #e8eaed;
}

.martyrs__header {
  padding: 64px 0 32px;
  background: linear-gradient(180deg, #1a0a0a 0%, #0d1117 100%);
  border-bottom: 1px solid rgba(196, 30, 58, 0.3);
}

.martyrs__badge {
  display: inline-block;
  background: rgba(196, 30, 58, 0.2);
  border: 1px solid var(--accent);
  color: #ff8a9b;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.martyrs__title-wrap p {
  opacity: 0.7;
  font-size: 0.95rem;
  margin-top: 8px;
}

.martyrs__body { padding: 40px 24px 64px; }

.martyrs__layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

.martyrs-search {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
}

.martyrs-search h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--gold-light);
}

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

.search-form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.8;
}

.search-form input,
.search-form select,
.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition);
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

.search-form input:focus,
.search-form select:focus,
.feedback-form input:focus,
.feedback-form select:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.2);
}

.search-form select option { background: #1a2332; color: #fff; }

.search-results {
  margin-top: 16px;
  max-height: 200px;
  overflow-y: auto;
}

.search-result-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  margin-bottom: 6px;
}

.search-result-item:hover {
  background: rgba(196, 30, 58, 0.15);
  border-color: rgba(196, 30, 58, 0.3);
}

.search-result-item strong { color: var(--gold-light); font-size: 0.85rem; }
.search-result-item span { font-size: 0.75rem; opacity: 0.6; display: block; }

.martyrs-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.visit-messages {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.visit-messages h4 {
  font-size: 0.88rem;
  color: var(--gold-light);
  margin-bottom: 12px;
  font-weight: 700;
}

.visit-messages__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.visit-messages__empty {
  font-size: 0.78rem;
  opacity: 0.55;
  line-height: 1.5;
  margin: 0;
}

.visit-message {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 10px 12px;
}

.visit-message__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.visit-message__head strong {
  font-size: 0.82rem;
  color: var(--gold-light);
}

.visit-message__head time {
  font-size: 0.7rem;
  opacity: 0.55;
  white-space: nowrap;
}

.visit-message p {
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.85;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

body.modal-open {
  overflow: hidden;
}

.martyrs-map-wrap { position: relative; }

.martyrs-map {
  height: 420px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  z-index: 1;
}

.cemetery-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.75rem;
  opacity: 0.8;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-item i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

/* ---- Grave Grid ---- */
.grave-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 28px;
}

.grave-section__header {
  margin-bottom: 24px;
}

.grave-section__header h3 {
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.grave-section__header p { font-size: 0.82rem; opacity: 0.6; }

/* ---- Grave overview zones ---- */
.grave-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.grave-overview__empty {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  opacity: 0.6;
  padding: 12px 0;
}

.grave-zone {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
  color: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
  overflow: hidden;
}

.grave-zone__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 12px;
}

.grave-zone__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--zone-color, var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.grave-zone__text {
  flex: 1;
  min-width: 0;
}

.grave-zone__name {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.3;
  margin: 0 0 6px;
}

.grave-zone__meta {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.72;
  line-height: 1.45;
}

.grave-zone__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px 14px;
  border-top: 1px solid rgba(255,255,255,0.1);
  background: rgba(0, 0, 0, 0.14);
}

.grave-zone__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
}

.grave-zone__btn--map {
  color: var(--gold-light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.grave-zone__btn--map:hover {
  text-decoration: underline;
}

.grave-zone__btn--dir {
  color: var(--gold-light);
  text-decoration: none;
  opacity: 0.92;
}

.grave-zone__btn--dir:hover {
  opacity: 1;
  text-decoration: underline;
}

.grave-zone:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.28);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.04) 100%);
}

.grave-zone--active {
  border-color: var(--zone-color, var(--accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--zone-color, var(--accent)) 45%, transparent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--zone-color, var(--accent)) 18%, transparent) 0%, rgba(255,255,255,0.03) 100%);
}

/* ---- Grave map full-screen modal ---- */
.modal--grave-map {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
}

.modal--grave-map .grave-map-modal {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #0a2438 0%, #0c2d4a 45%, #143d5c 100%);
  color: #fff;
  overflow: hidden;
  animation: graveMapModalIn 0.32s ease;
  z-index: 1;
}

.grave-map-modal__header {
  flex-shrink: 0;
  padding: 18px 64px 14px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: relative;
  background: rgba(0,0,0,0.15);
}

.grave-map-modal__header h4 {
  font-size: 1.15rem;
  color: var(--gold-light);
  margin: 0 0 6px;
  line-height: 1.35;
}

.grave-map-modal__header .grave-grid-hint {
  margin: 0 !important;
}

.grave-map-modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  font-family: inherit;
}

.grave-map-modal__close:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.grave-map-modal__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 28px;
  -webkit-overflow-scrolling: touch;
}

.modal--grave-map .grave-grid-scroll {
  overflow: visible;
  max-width: none;
  width: max-content;
  min-width: 100%;
  margin-top: 0;
  padding-bottom: 4px;
}

@keyframes graveMapModalIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.grave-grid-hint {
  font-size: 0.75rem !important;
  opacity: 0.55 !important;
  margin-top: 4px !important;
  font-style: italic;
}

.grave-section {
  overflow: hidden;
}

.grave-grid-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  width: 100%;
  padding-bottom: 10px;
  margin-top: 4px;
  overscroll-behavior-x: contain;
}

.grave-grid-scroll::-webkit-scrollbar {
  height: 8px;
}

.grave-grid-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}

.grave-grid-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.28);
  border-radius: 4px;
}

.grave-grid {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: min-content;
}

.grave-cell {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: rgba(255,255,255,0.7);
}

.grave-cell:hover,
.grave-cell.active {
  background: rgba(196, 30, 58, 0.3);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.grave-cell.occupied {
  background: rgba(45, 106, 79, 0.25);
  border-color: rgba(45, 106, 79, 0.5);
}

.grave-cell.occupied:hover {
  background: rgba(196, 30, 58, 0.3);
  border-color: var(--accent);
}

.grave-cell--unused {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
  font-size: 0.65rem;
}

.grave-grid--map { display: block; width: max-content; min-width: min-content; }
.grave-grid--map .grave-map-canvas { position: relative; }
.grave-grid--map .grave-map-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.grave-grid--map .grave-map-cells { position: relative; z-index: 1; }
.grave-grid--map .grave-map-cell {
  position: absolute; box-sizing: border-box; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.75);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 4px; font-size: 0.68rem; font-weight: 600;
  transform-origin: center center; overflow: hidden; transition: var(--transition);
}
.grave-grid--map .grave-map-cell__code { font-size: 0.68rem; font-weight: 700; line-height: 1.1; }
.grave-grid--map .grave-map-cell__name { font-size: 0.55rem; opacity: 0.85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grave-grid--map .grave-map-cell__badge {
  position: absolute; top: 3px; right: 3px; font-size: 0.48rem; background: #fff; color: #1b4332;
  width: 12px; height: 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.grave-grid--map .grave-map-cell:hover { background: rgba(196, 30, 58, 0.3); border-color: var(--accent); color: #fff; }
.grave-grid--map .grave-map-cell.occupied { background: rgba(45, 106, 79, 0.25); border-color: rgba(45, 106, 79, 0.5); cursor: pointer; }
.grave-grid--map .grave-map-cell.unused { opacity: 0.25; pointer-events: none; border-style: dashed; }
.grave-grid--map .grave-map-cell.unplaced { border-color: rgba(255, 209, 102, 0.55); border-style: dashed; }

.grave-grid--map .gme-shapes { position: relative; z-index: 1; }
.grave-grid--map .gme-shape {
  position: absolute; box-sizing: border-box; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85); font-size: 0.68rem; font-weight: 600;
  transform-origin: center center; overflow: hidden; transition: var(--transition);
}
.grave-grid--map .gme-shape--occupied {
  background: rgba(45, 106, 79, 0.28); border-color: rgba(45, 106, 79, 0.55); cursor: pointer;
}
.grave-grid--map .gme-shape--grave { cursor: pointer; }
.grave-grid--map .gme-shape:hover { background: rgba(196, 30, 58, 0.28); border-color: var(--accent); color: #fff; }
.grave-grid--map .gme-shape__code { font-weight: 700; line-height: 1.1; }
.grave-grid--map .gme-shape__name { font-size: 0.55rem; opacity: 0.85; }
.grave-grid--map .gme-shape__badge {
  position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; color: #1b4332; font-size: 0.45rem; display: flex; align-items: center; justify-content: center;
}

/* ---- Library ---- */
.library { padding: 64px 0; }

.library-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.lib-tab {
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}

.lib-tab.active,
.lib-tab:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.library-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.doc-list { display: flex; flex-direction: column; gap: 12px; }

.doc-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  transition: var(--transition);
}

.doc-item:hover { border-color: var(--primary-light); box-shadow: var(--shadow-lg); }

.doc-item__type {
  background: var(--primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.doc-item h4 {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary);
  grid-column: 2;
}

.doc-item__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  grid-column: 2;
}

.doc-item__download {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: var(--transition);
}

.doc-item__download:hover { color: var(--accent-dark); }

.library-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.media-card__visual {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: none;
  background: #e8edf3;
  cursor: pointer;
  overflow: hidden;
}

.media-card__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #0c2d4a 0%, #1a5276 100%);
  color: #fff;
  height: 100%;
}

.media-card__thumb--video {
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #0c2d4a 100%);
}

.media-card__play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(196, 30, 58, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  padding-left: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.media-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.media-card__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.media-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
}

.media-card__meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.media-card__action {
  margin-top: 8px;
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
}

.media-card__action:hover { color: var(--accent-dark); }

body.library-viewer-open { overflow: hidden; }

.library-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.library-viewer[hidden] { display: none !important; }

.library-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 40, 0.82);
  backdrop-filter: blur(4px);
}

.library-viewer__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  background: #0a1628;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.library-viewer__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.library-viewer__close:hover { background: rgba(255, 255, 255, 0.22); }

.library-viewer__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: calc(100vh - 140px);
  background: #000;
}

.library-viewer__img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
}

.library-viewer__video {
  width: 100%;
  max-height: calc(100vh - 140px);
  background: #000;
}

.library-viewer__iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 240px;
  border: none;
  background: #000;
}

.library-viewer__caption {
  padding: 14px 18px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  background: #0c2d4a;
}

.library-viewer__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}

.library-viewer__nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.library-viewer__nav--prev { left: 12px; }
.library-viewer__nav--next { right: 12px; }

@media (max-width: 640px) {
  .media-grid { grid-template-columns: 1fr; }
  .library-viewer { padding: 12px; }
}

/* ---- Feedback ---- */
.feedback {
  padding: 64px 0;
  background: linear-gradient(180deg, var(--bg) 0%, #e8edf3 100%);
}

.feedback__grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.feedback__info p {
  color: var(--text-muted);
  margin: 12px 0 24px;
}

.contact-cards { display: flex; flex-direction: column; gap: 12px; }

.contact-card {
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.contact-card strong { display: block; font-size: 0.85rem; color: var(--primary); margin-bottom: 4px; }
.contact-card p { font-size: 0.85rem; color: var(--text-muted); }

.feedback-form {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

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

.feedback-form .form-group { margin-bottom: 16px; }

.feedback-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

/* ---- Footer ---- */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 48px 0 0;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer__brand strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 8px;
}

.footer__brand p { font-size: 0.85rem; opacity: 0.7; }
.footer__slogan { color: var(--gold-light) !important; font-style: italic; margin-top: 8px; }

.footer__links h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gold-light);
}

.footer__links a {
  display: block;
  font-size: 0.82rem;
  opacity: 0.7;
  padding: 4px 0;
  transition: var(--transition);
}

.footer__links a:hover { opacity: 1; color: #fff; }

.footer__stats h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--gold-light);
}

.footer__stats p { font-size: 0.82rem; opacity: 0.7; margin-bottom: 4px; }

.footer__bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.6;
}

.footer__bottom p { margin-bottom: 4px; }

/* ---- Overlay & Modal ---- */
.overlay,
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.overlay.active,
.modal.active { display: flex; }

.overlay {
  background: rgba(12, 45, 74, 0.7);
  backdrop-filter: blur(8px);
}

.overlay__content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 90%;
  max-width: 600px;
  position: relative;
  animation: slideUp 0.3s ease;
}

.overlay__close,
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

.overlay__close:hover,
.modal__close:hover { background: var(--accent); color: #fff; }

.overlay__content h2 {
  font-size: 1.4rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.overlay__input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
}

.overlay__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(12, 45, 74, 0.1);
}

.overlay__suggestions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.overlay__suggestions button {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  transition: var(--transition);
}

.overlay__suggestions button:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.overlay__results {
  margin-top: 20px;
  max-height: 320px;
  overflow-y: auto;
  text-align: left;
}

.overlay__results .search-result-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.overlay__results .search-result-item:hover {
  border-color: var(--primary-light);
  background: #fff;
}

.overlay__results .search-result-item strong {
  color: var(--primary);
  font-size: 0.85rem;
}

.overlay__results .search-result-item span {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  z-index: 1;
}

.modal__content--incense {
  background: linear-gradient(180deg, #1a0a0a, #2d1515);
  color: #fff;
  text-align: center;
  padding: 48px 32px;
}

.modal__body { padding: 32px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Martyr modal content */
.martyr-profile { display: grid; gap: 20px; }

.martyr-profile__header {
  display: flex;
  gap: 20px;
  align-items: center;
}

.martyr-profile__photo {
  width: 80px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.martyr-profile__name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
}

.martyr-profile__id {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

.martyr-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.martyr-info-item {
  background: var(--bg);
  padding: 12px 16px;
  border-radius: 8px;
}

.martyr-info-item label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.martyr-info-item span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.martyr-qr {
  text-align: center;
  padding: 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
}

.martyr-qr__link { display: inline-block; }

.martyr-qr__link img { border-radius: 8px; }

.martyr-qr__code {
  width: 100px;
  height: 100px;
  background: #fff;
  margin: 0 auto 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.martyr-attachments {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-btn {
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: var(--transition);
}

.attachment-btn:hover { background: var(--primary-light); }

.attachment-btn--disabled,
.attachment-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #8a9bb0;
}

.attachment-btn--disabled:hover,
.attachment-btn:disabled:hover { background: #8a9bb0; }

/* Incense scene */
.incense-scene { padding: 20px; }

.incense-sticks {
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 24px;
}

.incense-stick {
  width: 6px;
  height: 60px;
  background: linear-gradient(180deg, #8B4513, #D2691E);
  border-radius: 3px 3px 0 0;
  position: relative;
  transition: height 0.5s ease;
}

.incense-stick.lit::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 16px;
  background: radial-gradient(ellipse, #ff6b35, #ff4500, transparent);
  border-radius: 50%;
  animation: flicker 0.8s infinite alternate;
}

.incense-stick.lit::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 40px;
  background: radial-gradient(ellipse, rgba(200,200,200,0.4), transparent);
  border-radius: 50%;
  animation: smoke 2s infinite;
}

@keyframes flicker {
  from { opacity: 0.8; transform: translateX(-50%) scale(1); }
  to { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

@keyframes smoke {
  0% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
}

.incense-scene h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--gold-light);
}

.incense-scene p {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 24px;
  font-style: italic;
}

/* ---- Visit modal ---- */
.visit-modal {
  max-width: 440px;
  padding: 0;
  overflow: hidden;
  border: none;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.visit-modal__hero {
  position: relative;
  padding: 28px 24px 22px;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212, 160, 23, 0.22), transparent 70%),
    linear-gradient(145deg, #7a1528 0%, #c41e3a 52%, #9a1830 100%);
  color: #fff;
}

.visit-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 2;
}

.visit-modal__close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.05);
}

.visit-modal__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.visit-modal__title {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: -0.01em;
}

.visit-modal__subtitle {
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0;
  opacity: 0.92;
  max-width: 320px;
  margin-inline: auto;
}

.visit-modal__form {
  display: block;
  padding: 22px 24px 24px;
  background: #faf8f6;
}

.visit-modal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.visit-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.visit-modal__field--full {
  grid-column: 1 / -1;
}

.visit-modal__field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a5568;
  letter-spacing: 0.01em;
}

.visit-modal__req {
  color: var(--accent);
}

.visit-modal__opt {
  font-weight: 500;
  color: #94a3b8;
}

.visit-modal__field input,
.visit-modal__field textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #1a2332;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.visit-modal__field textarea {
  min-height: 108px;
  resize: vertical;
}

.visit-modal__field input::placeholder,
.visit-modal__field textarea::placeholder {
  color: #a0aec0;
}

.visit-modal__field input:focus,
.visit-modal__field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}

.visit-modal__status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.visit-modal__status.is-success {
  background: #e8f5ee;
  color: #1f6b45;
  border: 1px solid #b8e0c8;
}

.visit-modal__status.is-error {
  background: #fdeef1;
  color: #a81830;
  border: 1px solid #f5c2cb;
}

.visit-modal__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #c41e3a 0%, #9a1830 100%);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(196, 30, 58, 0.32);
  transition: transform 0.2s, box-shadow 0.2s;
}

.visit-modal__submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(196, 30, 58, 0.4);
}

.visit-modal__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.visit-modal__submit-icon {
  font-size: 1.05rem;
  line-height: 1;
}

@media (max-width: 480px) {
  .visit-modal__fields {
    grid-template-columns: 1fr;
  }

  .visit-modal__form {
    padding: 18px 18px 20px;
  }

  .visit-modal__hero {
    padding: 24px 18px 18px;
  }
}

/* Accessibility mode */
body.accessibility {
  font-size: 18px;
}

body.accessibility .hero__title { font-size: 2.2rem; }

/* Leaflet overrides */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  font-family: var(--font);
}

.leaflet-popup-content { margin: 12px 16px; font-size: 0.85rem; }

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .utilities__grid { grid-template-columns: repeat(3, 1fr); }
  .dept-grid { grid-template-columns: repeat(2, 1fr); }
  .leader-grid { grid-template-columns: repeat(2, 1fr); }
  .public-org-chart__group .public-org-chart__group > .public-org-chart__children {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .nav.open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    box-shadow: var(--shadow-lg);
    padding: 16px;
  }
  .nav.open .nav__list { flex-direction: column; align-items: stretch; }
  .nav-toggle { display: flex; }
  .news-grid { grid-template-columns: 1fr; }
  .martyrs__layout { grid-template-columns: 1fr; }
  .feedback__grid { grid-template-columns: 1fr; }
  .doc-item { grid-template-columns: 1fr; }
  .doc-item__type { justify-self: start; }
  .doc-item__download { justify-self: start; }
  .hero__bg-image {
    object-position: center 15%;
    filter: brightness(0.52) saturate(0.88);
  }
  .hero__overlay {
    background: linear-gradient(
      to top,
      rgba(4, 10, 20, 0.98) 0%,
      rgba(4, 10, 20, 0.92) 38%,
      rgba(4, 10, 20, 0.72) 100%
    );
  }
  .hero__stats {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: none;
  }
  .hero { padding-bottom: 40px; }
  .utilities { margin-top: -12px; }
}

@media (max-width: 600px) {
  .utilities__grid { grid-template-columns: repeat(2, 1fr); }
  .dept-grid { grid-template-columns: 1fr; }
  .leader-grid { grid-template-columns: 1fr; }
  .public-org-chart__group .public-org-chart__group > .public-org-chart__children {
    grid-template-columns: 1fr;
  }
  .public-org-chart > .public-org-chart__root > .public-org-chart__group > .public-org-chart__children > .public-org-chart__branch {
    max-width: none;
  }
  .hero__stats { gap: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .martyr-info-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
}


/* ---- Subpage: Chuyên mục & Bài viết ---- */
body.subpage-open #mainHome { display: none; }

.subpage {
  display: none;
  min-height: calc(100vh - 120px);
  background: var(--bg);
  padding: 24px 0 64px;
}

.subpage.active { display: block; }

.subpage__toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.btn-back {
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--primary);
  transition: var(--transition);
}

.btn-back:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-back--ghost {
  background: transparent;
  color: var(--text-muted);
}

.subpage__header {
  display: flex;
  gap: 20px;
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
}

.subpage__icon { font-size: 3rem; }

.subpage__dept {
  font-size: 0.82rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.subpage__title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.3;
}

.subpage__meta {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 8px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: grid;
  grid-template-columns: minmax(200px, 280px) 1fr;
  overflow: hidden;
}

.article-card__cover {
  min-height: 180px;
  background: #eef4fa;
}

.article-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 180px;
}

.article-card__body {
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.article-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin: 10px 0 8px;
  line-height: 1.4;
}

.article-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.article-card__footer time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-card__more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}


.dept-card__links li { padding-left: 0; }
.dept-card__links li::before { display: none; }
.dept-card__links a {
  display: block;
  font-size: 0.78rem;
  padding: 4px 0 4px 14px;
  opacity: 0.85;
  position: relative;
  color: inherit;
  transition: var(--transition);
}

.dept-card__links a::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.dept-card__links a:hover {
  color: var(--accent);
  opacity: 1;
  padding-left: 18px;
}

.dept-card--accent .dept-card__links a::before { color: var(--gold); }

/* Article detail */
.article-detail {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  overflow: hidden;
}

.article-detail__cover {
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  background: #eef4fa;
}

.article-detail__cover img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.article-detail__meta,
.article-detail__title,
.article-detail__excerpt,
.article-detail__content,
.article-detail__share {
  padding-left: 40px;
  padding-right: 40px;
}

.article-detail__meta {
  padding-top: 28px;
}

.article-detail__share {
  padding-bottom: 32px;
}

.article-detail__meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.article-detail__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--primary);
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-detail__excerpt {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
  line-height: 1.7;
}

.article-detail__content {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
}

.article-detail__content p { margin-bottom: 16px; }
.article-detail__content ul { margin: 16px 0 16px 24px; list-style: disc; }
.article-detail__content li { margin-bottom: 6px; }
.article-detail__content strong { color: var(--primary); }

.article-detail__share {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.related-articles h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 16px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.related-item__thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #eef4fa;
}

.related-item__text {
  min-width: 0;
  flex: 1;
}

.related-item:hover {
  border-color: var(--accent);
  background: rgba(196, 30, 58, 0.04);
}

.related-item time {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.related-item span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
}

.news-item h4 a { cursor: pointer; }

@media (max-width: 768px) {
  .article-card {
    grid-template-columns: 1fr;
  }

  .article-card__cover {
    min-height: 160px;
  }

  .article-card__cover img {
    min-height: 160px;
  }
}

@media (max-width: 600px) {
  .article-detail__meta,
  .article-detail__title,
  .article-detail__excerpt,
  .article-detail__content,
  .article-detail__share {
    padding-left: 20px;
    padding-right: 20px;
  }

  .subpage__header { flex-direction: column; text-align: center; }
}

/* ---- Floating actions (scroll top, Zalo, Facebook) ---- */
.float-actions {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}

body.subpage-open .float-actions {
  display: none;
}

.float-actions__btn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  box-shadow: 0 4px 20px rgba(12, 45, 74, 0.22);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  text-decoration: none;
  color: #fff;
}

.float-actions__btn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 8px 28px rgba(12, 45, 74, 0.28);
  color: #fff;
  text-decoration: none;
}

.float-actions__btn--top {
  background: var(--primary);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  pointer-events: none;
}

.float-actions__btn--top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.float-actions__btn--top.is-visible:hover {
  transform: translateY(-3px) scale(1.06);
}

.float-actions__btn--facebook {
  background: #1877f2;
}

.float-actions__btn--zalo {
  background: #0068ff;
}

@media (max-width: 480px) {
  .float-actions {
    right: 14px;
    bottom: 16px;
    gap: 10px;
  }

  .float-actions__btn {
    width: 44px;
    height: 44px;
  }
}
