/* ========================================================================
   Harness Anatomy page · harness.css
   8 frameworks × 7 cognitive-function heatmap + 5-step methodology cards.
   ======================================================================== */

.ha-title {
    font-family: var(--font-serif);
    font-size: 1.85rem;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.ha-meta {
    background: var(--color-quote-bg);
    border-left: 3px solid var(--color-link);
    padding: 0.85rem 1.1rem;
    margin: 1.5rem 0 2.5rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

.ha-section-h {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin: 2.5rem 0 0.7rem;
    color: var(--color-text);
}

.ha-section-sub {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.62;
    margin-bottom: 1.4rem;
    max-width: 46rem;
}

/* --- Heatmap matrix --- */
.ha-heatmap-wrap {
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
}
.ha-heatmap {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.ha-heatmap th, .ha-heatmap td {
    border: 1px solid var(--color-rule);
    padding: 0;
    vertical-align: middle;
}
.ha-heatmap thead th {
    background: var(--color-badge-bg);
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 0.55rem;
    text-align: center;
    line-height: 1.25;
}
.ha-heatmap thead th.ha-corner {
    background: #fff;
    text-align: left;
    color: var(--color-text-faint);
    font-weight: 500;
}
.ha-heatmap tbody th {
    background: #fff;
    text-align: left;
    padding: 0.55rem 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s;
}
.ha-heatmap tbody th:hover { background: var(--color-quote-bg); color: var(--color-link); }
.ha-heatmap tbody th .ha-fw-sub {
    display: block;
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--color-text-faint);
    margin-top: 0.15rem;
}
.ha-cell {
    text-align: center;
    width: 60px;
    height: 52px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.0);  /* hide the number, color carries info */
}
.ha-cell-0 { background: #f7f1e4; color: var(--color-text-faint); }  /* show "—" */
.ha-cell-0 { color: var(--color-text-faint); }
.ha-cell-1 { background: #ecd9b8; }
.ha-cell-2 { background: #d49f6a; }
.ha-cell-3 { background: #a85a1e; color: #fff; opacity: 1; }
.ha-cell-3, .ha-cell-2 { color: rgba(255,255,255,0.95); }
.ha-cell.ha-cell-0 { color: var(--color-text-faint); }

.ha-cell-tot {
    text-align: center;
    background: #fbf6ec;
    font-weight: 700;
    color: var(--color-link);
    font-variant-numeric: tabular-nums;
    padding: 0 0.4rem;
}

.ha-legend {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.84rem;
    color: var(--color-text-muted);
    margin-top: 0.7rem;
}
.ha-legend-sw {
    display: inline-block;
    width: 18px; height: 14px;
    border: 1px solid var(--color-rule);
    margin-right: 0.3rem;
    vertical-align: -2px;
}

/* --- 5-step cards --- */
.ha-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
    margin: 1rem 0 1.5rem;
}
.ha-step {
    background: #fff;
    border: 1px solid var(--color-rule);
    border-left: 3px solid var(--color-link);
    border-radius: 4px;
    padding: 0.9rem 1.05rem;
}
.ha-step h4 {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    margin: 0 0 0.4rem 0;
    color: var(--color-link);
    line-height: 1.3;
}
.ha-step p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--color-text-muted);
}

/* --- Common ancestors list --- */
.ha-ancestors {
    margin: 1rem 0 1.5rem;
    padding: 0;
    list-style: none;
}
.ha-ancestors li {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-rule);
    font-size: 0.93rem;
    line-height: 1.55;
}
.ha-ancestors li:last-child { border-bottom: 0; }
.ha-ancestors strong {
    color: var(--color-link);
    font-weight: 600;
}
.ha-ancestors .ha-anc-year {
    color: var(--color-text-faint);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    margin-left: 0.4rem;
}

/* --- Framework detail panel --- */
.ha-detail {
    position: fixed;
    top: 0; right: 0;
    width: min(480px, 92vw);
    height: 100vh;
    background: #fdfaf4;
    border-left: 1px solid var(--color-rule);
    box-shadow: -4px 0 20px rgba(60, 30, 10, 0.12);
    padding: 2.5rem 1.4rem 2rem;
    overflow-y: auto;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}
.ha-detail[data-open="true"] { transform: translateX(0); }
.ha-detail-close {
    position: absolute;
    top: 0.6rem; right: 0.8rem;
    background: transparent; border: 0;
    font-size: 1.6rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}
.ha-detail-close:hover { color: var(--color-link); }
.ha-detail h3 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin: 0 0 0.3rem;
    line-height: 1.25;
}
.ha-detail-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.ha-detail-meta code {
    background: var(--color-quote-bg);
    padding: 0.05rem 0.35rem;
    border-radius: 3px;
    font-size: 0.82rem;
}
.ha-detail-summary {
    background: var(--color-quote-bg);
    border-left: 3px solid var(--color-link);
    padding: 0.7rem 0.95rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.94rem;
    line-height: 1.55;
    margin-bottom: 1.2rem;
}
.ha-detail-strengths {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--color-text);
    margin: 0 0 1rem;
}
.ha-detail-strengths strong {
    display: block;
    color: var(--color-link);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}
.ha-detail-mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin: 0.7rem 0 0;
}
.ha-detail-mini-grid > div {
    text-align: center;
    padding: 0.5rem 0.2rem;
    font-size: 0.7rem;
    line-height: 1.2;
    border-radius: 3px;
}
.ha-detail-mini-grid .ha-mini-label {
    color: var(--color-text-faint);
    font-size: 0.65rem;
    margin-top: 0.2rem;
    display: block;
}

@media (max-width: 700px) {
    .ha-detail { padding: 2.4rem 1.05rem 1.5rem; }
}
