/* ===== Thôn Trần Phú — giao diện "bảng tin của thôn" =====
   Ưu tiên: chữ to, tương phản cao, vùng bấm ≥ 48px, màn 360px. */

:root {
  --red: #C8102E;
  --red-ink: #B00E28;      /* chữ đỏ trên nền trắng (tương phản ≥ 5.9:1) */
  --red-soft: #FDECEE;
  --gold: #FFCD00;
  --green: #2E7D32;
  --green-soft: #E8F5E9;
  --amber: #8A5A00;
  --amber-soft: #FFF4D6;
  --blue: #1557B0;
  --bg: #FBF6EC;
  --card: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #4F4F4F;
  --line: #DEDAD3;
  --focus: #1557B0;
  --radius: 14px;
  --nav-h: 66px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  color-scheme: light;
  font-size: 17px;
}
html.chu-to { font-size: 20.4px; }   /* nút "A+ Chữ to": 120% */

@media (prefers-color-scheme: dark) {
  :root {
    --red-ink: #FF8A8A;
    --red-soft: #3A1418;
    --green: #7BD17F;
    --green-soft: #15301A;
    --amber: #FFD36B;
    --amber-soft: #352A0D;
    --blue: #8AB8FF;
    --bg: #111213;
    --card: #1C1D1F;
    --ink: #F2F2F2;
    --muted: #C4C4C4;
    --line: #34363A;
    --focus: #8AB8FF;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  overflow-wrap: anywhere;
}
img, svg { max-width: 100%; }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.3; margin: 0; }
p { margin: 0 0 .5rem; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Đầu trang ---------- */
.top { background: var(--red); color: #fff; border-bottom: 4px solid var(--gold); }
.top-in { max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; padding-top: calc(.6rem + env(safe-area-inset-top, 0px)); }
.logo { width: 44px; height: 44px; flex: none; }
.brand { flex: 1; min-width: 0; }
.brand h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: .2px; }
@media (min-width: 600px) { .brand h1 { font-size: 1.4rem; } }
@media (max-width: 599px) { .brand .slogan { display: none; } }
.brand p { margin: 0; font-size: .85rem; opacity: .95; }
.top-actions { display: flex; gap: .35rem; }
.icon-btn {
  min-width: 48px; min-height: 48px; padding: .2rem .45rem;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35); border-radius: 12px; color: #fff; cursor: pointer;
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .aa { font-weight: 800; font-size: 1.1rem; line-height: 1; }
.icon-btn .aa sup { font-size: .65em; }
.icon-btn .lbl { font-size: .62rem; line-height: 1.1; }
.icon-btn[aria-pressed="true"] { background: var(--gold); color: #3a2a00; border-color: var(--gold); }

/* ---------- Thanh điều hướng: đáy màn hình (điện thoại), đầu trang (máy tính) ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}
.nav a {
  min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 600; position: relative;
}
.nav svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav a[aria-current="page"] { color: var(--red-ink); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 4px; border-radius: 0 0 4px 4px; background: var(--red); }

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .nav { position: sticky; top: 0; bottom: auto; max-width: none; border-top: 0; border-bottom: 1px solid var(--line);
    display: flex; justify-content: center; gap: .3rem; box-shadow: var(--shadow); }
  .nav a { flex-direction: row; gap: .45rem; font-size: .95rem; min-height: 54px; padding: 0 1rem; }
  .nav svg { width: 22px; height: 22px; }
  .nav a[aria-current="page"]::before { top: auto; bottom: 0; left: .6rem; right: .6rem; border-radius: 4px 4px 0 0; }
}

/* ---------- Bố cục ---------- */
main { max-width: 960px; margin: 0 auto; padding: .8rem .75rem 1.5rem; outline: none; }
.foot { max-width: 960px; margin: 0 auto; padding: 0 .9rem 1.5rem; color: var(--muted); font-size: .85rem; text-align: center; }
.foot a { color: var(--muted); }
.section { margin: 1.1rem 0; }
.section > h2, .h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 .55rem; display: flex; align-items: center; gap: .5rem; }
.section > h2::before, .h2::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--red); flex: none; }
.updated { color: var(--muted); font-size: .9rem; margin: .1rem 0 .4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .95rem; box-shadow: var(--shadow); }
.stack > * + * { margin-top: .6rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.grid2 { display: grid; gap: .6rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Dải thông báo trạng thái ---------- */
#banners:empty { display: none; }
.banner { max-width: 960px; margin: 0 auto; padding: .5rem .9rem; font-size: .9rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.banner.mau { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.banner.cu { background: var(--amber-soft); color: var(--amber); }
.banner.mat-mang { background: #333; color: #fff; }
.banner button { min-height: 40px; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: .55rem 1rem; border-radius: 12px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; text-decoration: none; font-size: .95rem;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-red { background: var(--red); border-color: var(--red); color: #fff; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-green { background: #2E7D32; border-color: #2E7D32; } }
.btn-big { width: 100%; min-height: 64px; font-size: 1.15rem; border-radius: 16px; }
.btn-sm { min-height: 44px; padding: .4rem .75rem; font-size: .88rem; }
.btn-link { background: none; border: 0; color: var(--blue); padding: .3rem 0; min-height: 44px; font-weight: 700; cursor: pointer; text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

/* ---------- Thông báo ---------- */
.notice { position: relative; }
.notice .meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.notice h3 { font-size: 1.08rem; font-weight: 700; margin-bottom: .3rem; }
.notice .body { white-space: pre-line; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.notice.khan { border: 2px solid var(--red); background: var(--red-soft); }
.notice.khan h3 { color: var(--red-ink); }
.notice.ghim { border-left: 6px solid var(--gold); }
.pin { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; color: var(--amber); }
.pin svg { width: 16px; height: 16px; fill: currentColor; }
.tag { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1.5px solid currentColor; line-height: 1.5; }
.tag.khan { color: #fff; background: var(--red); border-color: var(--red); }
.tag.vui { color: var(--green); }
.tag.nhac { color: var(--amber); }
.tag.tb { color: var(--blue); }

/* ---------- Thu chi ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .7rem; }
.chip {
  min-height: 44px; padding: .4rem .9rem; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; font-size: .92rem;
}
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.stats { display: grid; gap: .55rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; box-shadow: var(--shadow); }
.stat .k { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.9rem; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat.thu .v { color: var(--green); }
.stat.chi .v { color: var(--red-ink); }
.stat.con { border: 2px solid var(--green); }
.stat.con .v { font-size: 2.2rem; }
.stat.con.am { border-color: var(--red); }
.stat.con.am .v { color: var(--red-ink); }
@media (max-width: 639px) {
  .stat.thu, .stat.chi { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 .6rem; padding: .55rem .9rem; }
  .stat.thu .v, .stat.chi .v { font-size: 1.6rem; }
}
@media (min-width: 640px) { .stats { grid-template-columns: 1fr 1fr 1.2fr; } }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.money.thu { color: var(--green); }
.money.chi { color: var(--red-ink); }
.fund-sum { display: block; text-decoration: none; color: inherit; }
.fund-sum .big { font-size: 1.9rem; font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; }
.fund-sum .go { color: var(--blue); font-weight: 700; }
.fund-line { display: flex; justify-content: space-between; gap: .6rem; padding: .3rem 0; border-top: 1px dashed var(--line); }

.progress { height: 16px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .4rem 0 .2rem; }
.progress > i { display: block; height: 100%; background: var(--green); border-radius: 999px; min-width: 4px; }

.chart { display: flex; align-items: flex-end; gap: .35rem; height: 170px; padding: .5rem .2rem 0; border-bottom: 2px solid var(--line); overflow-x: auto; }
.chart .col { flex: 1 0 40px; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.chart .bar { width: 42%; max-width: 22px; border-radius: 4px 4px 0 0; min-height: 2px; }
.chart .bar.thu { background: var(--green); }
.chart .bar.chi { background: var(--red); }
.chart-x { display: flex; gap: .35rem; padding: .25rem .2rem 0; }
.chart-x span { flex: 1 0 40px; text-align: center; font-size: .78rem; color: var(--muted); }
.legend { display: flex; gap: 1rem; font-size: .85rem; margin-top: .4rem; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.filters { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-bottom: .6rem; }
@media (min-width: 560px) { .filters { grid-template-columns: 2fr 1fr; } }
.input, select.input {
  width: 100%; min-height: 50px; padding: .55rem .8rem; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit;
}
.search { position: relative; }
.search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search .input { padding-left: 2.4rem; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 1fr auto; gap: .1rem .7rem; padding: .65rem .2rem; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .name { font-weight: 700; }
.rows .sub { grid-column: 1 / -1; font-size: .86rem; color: var(--muted); }
.rows .money { align-self: start; }
.count-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem; font-size: .92rem; margin-bottom: .3rem; }

table.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .82rem; color: var(--muted); font-weight: 700; }
.tbl td.r, .tbl th.r { text-align: right; }

/* ---------- Lịch ---------- */
.month { font-size: 1rem; font-weight: 800; color: var(--muted); margin: 1rem 0 .4rem; text-transform: uppercase; letter-spacing: .5px; }
.event { display: grid; grid-template-columns: 4.4rem 1fr; gap: .7rem; border-left: 6px solid var(--c, var(--line)); }
.event .when { text-align: center; }
.event .when .day { font-size: .82rem; font-weight: 700; color: var(--muted); }
.event .when .date { white-space: nowrap; font-size: 1.35rem; font-weight: 800; line-height: 1.1; }
.event .when .time { font-size: 1.15rem; font-weight: 800; color: var(--c, var(--ink)); }
.event h3 { font-size: 1.05rem; font-weight: 700; }
.event .where { font-size: .92rem; }
.ev-tag { display: inline-block; font-size: .78rem; font-weight: 700; color: var(--c); border: 1.5px solid var(--c); border-radius: 999px; padding: 0 .5rem; margin-bottom: .2rem; }
.rel { font-weight: 700; color: var(--red-ink); font-size: .85rem; }
.t-hop { --c: #1557B0; } .t-vesinh { --c: #2E7D32; } .t-yte { --c: #00747F; } .t-vanhoa { --c: #7B1FA2; } .t-rac { --c: #8A5A00; } .t-khac { --c: #555; }
@media (prefers-color-scheme: dark) {
  .t-hop { --c: #8AB8FF; } .t-vesinh { --c: #7BD17F; } .t-yte { --c: #5ED3DD; } .t-vanhoa { --c: #D59CF0; } .t-rac { --c: #FFD36B; } .t-khac { --c: #C4C4C4; }
}
.mini-ev { display: flex; gap: .7rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.mini-ev:last-child { border-bottom: 0; }
.mini-ev .d { min-width: 4rem; flex: none; text-align: center; border-radius: 10px; padding: .2rem; background: var(--bg); border-left: 5px solid var(--c); }
.mini-ev .d b { display: block; font-size: 1.15rem; line-height: 1.1; white-space: nowrap; }
.mini-ev .d small { font-size: .75rem; color: var(--muted); }

/* ---------- Danh bạ ---------- */
.contact { display: grid; gap: .3rem; }
.contact .role { font-weight: 700; color: var(--muted); font-size: .9rem; }
.contact .who { font-weight: 700; font-size: 1.05rem; }
.contact .phone { font-size: 1.55rem; font-weight: 800; letter-spacing: .5px; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.contact.sos .phone { color: var(--red-ink); font-size: 2rem; }
.contact .btn-row { margin-top: .3rem; }
.contact .btn-row .btn { flex: 1 1 auto; }

/* ---------- Gập / mở ---------- */
details.acc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.acc + details.acc { margin-top: .5rem; }
details.acc > summary { list-style: none; cursor: pointer; padding: .8rem 2.6rem .8rem .95rem; min-height: 52px; font-weight: 700; position: relative; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: ""; position: absolute; right: 1rem; top: 50%; width: 10px; height: 10px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
details.acc[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
details.acc > .acc-body { padding: 0 .95rem .9rem; }

.status { display: inline-block; font-size: .8rem; font-weight: 700; padding: .05rem .55rem; border-radius: 999px; }
.st-xong { background: var(--green-soft); color: var(--green); }
.st-dang { background: var(--amber-soft); color: var(--amber); }
.st-nhan { background: var(--bg); color: var(--blue); border: 1px solid var(--line); }

.note { background: var(--amber-soft); color: var(--ink); border-radius: 12px; padding: .7rem .9rem; font-size: .92rem; }
.privacy { display: flex; gap: .6rem; align-items: flex-start; }
.privacy svg { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--green); stroke-width: 2; }

/* ---------- Trạng thái rỗng / lỗi / đang tải ---------- */
.empty { text-align: center; color: var(--muted); padding: 1.2rem .5rem; }
.error-box { text-align: center; padding: 2rem 1rem; }
.error-box h2 { margin-bottom: .5rem; }
.loading p { text-align: center; color: var(--muted); }
.sk { height: 74px; border-radius: var(--radius); background: linear-gradient(90deg, var(--line) 25%, var(--card) 50%, var(--line) 75%); background-size: 300% 100%; animation: sk 1.3s infinite; margin-bottom: .6rem; }
.sk-title { height: 28px; width: 60%; }
.sk-short { width: 70%; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } * { transition: none !important; } }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 30px);
  background: #222; color: #fff; padding: .7rem 1.1rem; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 768px) { .toast { bottom: 24px; } }
.noscript { padding: 1rem; text-align: center; }

/* ---------- Kiểm tra dữ liệu ---------- */
.issue { padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.issue b { color: var(--red-ink); }
.ok { color: var(--green); font-weight: 700; }
.tbl-wrap { overflow-x: auto; }

/* ---------- In bảng công khai ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  :root, html.chu-to { font-size: 11pt; }
  body { background: #fff; color: #000; padding: 0; }
  .top, .nav, .foot, #banners, .toast, .no-print, .chips, .filters, .btn, .btn-link, .chart-wrap { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; }
  .card, .stat { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .stat .v { font-size: 16pt; color: #000 !important; }
  .rows li { break-inside: avoid; padding: .25rem 0; }
  details.acc { border: 0; } details.acc > summary::after { display: none; }
  a { color: #000; text-decoration: none; }
}

/* =====================================================================
   GIAO DIỆN v2 — truyền thống (hoa văn trống đồng, chữ có chân, đỏ – vàng)
   kết hợp hiện đại (ảnh bìa, thẻ số liệu, thư viện ảnh, khung xem ảnh)
   ===================================================================== */
:root {
  --serif: "Lora", "Noto Serif", Georgia, "Times New Roman", serif;
  --red-deep: #8E0B20;
  --gold-soft: #FFF4D6;
  --orn: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='10' viewBox='0 0 24 10'%3E%3Cpath d='M0 10 L6 2 L12 10 L18 2 L24 10' fill='none' stroke='%23FFCD00' stroke-width='2'/%3E%3Ccircle cx='6' cy='7' r='1.3' fill='%23FFCD00'/%3E%3Ccircle cx='18' cy='7' r='1.3' fill='%23FFCD00'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root { --bg: #14110F; --card: #1F1B18; --line: #3A332C; --gold-soft: #33290F; } }

/* Đầu trang: đỏ thẫm chuyển màu + mặt trống đồng mờ + dải hoa văn vàng */
.top { position: relative; overflow: hidden; background: linear-gradient(135deg, #A50D26 0%, #C8102E 55%, #B30E29 100%); border-bottom: 0; }
.top::before { content: ""; position: absolute; right: -70px; top: 50%; width: 230px; height: 230px; transform: translateY(-50%);
  background: url("assets/trong-dong.svg") center / contain no-repeat; opacity: .16; pointer-events: none; }
.top::after { content: ""; display: block; height: 10px; background: var(--red-deep) var(--orn) repeat-x center / 24px 10px; border-top: 2px solid var(--gold); }
.top-in { position: relative; }
.brand h1 { font-family: var(--serif); font-weight: 700; letter-spacing: .3px; }
.logo { width: 46px; height: 46px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }

/* Tiêu đề mục: chữ có chân + họa tiết hình thoi vàng */
.section > h2, .h2 { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.section > h2::before, .h2::before { width: 11px; height: 11px; border-radius: 2px; background: var(--gold); transform: rotate(45deg);
  box-shadow: 0 0 0 3px var(--red-soft), 0 0 0 4.5px var(--red); margin: 0 .3rem 0 .25rem; }
.section > h2::after, .h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); margin-left: .4rem; }

/* Ảnh bìa (hero) */
.hero { position: relative; overflow: hidden; border-radius: 20px; min-height: 230px; display: flex; align-items: flex-end; color: #fff;
  background: linear-gradient(140deg, #8E0B20, #C8102E 60%, #D9481F); box-shadow: 0 6px 22px rgba(120, 10, 30, .22); margin-bottom: .8rem; }
.hero::before { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  background: url("assets/trong-dong.svg") center / contain no-repeat; opacity: .18; }
.hero.has-img::before { display: none; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(50,0,8,.6) 0%, rgba(0,0,0,.12) 38%, rgba(60,0,8,.82) 100%); }
.hero-in { position: relative; z-index: 1; padding: 1rem 1.1rem 1.1rem; width: 100%; }
.hero-date { display: flex; flex-wrap: wrap; gap: .15rem .6rem; font-size: .85rem; margin-bottom: .3rem; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.hero-date span { color: var(--gold); font-weight: 600; }
.hero-title { font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.15; text-shadow: 0 2px 8px rgba(0,0,0,.45); }
.hero-slogan { display: flex; align-items: center; gap: .5rem; color: var(--gold); font-weight: 700; font-size: .92rem; margin: .35rem 0 .2rem; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.hero-slogan i { flex: 0 0 22px; height: 2px; background: var(--gold); border-radius: 2px; }
.hero-intro { font-size: .92rem; margin: .3rem 0 0; max-width: 40rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
@media (min-width: 640px) { .hero { min-height: 300px; } .hero-title { font-size: 2.6rem; } .hero-in { padding: 1.6rem 1.8rem; } }

/* Ba ô số liệu nhanh */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .3rem; }
.qk { display: flex; flex-direction: column; justify-content: center; min-height: 76px; padding: .55rem .6rem; border-radius: 14px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--gold); box-shadow: var(--shadow); }
.qk-v { font-weight: 800; font-size: 1.02rem; line-height: 1.2; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.qk-k { font-size: .76rem; color: var(--muted); font-weight: 600; line-height: 1.25; }

/* Dải ảnh trượt ngang + lưới thư viện */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: .6rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: .4rem; overscroll-behavior-x: contain; scrollbar-width: thin; }
.strip .tile { scroll-snap-align: start; }
@media (min-width: 640px) { .strip { grid-auto-columns: 32%; } }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer;
  aspect-ratio: 4 / 3; background: var(--line); box-shadow: var(--shadow); text-align: left; }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.tile:hover img { transform: scale(1.04); }
.tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .6rem .45rem; color: #fff; font-size: .82rem; line-height: 1.3;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.78)); display: grid; }
.tile .cap small { font-size: .72rem; opacity: .9; }
.tile .play { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%;
  background: rgba(200, 16, 46, .92); color: #fff; display: grid; place-items: center; box-shadow: 0 2px 12px rgba(0,0,0,.4); border: 2px solid var(--gold); }
.tile .play svg { width: 24px; height: 24px; margin-left: 3px; }
.tile-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.tile-ph svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Ảnh trong thông báo */
.notice-img { display: block; width: calc(100% + 1.9rem); margin: -.85rem -.95rem .7rem; padding: 0; border: 0; cursor: zoom-in;
  aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--line); }
.notice-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.notice.ghim.has-img { border-left-width: 1px; border-top: 0; }
.notice.ghim.has-img .notice-img { border-bottom: 4px solid var(--gold); }

/* Âm lịch dưới ngày sự kiện */
.event .when .lunar { font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: .15rem; }

/* Khung xem ảnh / video */
body.no-scroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 6, 4, .95); display: grid; grid-template-rows: 1fr auto; align-items: center; justify-items: center; }
.lightbox[hidden] { display: none; }
.lb-stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 3.6rem .5rem .5rem; min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 11rem); object-fit: contain; border-radius: 6px; }
.lb-stage iframe, .lb-stage video { width: min(100%, 960px); aspect-ratio: 16 / 9; max-height: calc(100vh - 11rem); border: 0; border-radius: 8px; background: #000; }
.lb-cap { color: #fff; width: 100%; max-width: 960px; padding: .6rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); display: grid; gap: .15rem; font-size: .9rem; }
.lb-cap b { font-family: var(--serif); font-size: 1.1rem; }
.lb-cap span { color: #ddd; }
.lb-btn { position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lb-close { top: calc(.6rem + env(safe-area-inset-top, 0px)); right: .6rem; }
.lb-prev { left: .5rem; top: 45%; } .lb-next { right: .5rem; top: 45%; }

/* Chân trang có hoa văn */
.foot-orn { height: 34px; margin: .5rem auto .6rem; background: url("assets/trong-dong.svg") center / 34px 34px no-repeat; position: relative; opacity: .9; }
.foot-orn::before, .foot-orn::after { content: ""; position: absolute; top: 50%; width: calc(50% - 30px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.foot-orn::before { left: 0; } .foot-orn::after { right: 0; transform: scaleX(-1); }
@media (prefers-color-scheme: light) { .foot-orn { filter: brightness(.75) saturate(1.3); } }

/* Thanh điều hướng 6 mục */
.nav a { font-size: .7rem; }
@media (min-width: 768px) { .nav a { font-size: .95rem; padding: 0 .8rem; } }
.nav a[aria-current="page"]::before { background: linear-gradient(90deg, var(--red), var(--gold)); }

.sk-hero { height: 220px; border-radius: 20px; }
.card { border-radius: 16px; }
.stat.con { background: linear-gradient(135deg, var(--card), var(--green-soft)); }

@media print {
  .hero, .quick, .strip, .gallery, .lightbox, .foot-orn, .notice-img { display: none !important; }
}
@media (max-width: 420px) { .hero-slogan i { display: none; } }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .3rem; scrollbar-width: none; }
.chips.scroll .chip { flex: none; }
@media (max-width: 639px) { .lb-prev { top: calc(.6rem + env(safe-area-inset-top, 0px)); left: .6rem; } .lb-next { top: calc(.6rem + env(safe-area-inset-top, 0px)); left: 4.3rem; right: auto; } }
