/* ==========================================================================
   styles.css - PHẦN MỀM LẬP LÁ SỐ TỬ VI ĐẨU SỐ - PHONG THUỶ THỨC TÂM
   Chuẩn xác 100% Tam Hợp Phái, Nam Phái, Tứ Hoá & Đủ 9 Sao Lưu Tiểu Vận
   ========================================================================== */

/* Font thư pháp Việt Nam (Water Brush) lưu trữ nội bộ cho chữ Phong Thuỷ Thức Tâm */
@font-face {
  font-family: 'Water Brush';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/water-brush-400-vn.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Water Brush';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/water-brush-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Water Brush';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/water-brush-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.thu-phap-do {
  font-family: 'Water Brush', cursive;
  color: #b91c1c;
  font-weight: 400;
  line-height: 1.2;
}

/* Khung lưới lá số Tử Vi 4x4 truyền thống */
.tuvi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 1.5px;
  background-color: #78350f; /* Viền nâu đồng phong thủy */
  border: 2px solid #78350f;
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 4px 15px -3px rgba(113, 63, 18, 0.15);
  position: relative;
  background-clip: padding-box;
}

/* Định vị 12 Cung và Thiên Bàn theo vị trí Địa Chi chuẩn */
#palace-5  { grid-column: 1; grid-row: 1; border-top-left-radius: 8px; } /* Tị */
#palace-6  { grid-column: 2; grid-row: 1; } /* Ngọ */
#palace-7  { grid-column: 3; grid-row: 1; } /* Mùi */
#palace-8  { grid-column: 4; grid-row: 1; border-top-right-radius: 8px; } /* Thân */
#palace-4  { grid-column: 1; grid-row: 2; } /* Thìn */
#palace-9  { grid-column: 4; grid-row: 2; } /* Dậu */
#palace-3  { grid-column: 1; grid-row: 3; } /* Mão */
#palace-10 { grid-column: 4; grid-row: 3; } /* Tuất */
#palace-2  { grid-column: 1; grid-row: 4; border-bottom-left-radius: 8px; } /* Dần */
#palace-1  { grid-column: 2; grid-row: 4; } /* Sửu */
#palace-0  { grid-column: 3; grid-row: 4; } /* Tý */
#palace-11 { grid-column: 4; grid-row: 4; border-bottom-right-radius: 8px; } /* Hợi */

/* Thiên Bàn Trung Tâm (chiếm 2 cột giữa x 2 hàng giữa) */
#thienBanCenter {
  grid-column: 2 / span 2;
  grid-row: 2 / span 2;
  background-color: #ffffff;
  z-index: 5;
  border: 1px solid #e7dcc8;
}

.palace-cell {
  min-height: 240px;
  background-color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.palace-cell:hover {
  background-color: #fefce8;
}

/* Màu Ngũ Hành Cho Toàn Bộ Sao Tử Vi (Chính Tinh & Phụ Tinh) Chuẩn Xác:
   - Màu đỏ tươi hành Hỏa
   - Màu vàng đất đậm đà (rich golden ochre), rõ màu, không bị nhạt hành Thổ
   - Màu xanh lục đậm nét hành Mộc
   - Màu đen tuyền hành Thủy
   - Màu bạc ánh kim đậm nét (steel silver - slate-700), rõ màu, tương phản cao hành Kim
*/
.star-hoa {
  color: #dc2626 !important; /* Đỏ tươi hành Hỏa */
}

.star-tho {
  color: #8a4500 !important; /* Vàng đất đậm đà, sắc nét, rõ màu */
}

.star-moc {
  color: #15803d !important; /* Xanh lục đậm nét hành Mộc */
}

.star-thuy {
  color: #000000 !important; /* Đen tuyền hành Thủy */
}

.star-kim {
  color: #334155 !important; /* Bạc ánh kim đậm nét, sắc sảo, rõ màu */
}

/* Huy hiệu Tuần & Triệt đặt chính xác tại vách ngăn giữa 2 cung - To, rõ nét, sang trọng, không đè lên chữ */
.badge-tuan-triet {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  color: #ffffff;
  font-size: 11px;
  line-height: 13px;
  font-weight: 800;
  padding: 2.5px 8.5px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  text-transform: uppercase;
  white-space: nowrap;
}

#badgeTuan {
  background-color: #b91c1c;
  border: 1.5px solid #ffffff;
}

#badgeTriet {
  background-color: #0f172a;
  border: 1.5px solid #ffffff;
}

@media (max-width: 640px) {
  .badge-tuan-triet {
    font-size: 10px;
    line-height: 12px;
    padding: 2px 7px;
    border-width: 1.2px;
  }
}

/* Nút tải ảnh & In ấn */
.btn-action-tuvi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  border: none;
  text-decoration: none;
}

.chart-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-scroll-inner {
  min-width: 1000px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Responsive trên điện thoại & máy tính bảng */
@media (max-width: 1024px) {
  .chart-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .chart-scroll-inner {
    min-width: 1000px;
  }
  .palace-cell {
    min-height: 235px;
  }
}

/* Lưới hiển thị 3 Gói Luận Giải Chuẩn Tỷ Lệ */
.pkgs {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)) !important;
  gap: 20px !important;
  align-items: stretch !important;
}

/* Chuyên mục Cẩm Nang Nuôi Dạy Bé (≤ 10 tuổi) */
.lg-section-gap {
  margin-bottom: 2rem;
}

.lg-child-heading {
  border-left: 4px solid #047857;
  padding-left: 0.75rem;
  margin-bottom: 0.875rem;
  line-height: 1.35;
}

.lg-child-pill {
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.lg-child-pill:hover {
  background-color: #d1fae5 !important;
}

.lg-child-list {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.lg-child-wrap h4 {
  margin-top: 0;
  line-height: 1.4;
}

/* In ấn chuẩn */
@media print {
  .no-print, header, footer, .tv-sec, .site-header, .site-footer, .msg-fab, .zalo-fab {
    display: none !important;
  }
  body {
    background: #ffffff !important;
  }
  .tuvi-grid {
    box-shadow: none !important;
    border-color: #333333 !important;
  }
}
