/* ==============================================
   Community choice pages (/community/)
   Loaded after city-page.css and datacenters.css; uses the .ec-dcm palette and spacing.
   ============================================== */

.ec-cca {
    --cca-body: clamp(20px, 2.2vw, 26px);
    --cca-small: clamp(17px, 1.7vw, 19px);
}

/* ---- Type: everything readable matches the section body size ---- */
.ec-cca .ec-dcm-report-list li,
.ec-cca .ec-cca-quote,
.ec-cca .ec-cca-notice {
    font-size: var(--cca-body);
    line-height: 1.6;
}
.ec-cca .ec-content-section > p + .ec-dcm-report-list { margin-top: -1rem; }
.ec-cca .ec-faq-answer p { font-size: clamp(18px, 1.9vw, 22px); line-height: 1.7; }
.ec-cca .ec-dcm-methodology p,
.ec-cca .ec-dcm-methodology li { font-size: var(--cca-small); line-height: 1.6; }
.ec-cca .ec-dcm-source-note { font-size: var(--cca-small); }

/* ---- Section dividers: a table that ends a section is border enough ---- */
.ec-cca .ec-content-section:has(> .ec-dcm-state-count-table-wrap:last-child) + .ec-content-section,
.ec-cca .ec-content-section:has(> details:last-child) + .ec-content-section {
    border-top: none;
    padding-top: 0;
}

/* ---- Tables: clip to the rounded border at every width ---- */
.ec-cca .ec-dcm-state-count-table-wrap { overflow-x: auto; overflow-y: auto; }
.ec-cca .ec-cca-facts-wrap { max-height: none; overflow-y: hidden; }
.ec-cca .ec-dcm-state-count-table-wrap + p,
.ec-cca .ec-dcm-state-count-table-wrap + .ec-dcm-source-note { margin-top: 16px; }
@media (max-width: 600px) {
    .ec-cca .ec-dcm-state-count-table-wrap { overflow-x: auto; overflow-y: hidden; }
}

/* KPI value that holds a name instead of a number */
.ec-cca .ec-dcm-kpi-val--text {
    font-size: clamp(26px, 2.6vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Rates are neutral; only above/below the utility default gets a color */
.ec-cca .ec-dcm-state-count-table tbody td.ec-cca-num { color: var(--dcm-navy); }
.ec-cca .ec-cca-up,
.ec-cca .ec-dcm-state-count-table tbody td.ec-cca-up { color: #b45309; }
.ec-cca .ec-cca-down,
.ec-cca .ec-dcm-state-count-table tbody td.ec-cca-down { color: var(--dcm-accent); }
.ec-cca .ec-dcm-state-count-table tbody td.ec-cca-muted { color: var(--dcm-text-dim); font-weight: 600; }

/* Lead answer: big, with bold figures */
.ec-cca .ec-page-hero .ec-lead-snippet strong { color: var(--dcm-navy); }

/* Two-column fact table: label left, value left */
.ec-cca .ec-cca-facts tbody td:not(:first-child) {
    text-align: left;
    font-weight: 600;
    color: var(--dcm-text);
}
.ec-cca .ec-cca-facts tbody td:first-child {
    width: 34%;
    color: var(--dcm-text-dim);
    font-weight: 700;
}

/* Program tables: text columns stay left, numbers right */
.ec-cca .ec-cca-table tbody td.ec-cca-txt,
.ec-cca .ec-cca-table thead th.ec-cca-txt {
    text-align: left;
    font-weight: 500;
    color: var(--dcm-text-secondary);
}
.ec-cca .ec-cca-table tbody td.ec-cca-num { white-space: nowrap; }
.ec-cca .ec-cca-table .ec-cca-sub {
    display: block;
    margin-top: 2px;
    font-size: 15px;
    font-weight: 500;
    color: var(--dcm-text-dim);
}

/* Search box above long tables */
.ec-cca-search {
    width: 100%;
    max-width: 460px;
    padding: 16px 20px;
    border: 1.5px solid var(--dcm-border);
    border-radius: 12px;
    font-size: 18px;
    font-family: inherit;
    margin: 0 0 16px;
    outline: none;
    box-sizing: border-box;
}
.ec-cca-search:focus { border-color: var(--dcm-accent); box-shadow: 0 0 0 3px rgba(14,159,110,0.15); }

/* Official quote */
.ec-cca-quote {
    margin: 0 0 2rem;
    padding: 28px 32px;
    border-left: 4px solid var(--dcm-accent);
    background: var(--dcm-surface);
    border-radius: 0 16px 16px 0;
    color: var(--dcm-text-secondary);
}
.ec-cca-quote cite {
    display: block;
    margin-top: 12px;
    font-size: var(--cca-small);
    font-style: normal;
    color: var(--dcm-text-dim);
}
.ec-cca-quote cite a { color: inherit; text-decoration: underline; }

/* A town notice that disagrees with the state list */
.ec-cca-notice {
    margin: 0 0 2rem;
    padding: 28px 32px;
    border: 1.5px solid #f3d38a;
    background: #fdf6e3;
    border-radius: 16px;
    color: #5c4300;
}
.ec-cca-notice strong { color: #3d2c00; }
.ec-cca-notice ul { margin: 12px 0 12px 24px; padding: 0; }
.ec-cca-notice li { margin: 0 0 8px; font-size: inherit; }
.ec-cca-notice a { color: inherit; text-decoration: underline; }

/* Source line under a list item */
.ec-cca .ec-dcm-report-list li .ec-cca-src {
    display: block;
    margin-top: 8px;
    font-size: var(--cca-small);
    color: var(--dcm-text-dim);
}

/* Collapsed tables */
.ec-cca details.ec-dcm-all-states { border: 1.5px solid var(--dcm-border); border-radius: var(--dcm-radius); margin-top: 2rem; }
.ec-cca details.ec-dcm-all-states .ec-dcm-state-count-table-wrap { margin: 0 16px; }

/* Sources */
.ec-cca .ec-dcm-methodology ul { list-style: disc; }
.ec-cca .ec-dcm-methodology li a { color: var(--dcm-accent); font-weight: 700; }

@media (max-width: 640px) {
    .ec-cca .ec-cca-facts tbody td:first-child { width: auto; }
    .ec-cca-quote, .ec-cca-notice { padding: 20px 22px; }
}
