/* ==========================================================================
   NDLA SYSTEM LAYER
   Nạp SAU CSS từng trang (lich-am / lich-ngay / lich-tuan / lich-nam / tu-vi…)
   để chuẩn hoá theo design tokens ở theme style.css mà không phải viết lại
   ~6.000 dòng CSS gốc. Cùng độ đặc hiệu + nạp sau ⇒ thắng, kể cả rule trong
   @media của file gốc. Không dùng !important.

   1. Token bổ sung       4. Nút / vùng chạm 44px
   2. Sàn cỡ chữ          5. Trang chủ (lich-am)
   3. Nhãn & tương phản   6. Mobile
   ========================================================================== */

/* 1. TOKEN — đè --ink-mute cũ (#7A6249, 4.7:1) của plugin bằng bản đạt 5.8:1 */
:root {
  --ink-mute: #6B5440;
  --gold-text: #6E5617;
  --ink-60: #6B5440;
}

/* 2. SÀN CỠ CHỮ
   Tiếng Việt có dấu chồng (ữ, ặ, ỗ) — dưới 11px dấu dính vào nhau.
   Nhãn: tối thiểu 12px. Số âm lịch phụ trong ô lịch: 11px. */
.duong-label, .am-label, .status-label, .status-badge .sm,
.canchi-item .lbl, .age-cell .lbl, .dc-duong-label, .dc-am-label,
.hour-cell .rng, .hour-cell .sao-name, .mgd-day-wkd, .gd-ld-badge,
.zod-years, .hours-cell .t, .nh-stars-label, .cb-ev-src,
.mini-cal-legend, .chs-h-label, .tg-time, .tg-badge, .dc-badge,
.dc-row .k, .selector-row .badge-now,
.tv-lucky-title, .tv-reco-title, .tv-hour-pill small,
.months-table thead th, .weeks-table thead th {
  font-size: 12px;
}
.cw-cal-cell .da, .cal-cell .d-am, .mc-cell .da, .mn-cell .am,
.weeks-table tbody td .am, .cw-wkd, .mn-wkd, .mc-wkd,
.weeks-table tbody td {
  font-size: 11px;
}
.hour-cell.now::after { font-size: 11px; }

/* 3. NHÃN & TƯƠNG PHẢN
   Bỏ kiểu "CHỮ HOA giãn rộng" cho nhãn nhỏ — đọc chậm với tiếng Việt và là
   dấu hiệu template. Giữ chữ thường, đậm vừa, màu mực nhạt. */
.hero-eyebrow,
.duong-label, .am-label, .status-label, .status-badge .sm,
.canchi-item .lbl, .age-cell .lbl, .dc-duong-label, .dc-am-label,
.tv-lucky-title, .tv-reco-title, .mc-wkd {
  text-transform: none;
  letter-spacing: 0.01em;
}
.hero-eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: var(--vermilion-deep);
}
.duong-label, .am-label, .status-label, .canchi-item .lbl,
.age-cell .lbl, .dc-duong-label, .dc-am-label,
.tv-lucky-title, .tv-reco-title {
  font-weight: 600;
  color: var(--ink-mute);
}

/* Chữ màu kim trên nền giấy chỉ đạt 2.4:1 → dùng kim đậm */
.cw-info-am-day { color: var(--gold-text); }
.tg-time, .hours-cell .t { color: var(--ink-mute); }

/* 4. NÚT / VÙNG CHẠM */
.cw-nav-row button { min-height: 44px; }
.cw-cal-nav { gap: 4px; flex-wrap: wrap; }
.cw-cal-nav button {
  width: 36px; height: 36px;
  font-size: 14px;
  cursor: pointer;
}
.cw-cal-select { min-height: 36px; }
.mgd-filter { min-height: 36px; }

/* Chuyển màu thay cho "transition: all" — không đổi kích thước khi hover */
.cw-nav-row button, .cw-cal-nav button, .mgd-filter, .conv-btn {
  transition: background-color var(--dur-fast, 150ms), color var(--dur-fast, 150ms), border-color var(--dur-fast, 150ms);
}

/* 5. TRANG CHỦ — khoảnh khắc chính: con số ngày như tờ lịch bloc */
.cw-big-day {
  font-size: clamp(76px, 9vw, 104px);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums;
}
.cw-weekday {
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 17px;
}

/* Khoảng trống giữa widget và "Giờ hoàng đạo" từng ~110px */
.ndla-page-lich-am .hero { padding-bottom: 0; }
.hours-section { margin-top: 0; padding-top: 40px; }

/* Đoạn mô tả dưới tiêu đề: giới hạn độ dài dòng */
.section-sub, .hero-sub { max-width: 43.3em; } /* = 64ch Be Vietnam Pro, em để không đổi khung khi đổi font */

/* 6. MOBILE */
@media (max-width: 540px) {
  .cw-big-day { font-size: 80px; }
  .cw-cal-footer {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .cw-cal-nav button { width: 40px; height: 40px; }
  .cw-banner-arrow { width: 36px; height: 36px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 26px; line-height: 1.15; }
  .hero-sub { font-size: 15px; }
}

/* ==========================================================================
   7. ẤN TRIỆN — thay emoji 12 con giáp & ngũ hành (xem assets/js/ndla-icons.js)
   Kích thước theo em ⇒ tự co giãn theo font-size của khung chứa cũ.
   ========================================================================== */
.ndla-seal {
  display: inline-grid;
  place-items: center;
  width: 1.4em;
  height: 1.4em;
  font-size: 0.8em;           /* ô ≈ 1.12em của khung cha, chữ ≈ 0.8em */
  font-family: 'Noto Emoji', 'Segoe UI Symbol', sans-serif;
  font-weight: 500;
  font-style: normal;
  line-height: 1;
  color: var(--paper-light);
  background: var(--vermilion);
  border-radius: 0.14em;
  box-shadow: inset 0 0 0 0.07em rgba(250, 244, 224, 0.55);
  vertical-align: -0.2em;
  user-select: none;
}
/* Ngũ hành — màu theo hành, đều ≥ 4.5:1 với chữ giấy */
.ndla-seal.hanh-kim  { background: #6E6040; }
.ndla-seal.hanh-moc  { background: var(--jade); }
.ndla-seal.hanh-thuy { background: #1E3A5F; }
.ndla-seal.hanh-hoa  { background: var(--vermilion); }
.ndla-seal.hanh-tho  { background: #7A4E24; }

/* Trong khung tròn có sẵn: bỏ nền ấn, chỉ giữ chữ */
.cw-info-zodiac .ndla-seal,
.cb-zodiac .ndla-seal,
.nh-icon .ndla-seal {
  background: none;
  box-shadow: none;
  width: auto; height: auto;
  font-size: 0.85em;
  vertical-align: baseline;
}
.cw-info-zodiac .ndla-seal,
.cb-zodiac .ndla-seal { color: var(--vermilion); }
.nh-icon .ndla-seal { color: #FFF8E6; font-size: 0.95em; }

/* Ấn trong dòng chữ (lịch tuần, đầu lịch năm, danh sách ngày tốt) — nhỏ, nằm gọn dòng */
.dc-row .v .ndla-seal,
.mgd-canchi .zod .ndla-seal,
.yh-canchi .ndla-seal,
#ov-zod-emoji .ndla-seal { font-size: 0.72em; vertical-align: -0.1em; }

/* Ô chọn tuổi đang active nền son → đảo màu ấn */
.tvct-sign-btn--active .ndla-seal,
.tvct-bn-active .ndla-seal {
  background: var(--paper-light);
  color: var(--vermilion);
}

/* Lưới 12 con giáp trang chủ: ấn to, rõ */
.zod-icon .ndla-seal { font-size: 0.75em; }
.zod-card:not(.active) .zod-icon { filter: none; }

/* ==========================================================================
   8. ICON SVG & HUY HIỆU HẠNG
   ========================================================================== */
.ndla-ico {
  display: inline-block;
  width: 1em; height: 1em;
  vertical-align: -0.14em;
  flex-shrink: 0;
}
.ic-title .icon .ndla-ico { width: 16px; height: 16px; }
.ov-emoji { color: var(--vermilion); display: inline-flex; }
.cb-ev-emoji { color: var(--vermilion); display: inline-flex; }
.cb-event.lunar .cb-ev-emoji, .cb-event.monthly .cb-ev-emoji { color: var(--gold); }
.cb-event.intl .cb-ev-emoji { color: var(--jade); }

/* Thanh điểm & lời khuyên tử vi: icon theo màu từng lĩnh vực */
.tv-bar-label .ndla-ico, .tv-reco-list em .ndla-ico,
.tvct-domain-icon .ndla-ico, .tvct-ov-icon .ndla-ico { color: var(--ink-soft); }
.tvct-ov-icon { font-size: 22px; color: var(--vermilion); }
.tvct-bs-meta .ndla-ico { margin-right: 2px; color: var(--ink-mute); }
.tv-rel-badge .ndla-ico, .tvct-rel-badge .ndla-ico { margin-right: 2px; }

.ndla-rank {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font: 700 13px/1 var(--font-display);
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.ndla-rank-1 { background: #8A6A12; box-shadow: inset 0 0 0 2px #D8B863; }
.ndla-rank-2 { background: #5E6670; box-shadow: inset 0 0 0 2px #B9C0C8; }
.ndla-rank-3 { background: #7A4A2A; box-shadow: inset 0 0 0 2px #C9936A; }
.tvct-bs-medal .ndla-rank { width: 32px; height: 32px; font-size: 15px; }

/* Tử vi chi tiết: màu fallback cũ (#888, #c8941a) tương phản thấp */
.tvct-ov-label, .tvct-bs-years, .tvct-rank-num { color: var(--ink-mute); }
.tvct-sign-btn:hover, .tvct-bn-sign:hover, .tvct-tab:hover { color: var(--gold-text); }

/* ==========================================================================
   9. NHÃN CHỮ THƯỜNG — gỡ toàn bộ kiểu "CHỮ HOA giãn rộng"
   (Giữ chữ hoa cho đầu cột thứ T2…CN vì vốn đã là ký hiệu viết hoa.)
   ========================================================================== */
.duong-monthyear, .cw-head-left, .cw-head-right, .mgd-rating, .gd-date-meta,
.gd-tag, .conv-btn, .yh-eyebrow, .yh-meta .k, .yh-side-label, .settings-label,
.holidays-head, .holidays-col-headers, .month-head, .cb-quote-author,
.cb-side-label, .ic-badge, .direction-info .name, .tu-pos, .tu-badge,
.tu-act-label, .nt-label, .tt-chi, .nh-stars-label, .km-label-tag,
.km-hours-label, .chs-h-label, .tg-section-label, .summary-eyebrow,
.summary-side-label, .selector-row .badge-now, .dc-weekday, .dc-pill, .dc-cta,
.mini-cal-head, .tv-hero-label {
  text-transform: none;
  letter-spacing: 0.01em;
}
.cw-head-left, .cw-head-right { font-size: 15px; }

/* ==========================================================================
   10. LỊCH TUẦN — badge "Hiện tại" đè lên mũi tên của ô chọn
   ========================================================================== */
.selector-row { position: relative; }
.selector-row select { padding-right: 112px; }
.selector-row .badge-now {
  right: 34px;
  top: auto;
  bottom: 50%;
  transform: none;
  font-size: 12px;
  pointer-events: none;
}
/* Neo theo ô chọn (không theo cả hàng có nhãn) */
.selector-row select + .badge-now, .selector-row .badge-now { bottom: calc(var(--sel-h, 38px) / 2 - 10px); }
.selector-row select { min-height: 38px; }

/* Icon nhỏ thay chữ Hán phiên âm (Lục Diệu, 28 sao, thần giờ) */
.ndla-tag { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; margin-left: .25em; border-radius: 50%; vertical-align: -0.3em; font-size: .85em; }
.ndla-tag .ndla-ico { width: 1em; height: 1em; }
.ndla-tag.is-good { color: #14513C; background: #E3F1EA; }
.ndla-tag.is-bad { color: #8E1B12; background: #FDF1EF; }
