/* U.S. State Electricity Map — mirrors Global Electricity Map (em-) styling */

.usm-hero {
    padding: 3rem 0 2rem;
    background: linear-gradient(180deg, #0A192F 0%, #0d1f35 100%);
    border-bottom: 1px solid rgba(197, 160, 5, 0.15);
}

.usm-kicker {
    color: #64ffda;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 0.75rem;
}

.usm-title {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.usm-subtitle {
    max-width: 760px;
    margin: 0 auto;
    color: #8b95a8;
    font-size: 1rem;
    line-height: 1.65;
}

.usm-map-section {
    padding: 2rem 0 3.5rem;
    background: #0A192F;
    position: relative;
}

.usm-controls {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.usm-mode-info {
    color: #8b95a8;
    font-size: 0.82rem;
    line-height: 1.5;
    padding-left: 0.15rem;
    margin-top: 0.5rem;
}

.usm-label {
    color: #C5A005;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
}

.usm-select {
    background-color: #0A192F;
    border: 1px solid rgba(100, 255, 218, 0.25);
    color: #e6edf3;
}

.usm-select:focus {
    border-color: #64ffda;
    box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.15);
}

.usm-range {
    accent-color: #64ffda;
}

.usm-year-value {
    color: #64ffda;
    font-weight: 700;
}

.usm-stats {
    color: #8b95a8;
    font-size: 0.85rem;
    line-height: 1.4;
}

.usm-crawlable-summary {
    background: rgba(13, 31, 53, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    color: #8b95a8;
    font-size: 0.88rem;
    line-height: 1.6;
}

.usm-crawlable-label {
    color: #C5A005;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.usm-crawlable-fuels {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.usm-map-row {
    align-items: stretch;
}

.usm-sidebar {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    min-height: 520px;
    max-height: min(70vh, 640px);
    display: flex;
    flex-direction: column;
}

.usm-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.usm-sidebar-title {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.usm-reset-btn {
    color: #64ffda;
    border: 1px solid rgba(100, 255, 218, 0.35);
    background: transparent;
    font-size: 0.75rem;
    white-space: nowrap;
}

.usm-reset-btn:hover {
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    border-color: #64ffda;
}

.usm-filter-input {
    background-color: #0A192F;
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: #e6edf3;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.usm-filter-input:focus {
    border-color: #64ffda;
    box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.12);
    background-color: #0A192F;
    color: #e6edf3;
}

.usm-state-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.usm-state-item {
    margin: 0;
}

.usm-state-btn {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #c9d1d9;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.usm-state-btn:hover {
    background: rgba(100, 255, 218, 0.08);
    color: #e6edf3;
}

.usm-state-btn.is-active {
    background: rgba(197, 160, 5, 0.15);
    color: #f0e6c8;
    box-shadow: inset 3px 0 0 #C5A005;
}

.usm-state-btn.is-no-data {
    opacity: 0.55;
}

.usm-state-value {
    color: #64ffda;
    font-size: 0.75rem;
    white-space: nowrap;
}

.usm-map-card {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(100, 255, 218, 0.15);
    border-radius: 12px;
    overflow: hidden;
}

.usm-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.usm-map-legend {
    color: #C5A005;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.usm-map {
    width: 100%;
    min-height: 520px;
    height: min(70vh, 640px);
}

.usm-detail-panel {
    background: rgba(13, 31, 53, 0.95);
    border: 1px solid rgba(197, 160, 5, 0.25);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
}

.usm-detail-name {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.usm-source-badge {
    color: #64ffda;
    font-size: 0.82rem;
    font-weight: 600;
}

.usm-detail-subtitle {
    color: #8b95a8;
    font-size: 0.85rem;
}

.usm-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.usm-stat-label {
    display: block;
    color: #8b95a8;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
}

.usm-stat-value {
    color: #f0e6c8;
    font-size: 1.05rem;
    font-weight: 700;
}

.usm-stat-value.is-positive {
    color: #64ffda;
}

.usm-stat-value.is-negative {
    color: #f97316;
}

.usm-detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.usm-detail-section-title {
    color: #C5A005;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.usm-top-fuels {
    list-style: none;
    padding: 0;
    margin: 0;
}

.usm-top-fuels li {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(100, 255, 218, 0.08);
    color: #c9d1d9;
    font-size: 0.85rem;
}

.usm-top-fuel-value {
    color: #64ffda;
}

.usm-mini-chart,
.usm-sparkline {
    min-height: 180px;
}

.usm-sparkline-caption {
    color: #8b95a8;
    font-size: 0.78rem;
}

.usm-renewable-footnote {
    color: #6b7280;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.usm-state-notes {
    color: #8b95a8;
    font-size: 0.88rem;
    line-height: 1.55;
}

.usm-global-link {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(100, 255, 218, 0.06);
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 8px;
}

.usm-global-link a {
    color: #64ffda;
    font-weight: 600;
    text-decoration: none;
}

.usm-global-link a:hover {
    text-decoration: underline;
}

.usm-layer-slot {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.usm-loading {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 47, 0.75);
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.usm-loading.is-visible {
    display: flex;
}

.usm-error {
    margin-bottom: 1rem;
}

/* About this data */
.usm-about {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(197, 160, 5, 0.15);
}

.usm-about-heading {
    font-family: 'Playfair Display', serif;
    color: #f0e6c8;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.usm-about-intro {
    color: #8b95a8;
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 820px;
    margin-bottom: 1.25rem;
}

.usm-about-accordion {
    --bs-accordion-bg: rgba(13, 31, 53, 0.6);
    --bs-accordion-border-color: rgba(100, 255, 218, 0.12);
    --bs-accordion-btn-bg: rgba(13, 31, 53, 0.8);
    --bs-accordion-active-bg: rgba(13, 31, 53, 0.95);
    --bs-accordion-active-color: #f0e6c8;
    --bs-accordion-btn-focus-box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.12);
}

.usm-about-item {
    --bs-accordion-bg: rgba(13, 31, 53, 0.6);
    --bs-accordion-btn-bg: rgba(13, 31, 53, 0.8);
    --bs-accordion-active-bg: rgba(13, 31, 53, 0.95);
    background-color: rgba(13, 31, 53, 0.6);
    border: 1px solid rgba(100, 255, 218, 0.12);
    margin-bottom: 0.5rem;
    border-radius: 8px !important;
    overflow: hidden;
}

.usm-about-item .accordion-button {
    background-color: rgba(13, 31, 53, 0.8);
    color: #C5A005;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: none;
}

.usm-about-item .accordion-button:not(.collapsed) {
    background-color: rgba(13, 31, 53, 0.95);
    color: #64ffda;
}

.usm-about-item .accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(100, 255, 218, 0.12);
    border-color: transparent;
}

.usm-about-item .accordion-button::after {
    filter: brightness(0) saturate(100%) invert(72%) sepia(48%) saturate(500%) hue-rotate(118deg);
}

.usm-about-item .accordion-button:not(.collapsed)::after {
    filter: brightness(0) saturate(100%) invert(88%) sepia(21%) saturate(746%) hue-rotate(99deg);
}

.usm-about-item .accordion-body {
    background-color: rgba(13, 31, 53, 0.6);
    color: #8b95a8;
    font-size: 0.9rem;
    line-height: 1.65;
}

.usm-about-item .accordion-body strong {
    color: #e6edf3;
}

.usm-about-item .accordion-body p:last-child,
.usm-about-item .accordion-body ul:last-child {
    margin-bottom: 0;
}

.usm-about-item .accordion-body ul {
    padding-left: 1.25rem;
}

.usm-about-item .accordion-body a {
    color: #64ffda;
}

.usm-about-item .accordion-body a:hover {
    color: #9effea;
}

.usm-about-item .accordion-body code {
    color: #9effea;
    background: rgba(100, 255, 218, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85em;
}

.usm-crawlable-summary a {
    color: #64ffda;
}

.usm-crawlable-summary a:hover {
    color: #9effea;
}

.usm-explore-more {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(100, 255, 218, 0.12);
    border-radius: 12px;
    background: rgba(13, 31, 53, 0.6);
    text-align: center;
}

.usm-explore-more-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.usm-explore-more-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
}

.usm-explore-more-links a {
    color: rgba(100, 255, 218, 0.85);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}

.usm-explore-more-links a:hover {
    color: #64ffda;
}

.usm-explore-more-note {
    color: #8b95a8;
    font-size: 0.82rem;
    line-height: 1.5;
}

.usm-explore-more-note a {
    color: #64ffda;
}

.usm-explore-more-note a:hover {
    color: #9effea;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 991.98px) {
    .usm-sidebar {
        min-height: 280px;
        max-height: 320px;
        margin-bottom: 1rem;
    }

    .usm-map {
        min-height: 400px;
        height: 50vh;
    }
}
