/*
 * Institutional Intel Panels
 *
 * Shared styles for the collapsible `<details class="intel-panel">` blocks
 * used on directory pages (community detail, state hub, city hub). Each
 * panel is a self-contained `<details>` with a `<summary>` header and an
 * `.intel-body` content area.
 *
 * Source of truth — when adding or modifying rules, update them here only;
 * all three directory templates load this file via {% static %}.
 *
 * Includes the RC Compliance Readiness panel styling because that panel
 * is the first one shared across community + state + city pages. Other
 * panels (law changes, warrantability, etc.) currently render only on
 * community_detail.html; their CSS still lives inline in that template.
 * Migrate as needed when other panels get distributed.
 */

/* ── Panel shell ───────────────────────────────────────── */

.intel-panel {
    border: 1px solid #e9ecef;
    border-radius: 2px;
    background: #fff;
    margin-bottom: 0.5rem;
}

.intel-panel > summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.intel-panel > summary::-webkit-details-marker { display: none; }

.intel-panel > summary::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 1.5px solid #999;
    border-bottom: 1.5px solid #999;
    transform: rotate(-45deg);
    transition: transform 0.15s;
    flex-shrink: 0;
    margin-left: 1rem;
}

.intel-panel[open] > summary::after {
    transform: rotate(45deg);
}

.intel-summary-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.intel-summary-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.intel-summary-hint {
    font-size: 0.75rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intel-summary-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}

.intel-summary-badge.very-high { color: #333; border-color: #333; background: #f5f5f5; }
.intel-summary-badge.relatively-high { color: #555; border-color: #999; background: #fafafa; }
.intel-summary-badge.moderate { color: #666; border-color: #bbb; }
.intel-summary-badge.low { color: #888; border-color: #ccc; }

.intel-body {
    border-top: 1px solid #f0f0f0;
}

/* Link hover inside panels — statute citations, source links, and
   authority links use inline grey colors; override hover with !important
   so every grey link in the enrichment panels resolves to black on hover. */
.intel-panel a { transition: color 0.12s ease; }
.intel-panel a:hover,
.intel-panel a:focus { color: #000 !important; }

/* ── RC Compliance Readiness panel ─────────────────────── */

.rc-checklist { list-style: none; padding: 0; margin: 0; }
.rc-checklist li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.45rem 1.25rem;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}
.rc-checklist li:last-child { border-bottom: none; }
.rc-check-icon { display: none; }

/* Numbered variant — only for statutory disclosure enumeration */
.rc-checklist--numbered { counter-reset: rc-item; }
.rc-checklist--numbered li { counter-increment: rc-item; gap: 0.75rem; }
.rc-checklist--numbered .rc-check-icon {
    display: inline-block;
    flex-shrink: 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    font-size: 0.7rem;
    color: #bbb;
    font-weight: 500;
    letter-spacing: 0.05em;
    min-width: 1.5rem;
}
.rc-checklist--numbered .rc-check-icon::before { content: counter(rc-item, decimal-leading-zero); }

.rc-statute-ref {
    font-size: 0.65rem;
    color: #bbb;
    font-weight: 500;
    white-space: nowrap;
    margin-left: auto;
    padding-left: 0.5rem;
}

/* ── Quotable disclosure items ──────────────────────────
   When an item has a corpus-backed `statute_quote`, the li wraps a
   <details> that toggles the verbatim text inline. When no quote
   exists, the li renders flat — same visual baseline as today. */
.rc-checklist li.rc-li-quotable {
    display: block;
    padding: 0;
}
.rc-checklist li.rc-li-quotable > details > summary {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.45rem 1.25rem;
    list-style: none;
    cursor: pointer;
    transition: background 0.12s ease;
}
.rc-checklist li.rc-li-quotable > details > summary::-webkit-details-marker { display: none; }
.rc-checklist li.rc-li-quotable > details > summary::after {
    content: '';
    width: 5px;
    height: 5px;
    border-right: 1.5px solid #bbb;
    border-bottom: 1.5px solid #bbb;
    transform: rotate(-45deg);
    transition: transform 0.15s, border-color 0.12s;
    flex-shrink: 0;
    margin-left: 0.5rem;
}
.rc-checklist li.rc-li-quotable > details[open] > summary::after {
    transform: rotate(45deg);
    border-color: #555;
}
.rc-checklist li.rc-li-quotable > details > summary:hover {
    background: #fafafa;
}
.rc-checklist li.rc-li-quotable > details > summary:hover::after {
    border-color: #555;
}

/* The blockquote of verbatim statute text, revealed when <details> opens.
   Restrained styling — left rule, neutral grey background, small fixed-pitch
   attribution at the bottom keying back to the citation + verification date. */
.rc-statute-quote {
    margin: 0 1.25rem 0.6rem 2.75rem;
    padding: 0.55rem 0.85rem 0.65rem;
    background: #fafafa;
    border-left: 2px solid #d0d0d0;
    font-size: 0.78rem;
    color: #555;
    line-height: 1.55;
    white-space: pre-line;
}
.rc-quote-attribution {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.7rem;
    color: #888;
    font-style: normal;
}

.rc-profile-header {
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    color: #555;
    line-height: 1.5;
    border-bottom: 1px solid #e9ecef;
}
.rc-profile-header strong { color: #333; }

/* Verified-date marker — flows with the fee/timing prose as a bulleted
   parenthetical. Restrained styling per the institutional aesthetic: the
   dollar amount stays the focal point; the verification date supports it. */
.rc-verified-badge {
    color: #888;
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Recent-amendments callout — renders inside the RC panel between the
   intro prose and the disclosure checklist. Surfaces a substantive
   LawChangeEvent on the controlling statute (last 12 months). */
.rc-amendment-callout {
    padding: 0.65rem 1.25rem;
    background: #fafafa;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.78rem;
    color: #555;
    line-height: 1.5;
}
.rc-amendment-callout-head {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}
.rc-amendment-tag {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #1a1a1a;
}
.rc-amendment-when {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.rc-amendment-body a { color: #333; text-decoration: underline; }
.rc-amendment-body a:hover { color: #000; }

.rc-cta-strip {
    padding: 0.75rem 1.25rem;
    background: #fafafa;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
    color: #666;
}
.rc-cta-strip a { color: #333; font-weight: 600; text-decoration: none; }
.rc-cta-strip a:hover { color: #000; }
