/* AFDES Civic Academy — Checks & Balances */
.aca-checks-module {
    --legislative: #087aa5;
    --executive: #a44a5a;
    --judicial: #9b792d;
}

.aca-checks-module .aca-orbit-svg,
.aca-checks-module .aca-check-branch-svg,
.aca-checks-module .aca-check-panel-svg,
.aca-checks-module .aca-check-principle-svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: currentColor;
    stroke: currentColor;
}

.aca-checks-hero {
    position: relative;
    overflow: hidden;
    padding: 54px 0 72px;
    background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
}

.aca-checks-hero::after {
    content: "";
    position: absolute;
    right: -180px;
    top: -190px;
    width: 530px;
    height: 530px;
    border: 1px solid rgba(11,36,55,.06);
    border-radius: 50%;
    box-shadow: 0 0 0 70px rgba(8,122,165,.018), 0 0 0 140px rgba(164,74,90,.012);
}

.aca-checks-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0,1.04fr) minmax(390px,.96fr);
    gap: clamp(42px,7vw,92px);
    align-items: center;
}

.aca-checks-hero h1 {
    margin: 12px 0 18px;
    color: var(--academy-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.7rem,6vw,5.2rem);
    letter-spacing: -.05em;
    line-height: .98;
}

.aca-checks-hero p {
    max-width: 760px;
    margin: 0;
    color: #536779;
    font-size: 1.1rem;
    line-height: 1.72;
}

.aca-checks-hero .academy-btn { margin-top: 28px; }

.aca-branch-orbit {
    position: relative;
    min-height: 420px;
}

.aca-orbit-network {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.aca-orbit-network path {
    fill: none;
    stroke: #cfd9e0;
    stroke-width: 1.6;
    vector-effect: non-scaling-stroke;
}

.aca-orbit-network .aca-orbit-spoke {
    stroke: rgba(8,122,165,.22);
    stroke-width: 1.25;
    stroke-dasharray: 5 7;
}

.aca-orbit-constitution {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    transform: translate(-50%,-50%);
    display: grid;
    width: 108px;
    height: 108px;
    place-items: center;
    align-content: center;
    gap: 5px;
    border: 1px solid #c8d4dd;
    border-radius: 50%;
    background: #fff;
    color: var(--academy-navy);
    box-shadow: 0 16px 42px rgba(15,23,42,.07);
}

.aca-orbit-constitution-svg { width: 38px; height: 38px; color: var(--academy-gold); }
.aca-orbit-constitution b { font-family: Georgia, "Times New Roman", serif; font-size: .76rem; }

.aca-orbit-node {
    position: absolute;
    z-index: 4;
    display: grid;
    width: 116px;
    gap: 9px;
    justify-items: center;
    text-align: center;
}

.aca-orbit-node > span { width: 76px; height: 76px; }
.aca-orbit-node b { color: var(--academy-navy); font-family: Georgia, "Times New Roman", serif; font-size: .92rem; }
.aca-orbit-node--legislative { left: 22%; top: 23.8%; transform: translate(-50%,-50%); color: var(--legislative); }
.aca-orbit-node--executive { left: 78%; top: 23.8%; transform: translate(-50%,-50%); color: var(--executive); }
.aca-orbit-node--judicial { left: 50%; top: 83.3%; transform: translate(-50%,-50%); color: var(--judicial); }

.aca-checks-experience { padding-top: 38px; padding-bottom: 70px; }
.aca-checks-heading { display: flex; gap: 38px; align-items: end; justify-content: space-between; }
.aca-checks-heading h2 { margin: 7px 0 10px; color: var(--academy-navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem,3.5vw,3rem); letter-spacing: -.04em; }
.aca-checks-heading p { max-width: 790px; margin: 0; color: #607283; line-height: 1.7; }
.aca-checks-legend { display: flex; flex-wrap: wrap; gap: 12px; color: #718294; font-size: .74rem; font-weight: 800; }
.aca-checks-legend span { display: flex; align-items: center; gap: 6px; }
.aca-checks-legend i { width: 9px; height: 9px; border-radius: 50%; background: #999; }
.aca-checks-legend .is-legislative { background: var(--legislative); }
.aca-checks-legend .is-executive { background: var(--executive); }
.aca-checks-legend .is-judicial { background: var(--judicial); }

.aca-checks-workspace {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(360px,.82fr) minmax(0,1.18fr);
    gap: clamp(34px,5vw,66px);
    margin-top: 34px;
    padding-top: 34px;
    border-top: 1px solid var(--academy-border);
}

.aca-checks-diagram {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 500px;
}

.aca-check-branch {
    position: absolute;
    z-index: 4;
    display: grid;
    width: 158px;
    min-height: 145px;
    justify-items: center;
    align-content: center;
    gap: 5px;
    border: 1px solid #d6e0e7;
    background: #fff;
    color: #738696;
    cursor: pointer;
    font: inherit;
    text-align: center;
    transition: .22s ease;
}
.aca-check-branch:hover { box-shadow: 0 15px 34px rgba(15,23,42,.08); }
.aca-check-branch-icon { width: 54px; height: 54px; margin-bottom: 4px; }
.aca-check-branch small { font-size: .64rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.aca-check-branch b { max-width: 125px; color: var(--academy-navy); font-family: Georgia, "Times New Roman", serif; font-size: .9rem; line-height: 1.15; }
.aca-check-branch--legislative { left: 17.5%; top: 18.4%; transform: translate(-50%,-50%); }
.aca-check-branch--executive { left: 82.5%; top: 18.4%; transform: translate(-50%,-50%); }
.aca-check-branch--judicial { left: 50%; top: 82%; transform: translate(-50%,-50%); }
.aca-check-branch--legislative:hover,
.aca-check-branch--executive:hover,
.aca-check-branch--judicial:hover { transform: translate(-50%,-50%) translateY(-4px); }
.aca-check-branch--legislative.is-active { border-color: var(--legislative); color: var(--legislative); box-shadow: 0 0 0 3px rgba(8,122,165,.08); }
.aca-check-branch--executive.is-active { border-color: var(--executive); color: var(--executive); box-shadow: 0 0 0 3px rgba(164,74,90,.08); }
.aca-check-branch--judicial.is-active { border-color: var(--judicial); color: var(--judicial); box-shadow: 0 0 0 3px rgba(155,121,45,.08); }

.aca-check-relationship-map {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.aca-check-network-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.aca-check-link {
    fill: none;
    stroke: #dce4ea;
    stroke-width: 3;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    transition: stroke .25s ease, filter .25s ease;
}

.aca-check-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%,-50%);
    display: grid;
    width: 104px;
    height: 104px;
    place-items: center;
    align-content: center;
    gap: 4px;
    border: 1px solid #d9e2e8;
    border-radius: 50%;
    background: #fbfcfd;
    color: #5f7183;
    font-size: .72rem;
    font-weight: 700;
}

.aca-check-center-svg { width: 34px; height: 34px; color: var(--academy-gold); }
.aca-check-center b { font-family: Georgia, "Times New Roman", serif; }

.aca-checks-module[data-active-branch="legislative"] .aca-check-link--leg-ex,
.aca-checks-module[data-active-branch="legislative"] .aca-check-link--jud-leg { stroke: var(--legislative); filter: drop-shadow(0 0 3px rgba(8,122,165,.18)); }
.aca-checks-module[data-active-branch="executive"] .aca-check-link--leg-ex,
.aca-checks-module[data-active-branch="executive"] .aca-check-link--ex-jud { stroke: var(--executive); filter: drop-shadow(0 0 3px rgba(164,74,90,.18)); }
.aca-checks-module[data-active-branch="judicial"] .aca-check-link--ex-jud,
.aca-checks-module[data-active-branch="judicial"] .aca-check-link--jud-leg { stroke: var(--judicial); filter: drop-shadow(0 0 3px rgba(155,121,45,.18)); }

.aca-checks-detail { min-width: 0; }
.aca-check-panel { animation: acaChecksIn .28s ease both; }
@keyframes acaChecksIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.aca-check-panel-title { display: flex; align-items: center; gap: 18px; }
.aca-check-panel-icon { width: 58px; height: 58px; color: var(--academy-blue); }
.aca-check-panel[data-branch-panel="executive"] .aca-check-panel-icon { color: var(--executive); }
.aca-check-panel[data-branch-panel="judicial"] .aca-check-panel-icon { color: var(--judicial); }
.aca-check-panel h2 { margin: 5px 0 0; color: var(--academy-navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem,3vw,2.8rem); }
.aca-check-summary { margin: 22px 0 26px; color: #516779; font-size: 1.05rem; line-height: 1.72; }
.aca-check-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.aca-check-columns > div { border-top: 2px solid var(--academy-border); padding-top: 18px; }
.aca-check-columns h3 { margin: 0 0 14px; color: var(--academy-navy); font-family: Georgia, "Times New Roman", serif; font-size: 1.08rem; }
.aca-check-columns ul { margin: 0; padding-left: 20px; color: #607283; }
.aca-check-columns li { margin-bottom: 10px; line-height: 1.55; }

.aca-checks-principle { display: grid; grid-template-columns: 58px 1fr; gap: 22px; align-items: start; margin-top: 52px; border-top: 1px solid var(--academy-border); padding-top: 34px; }
.aca-checks-principle > span { width: 50px; height: 50px; color: var(--academy-blue); }
.aca-checks-principle strong { color: var(--academy-navy); }
.aca-checks-principle p { margin: 5px 0 0; color: #607283; line-height: 1.7; }

@media (max-width: 980px) {
    .aca-checks-hero-grid, .aca-checks-workspace { grid-template-columns: minmax(0,1fr); }
    .aca-branch-orbit { max-width: 620px; width: 100%; min-height: 360px; }
    .aca-checks-diagram { max-width: 620px; width: 100%; margin: 0 auto; }
    .aca-checks-detail { width: 100%; }
}

@media (max-width: 680px) {
    .aca-checks-hero { padding: 42px 0 54px; }
    .aca-checks-hero-grid { gap: 34px; }
    .aca-checks-heading { display: block; }
    .aca-checks-legend { margin-top: 18px; }

    /* Mobile hero: become an institutional strip instead of shrinking the desktop triangle. */
    .aca-branch-orbit {
        display: grid;
        grid-template-columns: repeat(3, minmax(0,1fr));
        gap: 12px;
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
        transform: none;
    }
    .aca-orbit-network { display: none; }
    .aca-orbit-constitution {
        position: relative;
        left: auto;
        top: auto;
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 38px 1fr;
        width: 100%;
        height: auto;
        min-height: 68px;
        justify-content: start;
        justify-items: start;
        align-items: center;
        align-content: center;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 14px;
        transform: none;
        box-sizing: border-box;
    }
    .aca-orbit-constitution-svg { width: 34px; height: 34px; }
    .aca-orbit-node,
    .aca-orbit-node--legislative,
    .aca-orbit-node--executive,
    .aca-orbit-node--judicial {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        min-width: 0;
        transform: none;
        gap: 7px;
        padding: 12px 6px;
        box-sizing: border-box;
    }
    .aca-orbit-node > span { width: 52px; height: 52px; }
    .aca-orbit-node b { font-size: .82rem; }

    /* Mobile experience: full-width branch controls and a readable Constitution row. */
    .aca-checks-workspace { gap: 30px; margin-top: 28px; padding-top: 28px; }
    .aca-checks-diagram {
        display: grid;
        grid-template-columns: minmax(0,1fr);
        gap: 10px;
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
    }
    .aca-check-relationship-map {
        position: relative;
        inset: auto;
        order: -1;
        width: 100%;
        min-height: 0;
    }
    .aca-check-network-svg { display: none; }
    .aca-check-center {
        position: relative;
        left: auto;
        top: auto;
        display: grid;
        grid-template-columns: 38px 1fr;
        width: 100%;
        height: auto;
        min-height: 66px;
        justify-content: start;
        justify-items: start;
        align-items: center;
        align-content: center;
        gap: 12px;
        padding: 12px 16px;
        border-radius: 14px;
        transform: none;
        box-sizing: border-box;
    }
    .aca-check-center-svg { width: 32px; height: 32px; }

    .aca-check-branch,
    .aca-check-branch--legislative,
    .aca-check-branch--executive,
    .aca-check-branch--judicial,
    .aca-check-branch--legislative:hover,
    .aca-check-branch--executive:hover,
    .aca-check-branch--judicial:hover {
        position: relative;
        left: auto;
        top: auto;
        display: grid;
        grid-template-columns: 54px minmax(0,1fr);
        width: 100%;
        min-height: 88px;
        justify-items: start;
        align-items: center;
        align-content: center;
        gap: 2px 14px;
        padding: 13px 16px;
        transform: none;
        text-align: left;
        box-sizing: border-box;
    }
    .aca-check-branch-icon { grid-row: 1 / 3; width: 48px; height: 48px; margin: 0; }
    .aca-check-branch small { align-self: end; }
    .aca-check-branch b { max-width: none; align-self: start; font-size: .94rem; }

    .aca-check-panel-title { align-items: flex-start; }
    .aca-check-columns { grid-template-columns: minmax(0,1fr); gap: 24px; }
    .aca-checks-principle { grid-template-columns: 42px minmax(0,1fr); gap: 16px; }
}

@media (max-width: 440px) {
    .aca-branch-orbit { grid-template-columns: 1fr; }
    .aca-orbit-constitution { grid-column: auto; }
    .aca-orbit-node {
        grid-template-columns: 46px minmax(0,1fr);
        justify-items: start;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 9px 12px;
    }
    .aca-orbit-node > span { width: 44px; height: 44px; }
    .aca-checks-legend { gap: 9px 14px; }
    .aca-check-panel-title { gap: 13px; }
    .aca-check-panel-icon { width: 48px; height: 48px; flex: 0 0 48px; }
    .aca-checks-principle { grid-template-columns: 1fr; }
}
