/* ═══════════════════════════════════════════════════════
   MODULE 5 — EXTRA STYLES
   Components: anatomy table override, merge timeline,
               merge stats, consensus cards
   ═══════════════════════════════════════════════════════ */

/* ── Anatomy Table Override ─────────────────────────── */
/* M5 uses .anatomy-label / .anatomy-value instead of
   the shared .anatomy-field / .anatomy-desc            */
.anatomy-table {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1.5rem 0;
}
.anatomy-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.anatomy-row:last-child { border-bottom: none; }
.anatomy-row:first-child {
    font-weight: 600;
    background: rgba(247, 147, 26, 0.06);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.anatomy-row:hover:not(:first-child) {
    background: rgba(255, 255, 255, 0.02);
}
[data-theme="light"] .anatomy-row:hover:not(:first-child) {
    background: rgba(0, 0, 0, 0.02);
}
.anatomy-label {
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}
.anatomy-row:first-child .anatomy-label {
    color: var(--text-secondary);
    font-family: var(--font-body);
}
.anatomy-value {
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

@media (max-width: 640px) {
    .anatomy-row {
        grid-template-columns: 1fr;
    }
    .anatomy-label {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .anatomy-row:last-child .anatomy-label {
        border-bottom: 1px solid var(--border-color);
    }
    .anatomy-row:first-child { display: none; }
}


/* ── Merge Timeline (Section 6) ─────────────────────── */
.merge-timeline {
    position: relative;
    padding-left: 2rem;
    margin: 2rem 0;
}
.merge-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.merge-phase {
    position: relative;
    padding: 0 0 2rem 1.2rem;
}
.merge-phase:last-child { padding-bottom: 0; }

.merge-phase-dot {
    position: absolute;
    left: -2rem;
    top: 0.15rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    z-index: 1;
    transition: all 0.3s;
}
.merge-phase-dot.phase-done {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.merge-phase-dot.phase-merge {
    background: #f7931a;
    border-color: #f7931a;
    box-shadow: 0 0 0 4px rgba(247, 147, 26, 0.2);
    width: 18px;
    height: 18px;
    left: calc(-2rem - 1px);
}

.merge-phase-content h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
}
.merge-phase-date {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.4rem;
    padding: 0.1rem 0.5rem;
    background: rgba(247, 147, 26, 0.08);
    border-radius: 4px;
}
.merge-phase-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0.3rem 0 0;
}

@media (max-width: 640px) {
    .merge-timeline { padding-left: 1.5rem; }
    .merge-phase { padding-left: 0.8rem; }
    .merge-phase-dot { left: -1.5rem; }
    .merge-phase-dot.phase-merge { left: calc(-1.5rem - 1px); }
}


/* ── Merge Stats (Section 6) ────────────────────────── */
.merge-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}
.merge-stat {
    text-align: center;
    padding: 1.2rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
}
.merge-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.merge-stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}
.merge-stat-label {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

@media (max-width: 768px) {
    .merge-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .merge-stats { grid-template-columns: 1fr; }
    .merge-stat-value { font-size: 1.2rem; }
}


/* ── Consensus Cards (Section 7) ────────────────────── */
.consensus-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}
.consensus-card {
    padding: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.consensus-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.consensus-icon {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}
.consensus-card h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem;
}
.consensus-card p {
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

@media (max-width: 900px) {
    .consensus-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .consensus-cards { grid-template-columns: 1fr; }
}
