/* ========================= Frugal Flip Cards ========================= */
.ehe-flipcards {
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

/* ---- Rows ---- */
.flip-card-row {
    display: flex !important;
    justify-content: center !important;
    gap: 16px !important;
    margin-top: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Second row: constrain to 2/3 of available width so 2 cards match the size of the 3 above */
.flip-card-row--center {
    width: calc((100% + 16px) * 2 / 3 - 16px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Cards: fluid, always equal size, max 280px */
.flip-card {
    flex: 1 1 0 !important;
    max-width: 280px !important;
    min-width: 0 !important;
    position: relative;
}

/* 3:4 ratio via padding-bottom trick */
.flip-card-ratio {
    width: 100%;
    padding-bottom: 133.33%;
    position: relative;
}

/* 3D wrapper */
.flip-card-inner {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transition: transform 0.7s ease;
}

/* Flip on hover */
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Faces */
.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 2px solid #4F2683;
    border-radius: 18px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

/* Back face */
.flip-card-back {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
    padding: 11%;
    box-sizing: border-box;
}

/* ---------- FRONT LAYOUT ---------- */
.flip-card-front {
    display: flex;
    flex-direction: column;
}

.pillar-icon-area {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8%;
    min-height: 0;
}

.pillar-icon {
    width: 65%;
    height: auto;
    max-width: 120px;
    object-fit: contain;
    display: block;
}

.pillar-text-area {
    flex: 0 0 38%;
    background: #4F2683;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 8% 6% 0 6%;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
}

.pillar-number {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(10px, 1.5vw, 14px);
}

.pillar-number::after {
    content: "";
    display: block;
    width: 70%;
    height: 1px;
    background: rgba(255, 255, 255, 0.6);
    margin: 6px auto 8px auto;
}

.pillar-subtitle {
    font-size: clamp(9px, 1.3vw, 12px);
    font-weight: 600;
    line-height: 1.3;
}

/* ---------- BACK LAYOUT ---------- */
.flip-card-back-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flip-card-back p {
    margin: 0;
    font-size: clamp(10px, 1.3vw, 13px);
    line-height: 1.45;
    flex: 1 1 auto;
    overflow: auto;
    padding-right: 4px;
    text-align: center;
}

.flip-back-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.pillar-more-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: #4F2683;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(10px, 1.3vw, 13px);
    line-height: 1;
    border: 2px solid #4F2683;
    position: relative;
    z-index: 3;
}

.pillar-more-btn:hover,
.pillar-more-btn:focus {
    background: #fff;
    color: #4F2683 !important;
}

/* ---------- RESPONSIVE ---------- */

/* Mobile: single column */
@media (max-width: 580px) {
    .flip-card-row {
        flex-direction: column !important;
        align-items: center !important;
        gap: 14px !important;
    }
    .flip-card {
        flex: 0 0 auto !important;
        width: 80% !important;
        max-width: 300px !important;
    }
    .pillar-number {
        font-size: 14px;
    }
    .pillar-subtitle {
        font-size: 12px;
    }
    .flip-card-back p {
        font-size: 13px;
    }
    .pillar-more-btn {
        font-size: 13px;
    }
}