/* ==========================================================================
   Statistics Bar Block
   Animated counter statistics with optional badges
   ========================================================================== */

/* ============================================================
   BASE BLOCK STYLES
   ============================================================ */
.section--stats-modules {
    padding: 80px 0;
    background-color: var(--scheme-bg, #ffffff);
    color: var(--scheme-text, #313a4c);
    overflow: hidden; 
}

/* Full-bleed background - Front end behavior */
.section--stats-modules.alignfull {
    width: 100vw;
    position: relative;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    margin-left: 0;
    margin-right: 0;
    max-width: 100vw;
    box-sizing: border-box;
}

/* Editor-specific overrides - Forces the block to reset when inside Gutenberg */
.is-editor-preview.section--stats-modules.alignfull,
.block-editor-block-list__layout .section--stats-modules.alignfull,
.editor-styles-wrapper .section--stats-modules.alignfull {
    width: 100% !important;
    max-width: 100% !important;
    left: auto !important;
    transform: none !important;
}

.stats-modules__wrap {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 40px; 
}

.stats-modules__inner {
    width: 100%;
}

/* ============================================================
   HEADER
   ============================================================ */
.stats-modules__header {
    margin-bottom: 40px;
    text-align: center;
}

.stats-modules__heading h2 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 0;
    color: var(--scheme-text, #313a4c);
}

/* ============================================================
   STATS CONTAINER
   ============================================================ */
.stats-modules__container__inner {
    display: flex;
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap; 
    width: 100%;
    gap: 40px; 
}

@media (min-width: 64em) {
    .stats-modules__container__inner {
        gap: 50px 70px; 
    }
}

/* ============================================================
   INDIVIDUAL STAT CARDS (Image OR Metric)
   ============================================================ */
.stats-module__wrap {
    flex: 0 0 auto; 
    max-width: 100%; 
    margin: 0; 
    padding: 0; 
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================================
   METRIC CARD STYLES
   ============================================================ */
.stats-module--metric .stats-module__content {
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    min-width: 0;
}

@media (min-width: 48em) {
    .stats-module--metric .stats-module__content {
        align-items: flex-start; 
        text-align: left;
    }
}

.stats-module__value {
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap; 
    white-space: nowrap; 
}

.stats-module__number,
.stats-module__unit {
    font-size: 5rem;
    line-height: 1;
    font-weight: 700;
    color: var(--scheme-highlight, #BAD532);
}

.stats-module__number.has-unit {
    color: var(--scheme-text, #313a4c);
}

.stats-module__label {
    font-weight: 700;
    margin-top: 8px;
    color: var(--scheme-text, #313a4c);
    width: 100%;
}

.stats-module__label p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

/* ============================================================
   BADGE CARD STYLES
   ============================================================ */
.stats-module--badge .stats-module__badge {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

.stats-module__badge img {
    max-height: 120px; 
    max-width: 100%; 
    width: auto;
    height: auto;
    object-fit: contain; 
    display: block;
}

/* ============================================================
   RESPONSIVE OVERRIDES
   ============================================================ */
@media (max-width: 1024px) {
    .stats-module__number,
    .stats-module__unit {
        font-size: 4rem;
    }
}

@media (max-width: 768px) {
    .section--stats-modules {
        padding: 50px 0; 
    }

    .stats-modules__heading h2 {
        font-size: 2rem;
    }

    .stats-module__number,
    .stats-module__unit {
        font-size: 3.5rem;
    }

    .stats-module__badge img {
        max-height: 100px;
    }
}

@media (max-width: 480px) {
    .stats-modules__heading h2 {
        font-size: 1.75rem;
    }
}