/* ==========================================================================
   Ranosys Stats Counter Widget — Frontend Styles
   ========================================================================== */

/* Wrapper */
.rsc-stats-wrapper {
    width: 100%;
    background-color: #f5f5f5;
    padding: 30px 40px;
    box-sizing: border-box;
}

/* Inner flex grid */
.rsc-stats-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px 20px;
    width: 100%;
}

/* Each counter item */
.rsc-counter-item {
    flex: 1 1 120px;
    min-width: 100px;
    position: relative;
}

/* Divider variant — vertical line on the right */
.rsc-counter-item.rsc-has-divider::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background-color: #dddddd;
}
.rsc-counter-item.rsc-has-divider:last-child::after {
    display: none;
}

/* Number row */
.rsc-counter-number {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    color: #e01e24;
    margin-bottom: 8px;
    white-space: nowrap;
    display: block;
    /* Prevent layout shift while counting */
    min-height: 1.2em;
}

/* Suffix / Prefix inherit parent colour */
.rsc-counter-number .rsc-suffix,
.rsc-counter-number .rsc-prefix {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* Description */
.rsc-counter-desc {
    font-size: 0.85rem;
    color: #333333;
    line-height: 1.4;
    margin: 0;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Animation state — numbers are invisible until JS kicks in
   -------------------------------------------------------------------------- */
.rsc-stats-wrapper[data-scroll="true"] .rsc-counter-number.rsc-waiting {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.rsc-stats-wrapper[data-scroll="true"] .rsc-counter-number.rsc-animating,
.rsc-stats-wrapper[data-scroll="true"] .rsc-counter-number.rsc-done {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media ( max-width: 1024px ) {
    .rsc-stats-inner {
        gap: 24px 16px;
    }
    .rsc-counter-number {
        font-size: 1.9rem;
    }
}

@media ( max-width: 768px ) {
    .rsc-stats-wrapper {
        padding: 24px 20px;
    }
    .rsc-stats-inner {
        flex-wrap: wrap;
        gap: 24px 16px;
    }
    .rsc-counter-item {
        flex: 1 1 calc(50% - 16px);
        min-width: 120px;
    }
    /* Remove divider in narrow layouts */
    .rsc-counter-item.rsc-has-divider::after {
        display: none;
    }
}

@media ( max-width: 480px ) {
    .rsc-counter-item {
        flex: 1 1 100%;
    }
    .rsc-counter-number {
        font-size: 1.7rem;
    }
}
