/* =============================================================================
   CSS cho các khối CMS dựng trang (BlockRenderer). Dùng lại biến màu và các lớp
   .card-grid / .section-title / .btn / .empty-state / .article-body của app.css.
   Không mã màu cứng (BR-1): màu lấy từ token thương hiệu trong :root của app.css.
   ============================================================================= */

.block { margin: 0 0 40px; }
.block:last-child { margin-bottom: 0; }

/* ===== Bố cục nhiều cột: SIDEBAR RỘNG CỐ ĐỊNH + nội dung linh hoạt =========
   Dùng cột bên rộng cố định (không dùng fr) để sidebar không giãn rộng lãng phí,
   nội dung chính luôn là phần rộng nhất → cân đối thị giác. Slider/Hero đã tách lên
   dải .page-fulltop ở trên nên phần cột bên dưới bắt đầu cùng một hàng. */
.page-fulltop { margin: 0 0 32px; }

.page-cols { display: grid; gap: 30px; align-items: start; }
.page-2col       { grid-template-columns: minmax(0, 1fr) 300px; }          /* chính + phải */
.page-2col-left  { grid-template-columns: 280px minmax(0, 1fr); }           /* trái + chính */
.page-3col       { grid-template-columns: 250px minmax(0, 1fr) 290px; }     /* trái + chính + phải */

.page-col-main { min-width: 0; }

/* Cột bên: các widget xếp dọc, mỗi widget là một "thẻ" đồng nhất → gọn, cân đối dù nội dung ngắn */
.page-col-aside { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.page-col-aside > .block {
    margin: 0;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 16px 18px;
    box-shadow: 0 1px 2px rgb(16 32 48 / 5%), 0 8px 22px rgb(16 32 48 / 5%);
}
/* Sự kiện ở cột bên: luôn 1 cột và nằm TRỌN trong thẻ (trước đây cột lưới tối thiểu 300px > bề ngang thẻ 268px nên tràn ra ngoài ~32px). */
.page-col-aside .event-list { grid-template-columns: minmax(0, 1fr); }
/* Tiêu đề widget gọn hơn tiêu đề mục ở nội dung chính, tránh xuống dòng xấu ở cột hẹp */
.page-col-aside .section-title { font-size: 17px; margin: 0 0 12px; }
.page-col-aside .section-title .section-icon svg { width: 18px; height: 18px; }

/* Cột bên dính theo nội dung trên màn hình rộng (widget luôn trong tầm nhìn khi cuộn) */
@media (min-width: 1025px) {
    .page-col-aside { position: sticky; top: 84px; }
}

@media (max-width: 1024px) {
    /* Máy tính bảng: bỏ cột trái/phải hẹp — dồn về 2 cột (chính + 1 rail), rail xuống dưới nếu cần */
    .page-3col { grid-template-columns: minmax(0, 1fr) 300px; }
    .page-3col > .page-col-aside:first-of-type { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 820px) {
    .page-cols, .page-2col, .page-2col-left, .page-3col { display: block; }
    .page-col-aside { margin-top: 24px; }
}

/* --- Khối "Menu cột" (sidebar) — phẳng bên trong thẻ widget ---------------- */
.sidemenu-nav { display: flex; flex-direction: column; gap: 1px; }
.sidemenu-link {
    display: block; padding: 9px 11px; border-radius: 8px; font-weight: 600; color: var(--brand-dark);
}
.sidemenu-link:hover { background: var(--brand); color: #fff; text-decoration: none; }
.sidemenu-sub { display: flex; flex-direction: column; gap: 1px; margin: 1px 0 6px 8px; padding-left: 10px; border-left: 2px solid var(--line); }
.sidemenu-sub a { display: block; padding: 7px 10px; border-radius: 7px; font-size: 14px; color: var(--ink); }
.sidemenu-sub a:hover { background: var(--brand-light); color: var(--brand-dark); text-decoration: none; }

/* --- Hero: băng lớn đầu trang --------------------------------------------- */
.block-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--brand-light);
    padding: clamp(28px, 6vw, 72px) clamp(20px, 5vw, 56px);
}

/* Ảnh nền phủ kín; lớp phủ tối để chữ trắng đạt tương phản WCAG AA */
.block-hero .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.block-hero-image { color: var(--bg); }
.block-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--brand-dark) 55%, transparent),
        color-mix(in srgb, var(--brand-dark) 82%, transparent));
}

.block-hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
}
.hero-title {
    margin: 0 0 10px;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.2;
    color: inherit;
}
.hero-subtitle {
    margin: 0 0 18px;
    font-size: clamp(16px, 2vw, 19px);
    color: inherit;
}
/* Hero không ảnh: nền sáng -> chữ dùng màu thương hiệu tối cho đủ tương phản */
.block-hero:not(.block-hero-image) .hero-title { color: var(--brand-dark); }
.block-hero:not(.block-hero-image) .hero-subtitle { color: var(--ink-soft); }
.hero-btn { margin-top: 4px; }

/* --- Ảnh đơn -------------------------------------------------------------- */
.block-image { margin: 0 0 40px; }
.block-image figure { margin: 0; }
.block-image img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
}
.block-image figcaption {
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
    color: var(--ink-soft);
}

/* --- Khối danh sách / nổi bật: tái dùng .card-grid & .section-title -------- */
.block-featured .card-featured { margin-bottom: 20px; }

/* Hàng bài nổi bật cũ hơn dưới bài lớn: thẻ nhỏ gọn, 3–4 cột. */
.featured-rest { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.featured-rest .card-title { font-size: 16px; }
/* Dùng 16/9 (KHÔNG 16/10) cho đồng bộ với thẻ thường: ảnh cover 1200×630 chỉ bị
   cắt ~3% mỗi mép thay vì ~8% → logo/tiêu đề trên cover không bị cắt cụt (mọi tenant). */
.featured-rest .card-image { aspect-ratio: 16 / 9; }

/* --- Nội dung RichText/Html: khoảng cách nhất quán ------------------------- */
.block-richtext,
.block-html { margin: 0 0 40px; }

/* --- Trình chiếu ảnh (Slider) — thuần CSS, không JS ------------------------ */
.block-slider .slider { position: relative; }
.slider-track {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
    border-radius: var(--radius); scrollbar-width: none;
}
.slider-track::-webkit-scrollbar { display: none; }

.slide { position: relative; flex: 0 0 100%; scroll-snap-align: start; }
.slide-media { display: block; color: inherit; }
.slide-media img {
    /* Chiều cao TỐI ĐA (desktop) do admin đặt qua --slider-h; clamp giữ responsive:
       màn nhỏ co theo 42vw, sàn 180px. Không đặt được thì về 460px. */
    display: block; width: 100%; height: clamp(180px, 42vw, var(--slider-h, 460px));
    object-fit: cover; object-position: center 30%; background: var(--brand-light);
}

/* Chế độ "Hiện trọn ảnh" (fit=contain): ảnh KHÔNG bị cắt; phần khung thừa lấp bằng chính ảnh đó làm mờ (không viền trống xấu). */
.slider--contain .slide-media { position: relative; overflow: hidden; background: #0b1220; }
.slider--contain .slide-media::before {
    content: ""; position: absolute; inset: -28px; z-index: 0; background: var(--sl-bg, none) center / cover no-repeat;
    filter: blur(26px) brightness(.72) saturate(1.15);
}
.slider--contain .slide-media img { position: relative; z-index: 1; object-fit: contain; object-position: center; background: transparent; }

/* Chú thích đè trên ảnh (dải mờ để chữ trắng đủ tương phản) */
.slide-cap {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 40px 24px 18px; color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
}
.slide-cap h3 { margin: 0 0 4px; font-size: clamp(18px, 2.4vw, 26px); color: #fff; }
.slide-cap p { margin: 0; font-size: clamp(14px, 1.6vw, 17px); color: #eef; }

/* Mũi tên trái/phải (liên kết neo tới slide kề) */
.slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(0,0,0,.4); color: #fff;
    font-size: 26px; line-height: 1; text-decoration: none;
}
.slider-arrow:hover { background: var(--brand); }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }

/* Chấm điều hướng */
.slider-dots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.slider-dot {
    width: 11px; height: 11px; border-radius: 50%; background: var(--line);
    border: 1px solid var(--line); transition: background .15s;
}
.slider-dot:hover { background: var(--brand); border-color: var(--brand); }

@media (max-width: 640px) {
    .slider-arrow { width: 36px; height: 36px; font-size: 22px; }
}

/* --- Sự kiện sắp diễn ra: thẻ nhiều cột, có accent trạng thái + hành động ---- */
.event-list {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));   /* min(…,100%): cột hẹp (cột bên 300px) KHÔNG bị ép rộng hơn khung → hết tràn ra ngoài thẻ */
}

.event-card {
    position: relative; display: flex; gap: 12px; align-items: flex-start;
    background: var(--bg); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px 12px 16px;
    overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
/* Dải màu bên trái theo trạng thái */
.event-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--brand);
}
.event-card.ev-upcoming::before { background: linear-gradient(180deg, #F59E0B, #FBBF24); }
.event-card.ev-ongoing::before  { background: linear-gradient(180deg, #16A34A, #22C55E); }
.event-card.ev-ended::before    { background: var(--line); }
.event-card:hover {
    box-shadow: 0 5px 16px rgba(5, 51, 132, .09);
    transform: translateY(-1px); border-color: var(--brand-light);
}
.event-card.ev-ended { opacity: .8; }

/* Ô ngày: khối gradient thương hiệu gọn, có thứ trong tuần */
.event-date {
    flex: 0 0 auto; width: 52px; text-align: center; color: #fff;
    background: linear-gradient(160deg, var(--brand), var(--brand-dark));
    border-radius: 10px; padding: 7px 5px 6px;
}
.event-card.ev-upcoming .event-date { background: linear-gradient(160deg, #F59E0B, #D97706); }
.event-card.ev-ongoing  .event-date { background: linear-gradient(160deg, #16A34A, #15803D); }
.event-card.ev-ended    .event-date { background: linear-gradient(160deg, #94A3B8, #64748B); }
.event-weekday { display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .9; }
.event-day { display: block; font-size: 21px; font-weight: 800; line-height: 1.05; }
.event-month { display: block; font-size: 10.5px; font-weight: 600; margin-top: 1px; opacity: .95; }

.event-info { min-width: 0; flex: 1; }
.event-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.event-title { margin: 6px 0 5px; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--brand-dark); }
.event-title a { color: inherit; text-decoration: none; }
.event-title a:hover { color: var(--brand); text-decoration: underline; }

.event-meta {
    margin: 0; font-size: 12.5px; color: var(--ink-soft);
    display: flex; flex-wrap: wrap; gap: 3px 12px;
}
.event-when, .event-loc { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.ev-ico { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: #B91C1C; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.event-desc { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Hàng hành động: xem chi tiết + tải tệp đính kèm */
.event-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.event-link, .event-file {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; text-decoration: none;
    padding: 5px 10px; border-radius: 999px; line-height: 1;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.event-link { color: var(--brand); background: var(--brand-light); }
.event-link:hover { background: var(--brand); color: #fff; }
.event-file { color: #B91C1C; background: #FEE2E2; border: 1px solid #FCA5A5; }
.event-file:hover { background: #B91C1C; color: #fff; border-color: #B91C1C; }
.event-file .ev-ico, .event-link .ev-ico { width: 13px; height: 13px; }

/* Nhãn trạng thái + đếm ngược */
.event-status {
    display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700;
}
.event-status.ev-upcoming { background: #FEF3C7; color: #92400E; }   /* sắp diễn ra */
.event-status.ev-ongoing  { background: #DCFCE7; color: #166534; }   /* đang diễn ra */
.event-status.ev-ended    { background: var(--bg-soft); color: var(--ink-soft); } /* đã kết thúc */
.event-countdown {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; color: var(--brand-dark);
    padding: 2px 9px; border-radius: 999px;
    background: var(--brand-light);
}
.event-card.ev-ongoing .event-countdown { color: #166534; background: #DCFCE7; }

/* --- Giới thiệu (AboutLanding): thẻ lãnh đạo có ảnh + liên hệ --------------
   Bổ sung cho các lớp .about-* đã có trong app.css. Ảnh đại diện tròn cùng
   kích thước với vòng tròn chữ cái đầu (66px) để không lệch bố cục khi
   người này có ảnh, người kia chưa có. */
.about-avatar-img {
    width: 66px; height: 66px; border-radius: 50%; object-fit: cover;
    margin: 0 auto 12px; border: 2px solid var(--brand-light);
    background: var(--brand-light);
}

/* Danh sách liên hệ trong thẻ lãnh đạo: email / di động / số nội bộ */
.about-leader-contact {
    list-style: none; margin: 10px 0 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
    font-size: 13.5px; text-align: left;
}
.about-leader-contact li {
    display: flex; align-items: center; gap: 8px;
    color: var(--ink-soft); min-width: 0;
}
.about-leader-ico { flex: 0 0 auto; width: 18px; text-align: center; }
.about-leader-contact a {
    color: var(--ink-soft); text-decoration: none; word-break: break-word;
}
.about-leader-contact a:hover { color: var(--brand); text-decoration: underline; }

/* Nhãn "nội bộ" cạnh số máy lẻ */
.about-leader-tag {
    flex: 0 0 auto; margin-left: auto;
    padding: 1px 8px; border-radius: 999px;
    background: var(--brand-light); color: var(--brand-dark);
    font-size: 11px; font-weight: 700;
}

/* --- Góp ý / Phản hồi (FeedbackBlock): .fb-* ------------------------------
   Thẻ biểu mẫu công khai, static SSR (không JS). Màu chủ đạo lấy từ token
   thương hiệu (--brand #053384); băng trạng thái dùng màu ngữ nghĩa như
   .event-status. Lưới 2 cột thu về 1 cột trên màn hình hẹp. */
.block-feedback { margin-bottom: 40px; }

.fb-head { margin: 0 0 20px; }
.fb-title {
    margin: 0 0 8px; color: var(--brand-dark);
    font-size: clamp(22px, 3vw, 30px); line-height: 1.2;
}
.fb-intro { margin: 0; color: var(--ink-soft); max-width: 70ch; }

/* Băng thông báo kết quả gửi */
.fb-banner {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 0 0 20px; padding: 12px 16px;
    border-radius: var(--radius); font-weight: 600; line-height: 1.45;
}
.fb-banner-ico {
    flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; font-size: 13px; color: #fff;
}
.fb-banner-ok  { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.fb-banner-ok  .fb-banner-ico { background: #16A34A; }
.fb-banner-err { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.fb-banner-err .fb-banner-ico { background: #DC2626; }

/* Thẻ chứa biểu mẫu */
.fb-form {
    background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius); padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 1px 3px rgba(5, 51, 132, .06);
}

/* Bẫy bot: ẩn khỏi mắt người dùng và trình đọc màn hình nhưng vẫn nằm trong DOM */
.fb-hp {
    position: absolute; left: -9999px; top: auto;
    width: 1px; height: 1px; overflow: hidden;
}

/* Lưới 2 cột */
.fb-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
    align-items: stretch;
}
@media (max-width: 720px) {
    .fb-grid { grid-template-columns: 1fr; gap: 20px; }
}

.fb-col {
    border: 0; margin: 0; padding: 0; min-width: 0;
    display: flex; flex-direction: column;
}
.fb-legend {
    padding: 0; margin: 0 0 14px; font-weight: 700; font-size: 15px;
    color: var(--brand-dark); border-bottom: 2px solid var(--brand-light);
    padding-bottom: 8px; width: 100%;
}

.fb-field { margin: 0 0 14px; display: flex; flex-direction: column; }
.fb-field-grow { flex: 1 1 auto; }
.fb-field:last-child { margin-bottom: 0; }
.fb-field > label, .fb-label {
    margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.fb-req { color: #DC2626; }

.fb-field input,
.fb-field textarea {
    width: 100%; padding: 10px 12px; font: inherit;
    color: var(--ink); background: var(--bg);
    border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.fb-field textarea { resize: vertical; min-height: 120px; }
.fb-field-grow textarea { height: 100%; }
.fb-field input:focus,
.fb-field textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* Bộ chọn loại yêu cầu dạng nút phân đoạn (segmented), thuần CSS :checked */
.fb-seg {
    display: inline-flex; flex-wrap: wrap; gap: 0;
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; background: var(--bg-soft);
}
.fb-seg-item { position: relative; margin: 0; }
.fb-seg-item input {
    position: absolute; opacity: 0; width: 0; height: 0;
}
.fb-seg-item span {
    display: block; padding: 9px 18px; cursor: pointer;
    font-size: 14px; font-weight: 600; color: var(--ink-soft);
    border-right: 1px solid var(--line); user-select: none;
    transition: background .15s, color .15s;
}
.fb-seg-item:last-child span { border-right: 0; }
.fb-seg-item:hover span { color: var(--brand-dark); }
.fb-seg-item input:checked + span {
    background: var(--brand); color: #fff;
}
.fb-seg-item input:focus-visible + span {
    outline: 2px solid var(--brand-dark); outline-offset: -2px;
}

/* Ghi chú bảo mật */
.fb-privacy {
    display: flex; align-items: flex-start; gap: 8px;
    margin: 20px 0 0; padding: 10px 14px;
    background: var(--bg-soft); border-radius: var(--radius);
    font-size: 13px; color: var(--ink-soft); line-height: 1.5;
}
.fb-privacy-ico { flex: 0 0 auto; }

/* Nút gửi */
.fb-actions { margin: 20px 0 0; }
.fb-submit {
    appearance: none; border: 0; cursor: pointer;
    padding: 12px 32px; border-radius: var(--radius);
    background: var(--brand); color: #fff;
    font: inherit; font-weight: 700; font-size: 15px;
    transition: background .15s, transform .05s;
}
.fb-submit:hover { background: var(--brand-dark); }
.fb-submit:active { transform: translateY(1px); }
.fb-submit:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 2px; }
@media (max-width: 480px) {
    .fb-submit { width: 100%; }
}

/* ===== Khối Văn bản / Tài liệu (block.documents) — danh sách gọn ===== */
.block-documents .doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line, #e5e9f0); }
.block-documents .doc-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 6px; border-bottom: 1px solid var(--line, #e5e9f0);
}
.block-documents .doc-link { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink, #17233b); font-weight: 500; }
.block-documents .doc-link:hover { color: var(--brand, #1d3f8f); text-decoration: none; }
.block-documents .doc-link:hover .doc-title { text-decoration: underline; }
.block-documents .doc-ico { flex: 0 0 auto; font-size: 16px; }
.block-documents .doc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-documents .doc-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; color: var(--ink-soft, #64708a); font-size: 13px; }
.block-documents .doc-cat { padding: 2px 8px; background: var(--bg-soft, #eef2f8); border-radius: 999px; white-space: nowrap; }
.block-documents .doc-date { white-space: nowrap; }
@media (max-width: 640px) {
    .block-documents .doc-item { flex-direction: column; align-items: flex-start; gap: 4px; }
    .block-documents .doc-meta { font-size: 12px; }
}

/* ===== Khối Liên kết dịch vụ (block.servicelinks) — lưới thẻ ===== */
.block-servicelinks .svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 14px; }
@media (max-width: 599px) {
    .block-servicelinks .svc-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .block-servicelinks .svc-card { padding: 10px 12px; gap: 8px; align-items: flex-start; }
    .block-servicelinks .svc-ico { font-size: 20px; width: 22px; margin-top: 2px; }
}
.block-servicelinks .svc-card {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: #fff; border: 1px solid var(--line, #e5e9f0); border-radius: 12px;
    color: var(--ink, #17233b); transition: border-color .15s, box-shadow .15s, transform .1s;
}
.block-servicelinks .svc-card:hover { border-color: var(--brand, #1d3f8f); box-shadow: 0 6px 18px rgb(4 20 60 / 10%); transform: translateY(-1px); text-decoration: none; }
.block-servicelinks .svc-ico { flex: 0 0 auto; font-size: 24px; line-height: 1; color: var(--brand, #1d3f8f); width: 30px; text-align: center; }
.block-servicelinks .svc-body { display: flex; flex-direction: column; min-width: 0; }
.block-servicelinks .svc-title { font-weight: 600; }
.block-servicelinks .svc-desc { color: var(--ink-soft, #64708a); font-size: 13px; margin-top: 2px; }
.block-servicelinks .svc-ext { flex: 0 0 auto; margin-left: auto; color: var(--ink-soft, #8595b0); font-size: 14px; }

/* Khối Lịch trực (Duty) */
.block-duty .duty-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.block-duty .duty-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.block-duty .duty-table thead th {
    text-align: left; padding: 10px 14px; background: var(--brand, #1d3f8f); color: #fff;
    font-weight: 600; white-space: nowrap;
}
.block-duty .duty-table thead th:first-child { border-top-left-radius: 8px; }
.block-duty .duty-table thead th:last-child { border-top-right-radius: 8px; }
.block-duty .duty-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--line, #e5e9f2); vertical-align: top; }
.block-duty .duty-table tbody tr:nth-child(even) { background: var(--surface-2, #f5f7fc); }
.block-duty .duty-table tbody tr:hover { background: #eef3ff; }
.block-duty .duty-table tbody td:first-child { font-weight: 600; white-space: nowrap; }

/* Khối Lịch trực đơn vị (tự động) — dùng lại toàn bộ style .duty-* trong app.css; chỉ thêm nút xem đầy đủ */
.block-lichtruc .lichtruc-more { margin-top: 14px; text-align: right; }

/* Khối Nhúng (Embed) — khung iframe cách ly, bo góc, chiều cao do quản trị đặt (đã kẹp 200–900px) */
.block-embed .embed-wrap {
    position: relative; width: 100%; overflow: hidden;
    border: 1px solid var(--line, #e5e9f2); border-radius: 10px; background: var(--surface-2, #f5f7fc);
}
.block-embed .embed-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Khối Album ảnh — lưới ảnh đồng bộ khung vuông + lightbox thuần CSS (:target).
   Tự co theo bề rộng (auto-fill): cột chính nhiều cột, cột phải hẹp ít cột. */
.block-album .album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; overflow: visible; }
.block-album .album-thumb {
    display: block; aspect-ratio: 1/1; overflow: hidden; border-radius: 10px; border: 1px solid var(--line, #e4eaf2);
    cursor: zoom-in; transition: transform .22s ease, box-shadow .22s ease; will-change: transform;
}
.block-album .album-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Hover: PHÓNG TO nổi lên trên các ảnh khác để xem rõ (vẫn bấm để mở lớn toàn màn hình) */
.block-album .album-thumb:hover {
    transform: scale(1.35); z-index: 6; position: relative;
    box-shadow: 0 14px 40px rgb(6 12 30 / 32%); border-color: var(--brand, #1d3f8f);
}
.block-album .album-lightbox {
    position: fixed; inset: 0; z-index: 1000; display: none;
    background: rgb(6 12 30 / 92%); align-items: center; justify-content: center; padding: 24px;
}
.block-album .album-lightbox:target { display: flex; }
.block-album .album-lb-fig { margin: 0; max-width: 92vw; max-height: 90vh; text-align: center; }
.block-album .album-lb-fig img { max-width: 92vw; max-height: 82vh; object-fit: contain; border-radius: 8px; }
.block-album .album-lb-fig figcaption { color: #e5edf7; margin-top: 8px; font-size: 14px; }
.block-album .album-lb-close, .block-album .album-lb-nav {
    position: absolute; color: #fff; background: rgb(255 255 255 / 14%); border-radius: 50%;
    width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; text-decoration: none;
}
.block-album .album-lb-close { top: 20px; right: 24px; }
.block-album .album-lb-nav { top: 50%; transform: translateY(-50%); }
.block-album .album-lb-prev { left: 20px; }
.block-album .album-lb-next { right: 20px; }
.block-album .album-lb-close:hover, .block-album .album-lb-nav:hover { background: rgb(255 255 255 / 28%); }

/* Khối Video — khung TỈ LỆ 16:9 (tự co theo bề rộng → đặt ở cột phải hẹp vẫn đúng tỉ lệ, không méo) */
.block-video .video-wrap {
    position: relative; width: 100%; aspect-ratio: 16 / 9; height: auto; overflow: hidden; border-radius: 10px;
    background: #000; border: 1px solid var(--line, #e4eaf2);
}
.block-video .video-wrap iframe, .block-video .video-wrap video {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; object-fit: contain; background: #000;
}

/* Khối Đối tác — dải logo chạy ngang liên tục (marquee thuần CSS), khung nhỏ nền trắng, logo canh giữa contain */
.block-partners .pt-viewport { overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.block-partners .pt-track { display: flex; gap: 18px; width: max-content; animation: pt-scroll var(--pt-duration, 30s) linear infinite; }
.block-partners .pt-viewport:hover .pt-track { animation-play-state: paused; }
/* Cỡ ô logo theo --pt-h (cấu hình "height" của khối, mặc định 90px); rộng = cao × 1,78 (giữ tỷ lệ 16:9 như trước, tối thiểu 120px).
   LỖI CŨ: ô dùng display:grid nên "max-height:100%" của ảnh KHÔNG có hiệu lực (hàng lưới tự co) → logo vuông bị vẽ 138×138 trong ô cao 90px,
   tràn xuống dưới và bị .pt-viewport (overflow:hidden) cắt mất phần dưới. Nay dùng flex + chiều cao ô xác định → ảnh luôn nằm gọn trong ô. */
.block-partners { --pt-h: 90px; }
.block-partners .pt-logo {
    flex: 0 0 auto; box-sizing: border-box; height: var(--pt-h); width: max(120px, calc(var(--pt-h) * 1.78));
    background: #fff; border: 1px solid var(--line, #e4eaf2);
    border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden;
}
.block-partners .pt-logo img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; filter: none; }
@keyframes pt-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .block-partners .pt-track { animation: none; flex-wrap: wrap; } }
/* Di động: thu nhỏ theo tỷ lệ (mặc định 90px → 74px như cũ) */
@media (max-width: 640px) { .block-partners .pt-logo { height: calc(var(--pt-h) * .82); width: max(104px, calc(var(--pt-h) * .82 * 1.78)); } }

/* --- Tin tuyển dụng (JobPostings): bảng việc làm, mỗi dòng mở PDF thông báo ------ */
.block-jobs { margin-bottom: 40px; }
.job-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.job-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; table-layout: fixed; }
/* Phân bổ độ rộng cột: Đơn vị & Vị trí rộng hơn để tên dài không bị dồn cục */
.job-table col.col-employer { width: 24%; }
.job-table col.col-position { width: 20%; }
.job-table col.col-majors   { width: 21%; }
.job-table col.col-province { width: 12%; }
.job-table col.col-salary   { width: 13%; }
.job-table col.col-date     { width: 10%; }
.job-table th, .job-table td { overflow-wrap: break-word; word-break: normal; }
.job-table thead th {
    background: var(--brand); color: #fff; text-align: left; font-weight: 600;
    padding: 12px 14px; white-space: nowrap;
}
.job-table tbody td { padding: 11px 14px; border-top: 1px solid var(--line); color: var(--ink-soft); vertical-align: top; }
.job-table tbody tr:nth-child(even) { background: var(--bg-soft); }
.job-table tbody tr:hover { background: var(--brand-light); }
.job-col-date { white-space: nowrap; }
.job-majors { max-width: 260px; }

.job-employer {
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
    color: var(--brand-dark); font-weight: 700; text-decoration: none;
}
.job-employer:hover { color: var(--brand); text-decoration: underline; }
.job-pdf {
    flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .02em;
    color: #B91C1C; background: #FEE2E2; border: 1px solid #FCA5A5;
    padding: 1px 7px; border-radius: 999px; text-decoration: none;
}

.job-more { margin-top: 14px; text-align: right; }
.job-more-link { color: var(--brand); font-weight: 600; text-decoration: none; }
.job-more-link:hover { text-decoration: underline; }

/* Bộ lọc theo tỉnh trên trang /tuyen-dung — dropdown gọn, co giãn tốt khi nhiều tỉnh */
.job-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 20px; }
.job-filter-field { display: flex; flex-direction: column; gap: 5px; }
.job-filter-field label { font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.job-select-wrap { position: relative; }
.job-select-wrap::after {
    content: "▾"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    pointer-events: none; color: var(--ink-soft); font-size: 12px;
}
.job-filter select {
    appearance: none; -webkit-appearance: none;
    min-width: 240px; padding: 9px 34px 9px 14px; font: inherit; font-size: 14px;
    color: var(--ink); background: var(--bg); cursor: pointer;
    border: 1px solid var(--line); border-radius: 10px;
}
.job-filter select:hover { border-color: var(--brand); }
.job-filter select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
/* Ô tìm kiếm từ khóa (lọc mọi cột) */
.job-filter-grow { flex: 1 1 240px; }
.job-filter input[type="search"] {
    width: 100%; padding: 9px 14px; font: inherit; font-size: 14px;
    color: var(--ink); background: var(--bg);
    border: 1px solid var(--line); border-radius: 10px;
}
.job-filter input[type="search"]:hover { border-color: var(--brand); }
.job-filter input[type="search"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.job-filter-count { align-self: flex-end; padding-bottom: 9px; font-size: 13.5px; color: var(--ink-soft); }
.job-filter-count strong { color: var(--brand-dark); }
.job-filter-clear {
    padding: 9px 14px; font-size: 13.5px; font-weight: 600; text-decoration: none;
    color: var(--ink-soft); border: 1px solid var(--line); border-radius: 10px;
}
.job-filter-clear:hover { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }

.pager-info { font-size: 14px; color: var(--ink-soft); }

/* Điện thoại + máy tính bảng dọc: bảng đổ về THẺ — mỗi tin một thẻ, mỗi ô một dòng "Nhãn : Giá trị".
   Phải bỏ table-layout:fixed + colgroup (nếu không bảng vẫn ép theo % cột → chữ vỡ từng chữ). */
@media (max-width: 768px) {
    .job-table-wrap { overflow-x: visible; border: 0; border-radius: 0; }
    .job-table { display: block; width: 100%; min-width: 0; table-layout: auto; font-size: 13.5px; }
    .job-table colgroup { display: none; }
    .job-table thead { display: none; }
    .job-table tbody { display: block; width: 100%; }
    .job-table tbody tr {
        display: block; width: 100%; box-sizing: border-box;
        border: 1px solid var(--line); border-radius: 12px;
        margin-bottom: 12px; padding: 4px 2px; background: var(--bg) !important;
    }
    .job-table tbody tr:nth-child(even) { background: var(--bg) !important; }
    .job-table tbody td {
        display: flex; gap: 12px; align-items: baseline;
        width: 100%; box-sizing: border-box;
        border: 0; padding: 8px 14px; color: var(--ink); vertical-align: baseline;
    }
    .job-table tbody td + td { border-top: 1px solid var(--line); }
    .job-table tbody td::before {
        content: attr(data-label); flex: 0 0 38%; max-width: 132px;
        font-weight: 700; color: var(--brand-dark); text-align: left; line-height: 1.35;
    }
    /* Giá trị chiếm phần còn lại, xuống dòng theo TỪ (không vỡ từng ký tự). */
    .job-table tbody td > *, .job-table tbody td { min-width: 0; overflow-wrap: break-word; }
    .job-employer, .job-col-date { white-space: normal; }
    .job-majors { max-width: none; }
}

/* --- Đăng ký tình nguyện (VolunteerBlock): .vol-* -------------------------
   Khối yêu cầu đăng nhập email trường; hiển thị lời mời + nút đăng nhập cho
   khách, hoặc phiếu 10 câu cho người đã đăng nhập. Màu từ token thương hiệu. */
.block-volunteer { margin-bottom: 40px; }
.vol-head { margin: 0 0 18px; }
.vol-title {
    margin: 0 0 8px; color: var(--brand-dark);
    font-size: clamp(22px, 3vw, 30px); line-height: 1.2;
}
.vol-intro { margin: 0; color: var(--ink-soft); max-width: 80ch; line-height: 1.55; }

.vol-banner {
    display: flex; align-items: flex-start; gap: 9px;
    margin: 0 0 18px; padding: 12px 16px;
    border-radius: var(--radius); font-weight: 600; line-height: 1.45;
}
.vol-ok   { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.vol-err  { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.vol-info { background: #E0F2FE; color: #075985; border: 1px solid #7DD3FC; }
.vol-note {
    padding: 14px 16px; background: var(--bg-soft); border: 1px dashed var(--line);
    border-radius: var(--radius); color: var(--ink-soft);
}

/* Lời mời đăng nhập */
.vol-login {
    background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius); padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 1px 3px rgba(5, 51, 132, .06);
}
.vol-login-lead { margin: 0 0 16px; font-size: 15.5px; color: var(--ink); }
.vol-login-actions { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.vol-login-err { margin: 14px 0 0; color: #991B1B; font-weight: 600; }

.vol-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px; border-radius: var(--radius);
    font-weight: 600; font-size: 15px; text-decoration: none;
    border: 1px solid var(--line); background: var(--bg); color: var(--ink);
    transition: border-color .15s, box-shadow .15s, transform .05s;
}
.vol-btn:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(5,51,132,.10); }
.vol-btn:active { transform: translateY(1px); }
.vol-btn-ico { font-size: 20px; flex: 0 0 auto; }
.vol-btn-ms { border-color: #0067B8; }
.vol-btn-ms:hover { background: #F0F7FF; }
.vol-btn-gg { border-color: #DB4437; }
.vol-btn-gg:hover { background: #FEF4F2; }
.vol-btn-back { display: inline-flex; }
/* Nút "sắp mở" (nhà cung cấp chưa bật) — hiển thị để thấy luồng, nhưng vô hiệu hóa. */
.vol-btn-soon { cursor: not-allowed; opacity: .6; background: var(--bg-soft); }
.vol-btn-soon:hover { box-shadow: none; }
.vol-btn-soon em { font-style: normal; font-weight: 700; color: #B45309; }

/* Thanh danh tính */
.vol-who {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 18px; padding: 11px 15px;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
    font-size: 14px; color: var(--ink);
}
.vol-who-ico { flex: 0 0 auto; }
.vol-signout { margin: 0 0 0 auto; }
.vol-signout-btn {
    font: inherit; font-size: 13px; cursor: pointer;
    background: transparent; border: 1px solid var(--line); border-radius: 8px;
    padding: 6px 12px; color: var(--ink-soft);
}
.vol-signout-btn:hover { border-color: var(--brand); color: var(--brand-dark); }

/* Thẻ phiếu */
.vol-form {
    background: var(--bg); border: 1px solid var(--line);
    border-radius: var(--radius); padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 1px 3px rgba(5, 51, 132, .06);
}
.vol-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; margin: 0 0 6px;
}
@media (max-width: 720px) { .vol-grid { grid-template-columns: 1fr; } }

.vol-field { display: flex; flex-direction: column; min-width: 0; }
.vol-field > label, .vol-label {
    margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.vol-req { color: #DC2626; }
.vol-hint { font-weight: 400; color: var(--ink-soft); font-size: 13px; }
.vol-field input[type=text], .vol-field input[type=email],
.vol-field input[type=tel], .vol-field input[type=date] {
    width: 100%; padding: 10px 12px; font: inherit;
    color: var(--ink); background: var(--bg);
    border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .15s, box-shadow .15s;
}
.vol-field input:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.vol-readonly { background: var(--bg-soft); color: var(--ink-soft); cursor: not-allowed; }
.vol-radios { display: flex; gap: 20px; padding: 8px 0; }
.vol-radios label { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }

/* Nhóm ô lựa chọn (khoa/trường, kỹ năng) */
.vol-fs {
    border: 1px solid var(--line); border-radius: var(--radius);
    margin: 18px 0 0; padding: 14px 16px 16px; min-width: 0;
}
.vol-fs > legend {
    padding: 0 8px; font-weight: 700; font-size: 14.5px; color: var(--brand-dark);
}
.vol-checks { display: grid; gap: 8px 18px; }
.vol-checks-2 { grid-template-columns: 1fr 1fr; }
.vol-checks-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 860px) { .vol-checks-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .vol-checks-2, .vol-checks-3 { grid-template-columns: 1fr; } }
.vol-check {
    display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink);
    line-height: 1.35;
}
.vol-check input[type=checkbox], .vol-check input[type=radio] { flex: 0 0 auto; width: 16px; height: 16px; }
.vol-check-other { grid-column: 1 / -1; flex-wrap: wrap; }
.vol-check-other input[type=text] {
    flex: 1 1 200px; padding: 7px 10px; font: inherit; min-width: 160px;
    border: 1px solid var(--line); border-radius: 8px;
}

/* Ma trận thời gian */
.vol-matrix-wrap { overflow-x: auto; margin-top: 6px; }
.vol-matrix { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
.vol-matrix th, .vol-matrix td {
    border: 1px solid var(--line); padding: 8px 6px; text-align: center;
}
.vol-matrix thead th { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; }
.vol-matrix tbody th { background: var(--bg-soft); font-weight: 700; color: var(--ink); text-align: left; padding-left: 12px; }
.vol-matrix td input { width: 18px; height: 18px; cursor: pointer; }

.vol-actions { margin: 22px 0 0; }
.vol-submit {
    font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
    background: var(--brand); color: #fff; border: 0; border-radius: var(--radius);
    padding: 13px 28px; transition: background .15s, box-shadow .15s;
}
.vol-submit:hover { background: var(--brand-dark); box-shadow: 0 3px 12px rgba(5,51,132,.22); }

/* ============================================================================
   NÚT THEO BỘ GIAO DIỆN cho khối chèn HTML / RichText.
   Nội dung HTML tuỳ ý (khối "Html", "RichText") nếu tô MÀU CỨNG sẽ KHÔNG đổi
   theo Bộ giao diện. Dùng các lớp dưới đây (sanitizer giữ thuộc tính class) để
   nút/nhãn tự đổi màu theo theme: <a class="btn btn-primary">…</a>.
   Hoặc dùng biến trực tiếp trong <style>/style: var(--brand), var(--brand-dark).
   ============================================================================ */
.block-html .btn, .block-richtext .btn, .btn-brand {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px;
    border-radius: 8px; font-weight: 600; font-size: 14px; line-height: 1.2;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.block-html .btn-primary, .block-richtext .btn-primary, .btn-brand {
    background: var(--brand); color: #fff; border-color: var(--brand);
}
.block-html .btn-primary:hover, .block-richtext .btn-primary:hover, .btn-brand:hover {
    background: var(--brand-dark); border-color: var(--brand-dark); color: #fff;
}
.block-html .btn-outline, .block-richtext .btn-outline {
    background: transparent; color: var(--brand); border-color: var(--brand);
}
.block-html .btn-outline:hover, .block-richtext .btn-outline:hover {
    background: var(--brand-light);
}
/* Tiện ích màu chữ/nền theo thương hiệu, dùng được trong nội dung HTML */
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff !important; }

/* ===== Khối "Tabs" (widget tiêu điểm nhiều tab) ============================
   Chuyển tab bằng CSS THUẦN (radio + label) — chạy trong trang SSR có đệm, KHÔNG cần JS.
   Thứ tự DOM mỗi tab: input.tabs-radio → label.tabs-tab → div.tabs-panel (liền kề để selector "+").
   flex-wrap:wrap + order: dồn mọi NHÃN (order 1) lên hàng đầu, mọi PANEL (order 2, width 100%) xuống dưới. */
.block-tabs .tabs-widget { display: flex; flex-wrap: wrap; gap: 0; }
.block-tabs .tabs-radio {
    position: absolute; width: 1px; height: 1px; opacity: 0;        /* ẩn nhưng vẫn nhận focus bàn phím */
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.block-tabs .tabs-tab {
    order: 1;                                                        /* mọi nhãn lên hàng đầu */
    padding: 11px 18px; cursor: pointer; font-weight: 600; white-space: nowrap;
    color: var(--ink-soft); border-bottom: 1px solid var(--line);   /* các nhãn kề nhau tạo gạch dưới liền */
    user-select: none; transition: color .15s, background .15s, box-shadow .15s;
}
.block-tabs .tabs-tab:hover { color: var(--brand); background: var(--brand-light); }
.block-tabs .tabs-panel {
    order: 2; width: 100%; display: none; padding-top: 22px;        /* panel xuống dưới hàng nhãn */
}
/* Tab đang chọn: tô đậm nhãn + vạch 3px (dùng box-shadow để KHÔNG đổi chiều cao nhãn) + hiện panel liền sau */
.block-tabs .tabs-radio:checked + .tabs-tab {
    color: var(--brand); box-shadow: inset 0 -3px 0 var(--bb3);
}
.block-tabs .tabs-radio:checked + .tabs-tab + .tabs-panel { display: block; }
.block-tabs .tabs-radio:focus-visible + .tabs-tab { outline: 3px solid var(--accent); outline-offset: -3px; }
.block-tabs .tabs-panel .empty-state { margin: 0; }

/* ===== Khối "Bộ đếm số liệu" (StatCounter) ================================= */
.block-statcounter .stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
}
.block-statcounter .stat-card {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    text-align: center; gap: 4px; padding: 22px 14px;
    background: var(--brand-light, #eef3fb); border: 1px solid var(--line, #e5e9f0);
    border-radius: 14px; transition: transform .12s, box-shadow .15s;
}
.block-statcounter .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgb(4 20 60 / 10%); }
.block-statcounter .stat-ico { font-size: 42px; line-height: 1; margin-bottom: 6px; color: var(--brand, #053384); }
.block-statcounter .stat-ico i { display: block; }
.block-statcounter .stat-ico svg { width: 46px; height: 46px; display: block; }   /* tương thích dữ liệu cũ (nếu có SVG) */
.block-statcounter .stat-num {
    font-size: 34px; font-weight: 800; line-height: 1.05; color: var(--brand, #053384);
    font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.block-statcounter .stat-label { font-size: 14px; color: var(--ink-soft, #51607a); font-weight: 600; }
@media (max-width: 520px) {
    .block-statcounter .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .block-statcounter .stat-num { font-size: 28px; }
}

/* --- Khối Số liệu có NỀN CHÌM (tuỳ chọn; chỉ áp khi khối có ảnh nền → khối cũ KHÔNG đổi) ---
   Ảnh <img.stat-bg> phủ kín; lớp phủ ::before (màu --sb-tint, độ đặc --sb-ov) làm "chìm" ảnh để chữ luôn đọc được. */
.block-statcounter.has-bg { position: relative; isolation: isolate; padding: 40px 20px 48px; border-radius: 16px; overflow: hidden; }
.block-statcounter.has-bg .stat-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.block-statcounter.has-bg::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(var(--sb-tint, 255 255 255) / var(--sb-ov, .8)); }
.block-statcounter.has-bg .stat-label { color: var(--ink, #0e1726); }   /* nhãn đậm hơn → đạt tương phản ≥ 4,5:1 trên nền ảnh */
.block-statcounter.stat-plain .stat-card { background: transparent; border-color: transparent; box-shadow: none; }
.block-statcounter.stat-plain .stat-card:hover { transform: none; }
/* Tràn hết chiều ngang trang: kéo ra khỏi khung nội dung, nội dung bên trong vẫn gói trong khung ≤1160px. */
.block-statcounter.stat-full { margin-inline: calc(50% - 50vw); border-radius: 0; padding-inline: 0; }
.block-statcounter.stat-full > :not(.stat-bg) { position: relative; max-width: 1160px; margin-inline: auto; padding-inline: 20px; }
/* 100vw gồm cả thanh cuộn dọc → chặn cuộn ngang thừa, CHỈ ở trang thực sự có dải tràn (clip không tạo vùng cuộn nên header sticky vẫn chạy). */
html:has(.block-statcounter.stat-full), body:has(.block-statcounter.stat-full) { overflow-x: clip; }
/* Trong bố cục NHIỀU CỘT (.page-cols) khối nằm trong một cột hẹp → KHÔNG kéo tràn trang (50%-50vw chỉ đúng khi cột là khung giữa toàn chiều rộng). */
.page-cols .block-statcounter.stat-full { margin-inline: 0; border-radius: 16px; padding-inline: 20px; }
.page-cols .block-statcounter.stat-full > :not(.stat-bg) { max-width: none; padding-inline: 0; }
/* Số cột cố định (mặc định "tự động" = như cũ) — tự giảm khi màn hình hẹp. */
.block-statcounter.stat-cols-4 .stat-grid { grid-template-columns: repeat(4, 1fr); }
.block-statcounter.stat-cols-6 .stat-grid { grid-template-columns: repeat(6, 1fr); }
.block-statcounter.stat-cols-8 .stat-grid { grid-template-columns: repeat(8, 1fr); gap: 8px 18px; }
@media (max-width: 1000px) {
    .block-statcounter.stat-cols-8 .stat-grid { grid-template-columns: repeat(4, 1fr); }
    .block-statcounter.stat-cols-6 .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .block-statcounter.stat-cols-4 .stat-grid, .block-statcounter.stat-cols-6 .stat-grid, .block-statcounter.stat-cols-8 .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .block-statcounter.has-bg { padding: 28px 12px 34px; }
    .block-statcounter.stat-full { padding-inline: 0; }
}

/* --- ArticleList style="list": danh sách gọn (tiêu đề + ngày) ------------- */
.article-list-compact { list-style: none; margin: 0; padding: 0; }
.article-list-compact li { padding: 9px 0; border-bottom: 1px dotted var(--line, #d6dbe3); display: flex; flex-direction: column; gap: 2px; }
.article-list-compact li:last-child { border-bottom: 0; }
.article-list-compact a { font-weight: 600; line-height: 1.4; color: var(--brand); }
.article-list-compact time { font-size: 12.5px; color: var(--ink-soft); }

/* --- Dải banner dọc (Html block trong cột phụ): ảnh xếp dọc, canh giữa ------ */
.side-banners { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.side-banners a { display: block; line-height: 0; }
.side-banners img { width: 100%; max-width: 170px; height: auto; border-radius: 6px; }

/* ---------- Khối "Nút tư vấn nhanh" (ContactFloat): Messenger · Zalo · Email · Gọi điện ---------- */
.block-contactfloat {
    /* Màu thương hiệu CỦA DỊCH VỤ BÊN THỨ BA (Messenger/Zalo) + nút gọi. Không liên quan vạch 3 màu TVU (--bb*, AI_RULES BR-9). */
    --cf-messenger: #0084ff;   /* [NGOÀI TVU] xanh Messenger */
    --cf-zalo:      #0068ff;   /* [NGOÀI TVU] xanh Zalo */
    --cf-facebook:  #1877f2;   /* [NGOÀI TVU] xanh Facebook */
    --cf-tiktok:    #111111;   /* [NGOÀI TVU] đen TikTok */
    --cf-youtube:   #cc0000;   /* [NGOÀI TVU] đỏ YouTube (trắng/đỏ 6,5:1) */
    --cf-email:     var(--brand, #053384);
    --cf-phone:     #c62828;   /* [PHÁI SINH] đỏ nút gọi — trắng/đỏ đạt 5,6:1 */
    --cf-size: 56px;
    display: flex; gap: 12px; margin: 0;
}
.cf-float { position: fixed; z-index: 55; flex-direction: column; margin: 0; }   /* dưới nút "lên đầu trang" (z 60) */
.cf-float.cf-bottom-right { right: var(--cf-x, 18px); bottom: var(--cf-y, 96px); align-items: flex-end; }
.cf-float.cf-bottom-left  { left:  var(--cf-x, 18px); bottom: var(--cf-y, 24px); align-items: flex-start; }
.cf-float.cf-middle-right { right: var(--cf-x, 18px); top: 50%; transform: translateY(-50%); align-items: flex-end; }
.cf-float.cf-middle-left  { left:  var(--cf-x, 18px); top: 50%; transform: translateY(-50%); align-items: flex-start; }
.cf-inline { flex-wrap: wrap; align-items: center; margin-block: 18px; }
.cf-heading { flex: 1 0 100%; margin: 0 0 2px; font-weight: 700; color: var(--brand); }

.cf-btn {
    position: relative; width: var(--cf-size); height: var(--cf-size); border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-size: 26px; line-height: 1; text-decoration: none;
    border: 2px solid rgb(255 255 255 / 88%);
    box-shadow: 0 6px 18px rgb(16 32 48 / 30%); transition: transform .15s ease;
}
.cf-btn:hover { transform: scale(1.08); color: #fff; text-decoration: none; }
.cf-btn:focus-visible { outline: 3px solid var(--brand-yellow, #ff0); outline-offset: 3px; }
.cf-messenger { background: var(--cf-messenger); --cf-ring: rgb(0 132 255 / 55%); }
.cf-zalo      { background: var(--cf-zalo);      --cf-ring: rgb(0 104 255 / 55%); }
.cf-email     { background: var(--cf-email);     --cf-ring: rgb(5 51 132 / 45%); }
.cf-facebook  { background: var(--cf-facebook);  --cf-ring: rgb(24 119 242 / 50%); }
.cf-tiktok    { background: var(--cf-tiktok);    --cf-ring: rgb(17 17 17 / 40%); }
.cf-youtube   { background: var(--cf-youtube);   --cf-ring: rgb(204 0 0 / 50%); }
.cf-zalo-word { font-weight: 800; font-size: 16px; letter-spacing: -.3px; font-family: system-ui, "Segoe UI", Roboto, Arial, sans-serif; }

/* Gọi điện: viên thuốc có SỐ (như mẫu) hoặc nút tròn chỉ icon */
.cf-phone {
    --cf-ring: rgb(198 40 40 / 55%);
    width: auto; min-width: var(--cf-size); padding: 0 22px 0 5px; gap: 10px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: flex-start;
    background: var(--cf-phone); font-weight: 700; font-size: 18px; letter-spacing: .2px; white-space: nowrap;
}
.cf-phone i { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 18%); font-size: 20px; flex: none; }
.cf-phone-circle .cf-phone { width: var(--cf-size); padding: 0; justify-content: center; }
.cf-phone-circle .cf-phone i { background: none; width: auto; height: auto; }
.cf-phone-circle .cf-phone-num { display: none; }

/* Vòng sóng lan tỏa thu hút chú ý (tắt khi người dùng chọn giảm chuyển động) */
@keyframes cf-ring {
    0%   { box-shadow: 0 6px 18px rgb(16 32 48 / 30%), 0 0 0 0 var(--cf-ring); }
    70%  { box-shadow: 0 6px 18px rgb(16 32 48 / 30%), 0 0 0 16px transparent; }
    100% { box-shadow: 0 6px 18px rgb(16 32 48 / 30%), 0 0 0 0 transparent; }
}
.cf-pulse .cf-btn { animation: cf-ring 2.4s ease-out infinite; }
.cf-pulse .cf-btn:nth-child(2) { animation-delay: .4s; }
.cf-pulse .cf-btn:nth-child(3) { animation-delay: .8s; }
.cf-pulse .cf-btn:nth-child(4) { animation-delay: 1.2s; }
.cf-pulse .cf-btn:nth-child(5) { animation-delay: 1.6s; }
.cf-pulse .cf-btn:nth-child(n+6) { animation-delay: 2s; }
@media (prefers-reduced-motion: reduce) { .cf-pulse .cf-btn { animation: none; } .cf-btn { transition: none; } }
@media (max-width: 480px) {
    .cf-float { --cf-size: 50px; gap: 10px; }
    .cf-phone { font-size: 16px; padding-right: 16px; }
    .cf-phone i { width: 40px; height: 40px; }
}
@media print { .cf-float { display: none; } }

/* Màu THEO GIAO DIỆN (màu chủ đạo của đơn vị) hoặc màu TÙY CHỌN — thay cho màu thương hiệu từng mạng */
.cf-theme .cf-btn { background: var(--brand); --cf-ring: color-mix(in srgb, var(--brand) 55%, transparent); }
.cf-theme .cf-btn.cf-phone { background: var(--brand-dark, var(--brand)); }
.cf-custom .cf-btn { background: var(--cf-custom); color: var(--cf-custom-text, #fff); border-color: color-mix(in srgb, var(--cf-custom-text, #fff) 70%, transparent);
    --cf-ring: color-mix(in srgb, var(--cf-custom) 55%, transparent); }
.cf-custom .cf-btn:hover { color: var(--cf-custom-text, #fff); }
.cf-custom .cf-btn.cf-phone i { background: color-mix(in srgb, var(--cf-custom-text, #fff) 18%, transparent); }
