/* ============================================================
   Xem hướng bàn thờ — CSS riêng
   Phụ thuộc: tuvi.css + xem-tuoi.css
   ============================================================ */

.xhbt-wrap {
    /* container */
}

/* === Vợ/chồng toggle === */
.xhbt-spouse > legend {
    cursor: pointer;
}
.xhbt-spouse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.xhbt-spouse-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.xhbt-spouse .xhbt-spouse-body {
    display: none;
    margin-top: 12px;
}
.xhbt-spouse.xhbt-spouse-open .xhbt-spouse-body {
    display: block;
}

/* === Altar type cards === */
.xhbt-altar-types {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 6px;
}
@media (max-width: 600px) {
    .xhbt-altar-types {
        grid-template-columns: 1fr;
    }
}
.xhbt-altar-type {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 10px;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
}
.xhbt-altar-type:hover {
    border-color: #b8860b;
    background: #fffef5;
}
.xhbt-altar-type input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.xhbt-altar-type-active {
    border-color: #7b1414;
    background: #fff4f4;
    box-shadow: 0 2px 6px rgba(123, 20, 20, 0.15);
}
.xhbt-altar-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 6px;
}
.xhbt-altar-label {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}
.xhbt-altar-type small {
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}
.xhbt-altar-type-active .xhbt-altar-label {
    color: #7b1414;
}

/* === Cảnh báo xung trạch === */
.xhbt-warn-box {
    background: #fff8e1;
    border-left: 4px solid #f57c00;
    padding: 12px 16px;
    border-radius: 4px;
    margin-top: 12px;
    line-height: 1.6;
}
.xhbt-warn-box ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.xhbt-warn-box li {
    margin: 4px 0;
}

/* === 3 hướng đề xuất === */
.xhbt-rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.xhbt-rec-card {
    position: relative;
    background: linear-gradient(135deg, #fff8e1 0%, #fffef5 100%);
    border: 2px solid #d4a017;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.xhbt-rec-card.xhbt-rec-warn {
    background: linear-gradient(135deg, #fff3e0 0%, #fff8f0 100%);
    border-color: #ef6c00;
}
.xhbt-rec-rank {
    position: absolute;
    top: -10px;
    left: 12px;
    background: #7b1414;
    color: #fff;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
}
.xhbt-rec-card.xhbt-rec-warn .xhbt-rec-rank {
    background: #ef6c00;
}
.xhbt-rec-dir {
    font-size: 22px;
    color: #7b1414;
    margin-top: 6px;
    margin-bottom: 8px;
}
.xhbt-rec-arrow {
    margin-right: 6px;
    color: #d4a017;
}
.xhbt-rec-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.xhbt-rec-dunien {
    background: #b8860b;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.xhbt-rec-both {
    background: #4caf50;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
}
.xhbt-rec-meaning {
    color: #555;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.5;
}
.xhbt-rec-warn-text {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ef6c00;
    color: #bf360c;
    font-size: 14.5px;
    line-height: 1.5;
}

/* === Hướng cấm === */
.xhbt-forbidden-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
}
.xhbt-forbidden {
    padding: 10px 14px;
    margin: 6px 0;
    border-radius: 6px;
    border-left: 4px solid #999;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.xhbt-forbidden-critical {
    border-left-color: #c62828;
    background: #ffebee;
}
.xhbt-forbidden-high {
    border-left-color: #ef6c00;
    background: #fff3e0;
}
.xhbt-forbidden-medium {
    border-left-color: #f9a825;
    background: #fffde7;
}
.xhbt-forbidden-dir {
    font-weight: 700;
    color: #333;
    font-size: 15px;
}
.xhbt-forbidden-reason {
    color: #555;
    font-size: 15.5px;
    line-height: 1.5;
}

/* === Cảnh báo năm === */
.xhbt-year-warnings {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}
.xhbt-year-detail {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 10px 14px;
}
.xhbt-year-detail > summary {
    cursor: pointer;
    list-style: none;
    font-size: 15px;
}
.xhbt-year-detail > summary::-webkit-details-marker { display: none; }
.xhbt-year-detail > summary::before {
    content: '▶ ';
    color: #7b1414;
    font-size: 11px;
    margin-right: 4px;
}
.xhbt-year-detail[open] > summary::before {
    content: '▼ ';
}
.xhbt-year-detail > p {
    margin-top: 10px;
    line-height: 1.6;
    color: #444;
}

/* === Đối chiếu hướng nhà === */
.xhbt-alignment {
    padding: 14px 18px;
    border-radius: 6px;
    line-height: 1.6;
}
.xhbt-alignment-ok {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    color: #1b5e20;
}
.xhbt-alignment-warn {
    background: #fff3e0;
    border-left: 4px solid #ef6c00;
    color: #bf360c;
}
.xhbt-alignment-bad {
    background: #ffebee;
    border-left: 4px solid #c62828;
    color: #b71c1c;
}

/* === Kích thước Lỗ Ban === */
.xhbt-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 12px;
}
.xhbt-size-col {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px;
}
.xhbt-size-col h4 {
    margin: 0 0 4px;
    color: #7b1414;
    font-size: 15px;
}
.xhbt-size-col > small {
    display: block;
    color: #888;
    margin-bottom: 10px;
}
.xhbt-size-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.xhbt-size-list li {
    padding: 6px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 15.5px;
    color: #444;
    line-height: 1.5;
}
.xhbt-size-list li:last-child {
    border-bottom: none;
}

/* === Cấm kỵ bố trí === */
.xhbt-taboos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.xhbt-taboo {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #ef6c00;
    border-radius: 6px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.xhbt-taboo-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.xhbt-taboo-icon {
    font-size: 20px;
}
.xhbt-taboo-head strong {
    color: #333;
    font-size: 15px;
}
.xhbt-taboo-rule {
    margin: 0 0 8px;
    color: #444;
    font-size: 15.5px;
    line-height: 1.5;
}
.xhbt-taboo-why {
    margin: 0;
    color: #666;
    font-size: 14.5px;
    line-height: 1.5;
    font-style: normal;
}
.xhbt-taboo-why em {
    color: #7b1414;
    font-weight: 600;
    font-style: normal;
}

/* === Vật phẩm === */
.xhbt-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.xhbt-item {
    background: #fffef7;
    border: 1px solid #e0d68a;
    border-radius: 6px;
    padding: 12px 14px;
}
.xhbt-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #7b1414;
    margin-bottom: 8px;
}
.xhbt-item-count,
.xhbt-item-pos {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
}
.xhbt-item-role {
    font-size: 14.5px;
    color: #666;
    margin: 6px 0;
    line-height: 1.5;
    font-style: italic;
}

/* === Nguyên tắc sắp xếp === */
.xhbt-rules {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}
.xhbt-rule {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 12px 16px;
}
.xhbt-rule > summary {
    cursor: pointer;
    font-weight: 600;
    color: #7b1414;
    list-style: none;
}
.xhbt-rule > summary::-webkit-details-marker { display: none; }
.xhbt-rule > summary::before {
    content: '+ ';
    color: #b8860b;
    margin-right: 4px;
}
.xhbt-rule[open] > summary::before {
    content: '− ';
}
.xhbt-rule > p {
    margin: 10px 0 0;
    line-height: 1.6;
    color: #444;
}

/* === Cross link === */
.xhbt-cross-link ul {
    margin: 12px 0 0;
    padding-left: 22px;
}
.xhbt-cross-link li {
    margin: 6px 0;
    line-height: 1.6;
    color: #444;
}
.xhbt-cross-link code {
    background: #f5f5f5;
    color: #7b1414;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
}
