/**
 * Projects Impact — frontend layout (matches homepage design).
 */
.jpi-section {
    --jpi-bg: #7dad3f;
    --jpi-bg-dark: #00452e;
    --jpi-bg-panel: #00452e;
    --jpi-text: #ffffff;
    --jpi-heading: #00452e;
    --jpi-tab-inactive-bg: #ffffff;
    --jpi-tab-inactive-text: #00452e;
    box-sizing: border-box;
    background: var(--jpi-bg);
    position: relative;
    left: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 48px 24px 56px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.jpi-section.jpi-is-fullbleed {
    width: 100vw;
    max-width: 100vw;
}

/* Ancestors unlocked by JS for edge-to-edge green */
.jpi-fullbleed-ancestor,
.ast-container:has(.jpi-section),
.site-content:has(.jpi-section),
#primary:has(.jpi-section),
.entry-content:has(.jpi-section),
.elementor-column:has(.jpi-section),
.elementor-widget-wrap:has(.jpi-section),
.elementor-widget-shortcode:has(.jpi-section),
.elementor-widget-shortcode:has(.jpi-section) > .elementor-widget-container,
.elementor-element:has(.jpi-section),
.elementor-element:has(.jpi-section) > .e-con-inner,
.e-con:has(.jpi-section),
.e-con-inner:has(.jpi-section) {
    overflow: visible !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.elementor-section:has(.jpi-section) > .elementor-container {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.elementor-section:has(.jpi-section) {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.jpi-heading {
    text-align: center;
    color: var(--jpi-heading);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0 0 28px;
    line-height: 1.3;
}

/* Year tabs (horizontal) */
.jpi-year-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}

.jpi-year-tab {
    appearance: none;
    border: 2px solid var(--jpi-bg-dark);
    background: var(--jpi-tab-inactive-bg);
    color: var(--jpi-tab-inactive-text);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 36px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.jpi-year-tab.is-active,
.jpi-year-tab:hover {
    background: var(--jpi-bg-dark);
    color: #ffffff !important;
}

.jpi-section button.jpi-year-tab.is-active,
.jpi-section button.jpi-year-tab:hover {
    color: #ffffff !important;
}

.jpi-year-tab:focus {
    outline: 2px solid var(--jpi-bg-dark);
    outline-offset: 2px;
}

/* Body: sidebar + panel */
.jpi-body {
    display: flex;
    max-width: 1100px;
    margin: 0 auto;
    min-height: 380px;
    border-radius: 0;
    overflow: hidden;
    background: var(--jpi-bg);
}

.jpi-project-tabs {
    flex: 0 0 34%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    background: var(--jpi-bg) !important;
}

.jpi-project-tab {
    appearance: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.85);
    background: transparent !important;
    color: #ffffff !important;
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.35;
    padding: 18px 16px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: none !important;
}

.jpi-section button.jpi-project-tab:not(.is-active) {
    background: transparent !important;
    color: #ffffff !important;
}

.jpi-project-tab:first-child {
    border-top: 1px solid rgba(255, 255, 255, 0.85);
}

.jpi-project-tab.is-active {
    background: var(--jpi-bg-panel) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.jpi-section button.jpi-project-tab.is-active {
    color: #ffffff !important;
}

.jpi-project-tab:hover:not(.is-active) {
    background: rgba(0, 0, 0, 0.08);
}

.jpi-project-tab:focus {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.jpi-panel {
    flex: 1;
    background: var(--jpi-bg-panel);
    color: var(--jpi-text);
    padding: 36px 40px 40px;
    border-left: 3px solid rgba(255, 255, 255, 0.9);
}

.jpi-panel-title,
.jpi-panel-title .jpi-panel-project,
.jpi-panel-title .jpi-panel-year,
.jpi-panel h3 {
    color: #ffffff !important;
    text-align: center;
    font-size: clamp(1.1rem, 2.5vw, 1.45rem);
    font-weight: 700;
    margin: 0 0 32px;
    line-height: 1.35;
}

.jpi-stat-label,
.jpi-stat-value {
    color: #ffffff !important;
}

.jpi-panel-year {
    display: inline;
}

.jpi-panel-year::before {
    content: ' ';
}

.jpi-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 32px;
}

.jpi-stat-label {
    font-size: 0.82rem;
    line-height: 1.35;
    margin-bottom: 6px;
    opacity: 0.95;
}

.jpi-stat-value {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.1;
}

.jpi-empty {
    grid-column: 1 / -1;
    text-align: center;
    opacity: 0.85;
    margin: 0;
}

@media (max-width: 768px) {
    .jpi-body {
        flex-direction: column;
    }

    .jpi-project-tabs {
        flex: none;
        max-width: none;
        width: 100%;
    }

    .jpi-panel {
        border-left: none;
        border-top: 3px solid rgba(255, 255, 255, 0.9);
        padding: 28px 20px 32px;
    }

    .jpi-stats-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
}
