﻿/* ============================================
   Counter Section Styles
   ============================================ */
.cera-counter-section {
    background-color: #fbfbfb;
    padding: 1.5rem 0;
}


.counter-text-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding-right: 2rem;
    align-items: flex-start;
    position: relative;
}

    .counter-text-content h2 {
        font-family: var(--stfm-heading-font);
        font-weight: 700;
        font-size: 2.2rem;
        color: var(--stfm-primary);
        margin-bottom: 1.25rem;
        line-height: 1.2;
    }

    .counter-text-content .lead {
        font-size: 1.1rem;
        color: var(--stfm-text);
        margin-bottom: 0;
        line-height: 1.6;
        font-weight: 400;
    }

    .counter-text-content p {
        color: #666;
        line-height: 1.6;
        margin-bottom: 0;
    }

.section-label {
    color: var(--stfm-tertiary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .section-label i {
        font-size: 1rem;
    }

.simple-process {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.process-step {
    font-weight: 600;
    color: var(--stfm-primary);
    font-size: 1rem;
}

.simple-process i {
    color: var(--stfm-secondary);
    font-size: 0.9rem;
}


.counter-cards-grid::before,
.counter-cards-grid::after {
    content: '';
    position: absolute;
    background: linear-gradient(to right, #e9ecef 0%, #e9ecef calc(50% - 20px), transparent calc(50% - 8px), transparent calc(50% + 8px), #e9ecef calc(50% + 20px), #e9ecef 100%);
    height: 1px;
    width: 100%;
    top: 50%;
    left: 0;
    transform: translateY(-0.5px);
    z-index: 1;
}

/* horizontal line */
/* ===========================================================
   GRID LINES – stop flush with the cards and keep the fade
   =========================================================== */

/* horizontal line */
.counter-cards-grid::before {
    content: "";
    position: absolute;
    height: 1px;
    /* ❶  full width minus the left *and* right padding  */
    width: calc(100% - (var(--g)*2));
    left: var(--g); /* start after left padding */
    top: 50%;
    transform: translateY(-0.5px);
    /* ❷  fade-out near the centre point (8 px gap)      */
    background: linear-gradient( to right, #e9ecef 0%, #e9ecef calc(50% - 20px), transparent calc(50% - 8px), transparent calc(50% + 8px), #e9ecef calc(50% + 20px), #e9ecef 100% );
    z-index: 1;
}

/* vertical line */
.counter-cards-grid::after {
    content: "";
    position: absolute;
    width: 1px;
    /* ❸  full height minus the top *and* bottom padding */
    height: calc(100% - (var(--g)*2));
    top: var(--g); /* start after top padding  */
    left: 50%;
    transform: translateX(-0.5px);
    /* same centre fade-out */
    background: linear-gradient( to bottom, #e9ecef 0%, #e9ecef calc(50% - 20px), transparent calc(50% - 8px), transparent calc(50% + 8px), #e9ecef calc(50% + 20px), #e9ecef 100% );
    z-index: 1;
}


/* vertical line */
.counter-cards-grid::after {
    content: "";
    position: absolute;
    width: 1px;
    /* ❸  full height minus the top *and* bottom padding */
    height: calc(100% - (var(--g)*2));
    top: var(--g); /* start after top padding  */
    left: 50%;
    transform: translateX(-0.5px);
    /* same centre fade-out */
    background: linear-gradient( to bottom, #e9ecef 0%, #e9ecef calc(50% - 20px), transparent calc(50% - 8px), transparent calc(50% + 8px), #e9ecef calc(50% + 20px), #e9ecef 100% );
    z-index: 1;
}


.counter-cards-grid .center-point {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--stfm-primary);
    transform: translate(-50%, -50%);
    z-index: 2;
}

.counter-card,
.counter-image {
    /* already have min-height:140px;  bump it up or keep it */
    min-height: 160px; /* whatever value looks right */
    display: flex;
    align-items: center;
    justify-content: center;
}


.counter-row {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3rem;
}

    .counter-row:last-child {
        margin-bottom: 0;
    }

    .counter-row > * {
        flex: 1;
    }

.counter-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    min-height: 140px;
}

.counter-img {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.counter-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}


    .counter-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

.counter-number {
    font-family: var(--stfm-heading-font);
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--stfm-secondary);
    margin-bottom: 0.5rem;
    line-height: 1;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.counter-label {
    font-family: var(--stfm-body-font);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--stfm-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

    .counter-label:hover {
        color: var(--stfm-tertiary);
        text-decoration: underline;
    }

.counter-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.counter-link {
    color: var(--stfm-tertiary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

    .counter-link:hover {
        color: var(--stfm-primary);
        text-decoration: underline;
    }

/* =====================   GRID WRAPPER   ===================== */
.counter-cards-grid {
    /* ❶ keep the existing settings … */
    display: grid;
    grid-template-columns: repeat(2,1fr);
    grid-template-rows: repeat(2,1fr);
    gap: 2rem; /* the card-to-card gap             */
    padding: 2rem; /* matches the gap for symmetry     */
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    /* ❷ … plus these two new lines */
    --g: 2rem; /* same number as `gap` & `padding` */
    overflow: hidden; /* clips any over-run from lines    */
}


/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 991.98px) {
    .cera-main-section .row::before {
        display: none;
    }

    .cera-accordion {
        padding-right: 0; /* Remove padding on mobile */
    }

    .cera-sidebar {
        position: static;
        margin-top: 2rem;
        padding-left: 0;
    }

    .counter-text-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        height: 100%;
        padding-right: 2rem;
    }

        .counter-text-content h2 {
            font-family: var(--stfm-heading-font);
            font-weight: 700;
            font-size: 2rem;
            color: var(--stfm-primary);
            margin-bottom: 1rem;
            line-height: 1.2;
        }

        .counter-text-content .lead {
            font-size: 1.1rem;
            color: var(--stfm-primary);
            margin-bottom: 0;
            line-height: 1.5;
            font-weight: 400;
        }

    .counter-cards-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .counter-image {
        display: none;
    }

    /* Hide grid lines by removing pseudo-elements */
    .counter-cards-grid::before,
    .counter-cards-grid::after {
        display: none;
    }

    /* Hide center point */
    .counter-cards-grid .center-point {
        display: none;
    }

    /* Adjust grid to show only cards */
    .counter-cards-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 1.5rem;
        padding: 1rem;
        max-width: 400px;
    }

    /* Stack counter cards vertically */
    .counter-card {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .counter-card {
        padding: 1.5rem;
    }

    .counter-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 575.98px) {
    counter-cards-grid {
        padding: 0.5rem;
        gap: 1rem;
    }
}