.modern-counter-section {
    padding: 40px 20px 70px 20px;
    background: #f8f9fb;

    --front-bg: #ffffff;
    --back-bg: #002060;
    --front-text: #002060;
    --back-text: #ffffff;
}

.counter-container {
    max-width: 1200px;
    margin: auto;
}

.counter-heading {
    text-align: center;
    margin-bottom: 10px;
}

.counter-heading h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    color: #38eda2;
}

/* Fonts */

.font-arial { font-family: Arial, sans-serif; }
.font-roboto { font-family: 'Roboto', sans-serif; }
.font-poppins { font-family: 'Poppins', sans-serif; }
.font-poetsen { font-family: 'Poetsen One', sans-serif; }
.font-winky { font-family: 'Winky Rough', cursive; }

/* GRID */

.counter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

/* CARD */

.counter-card {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 16px;
    perspective: 1200px;
    overflow: hidden;
}

/* FLIP CORE */

.flip-inner {
    position: absolute;
    inset: 0;
    transition: transform 0.7s ease;
    transform-style: preserve-3d;
}

.flip-enabled.flipped .flip-inner {
    transform: rotateY(180deg);
}

.flip-face {
    position: absolute;
    inset: 0;
    padding: 20px;
    border-radius: 16px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.flip-front {
    background: var(--front-bg);
    color: var(--front-text);
}

.flip-back {
    background: var(--back-bg);
    color: var(--back-text);
    transform: rotateY(180deg);
    text-align: center;
}

/* MEDIA */

.flip-media {
    position: absolute;
    inset: 0;
}

.flip-media img,
.flip-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CAPTION */

.flip-caption {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: 6px 10px;
    background: rgba(0,0,0,0.4);
    color: white;
    border-radius: 6px;
    font-size: 13px;
}

/* BACK CONTENT */

.flip-back-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.flip-message {
    font-size: 16px;
    font-weight: 600;
}

.flip-button {
    background: white;
    color: #002060;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
}

.flip-button:hover {
    opacity: 0.85;
}

/* SHADOW SYSTEM */

.shadow-soft .flip-face {
    box-shadow:
        8px 8px 20px rgba(0,0,0,0.08),
        -6px -6px 15px rgba(255,255,255,0.9);
}

.shadow-strong .flip-face {
    box-shadow:
        0 15px 35px rgba(0,0,0,0.12),
        0 5px 10px rgba(0,0,0,0.08);
}

.glass-3d .flip-face {
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.tilt-3d .flip-face {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
/* MULTILINE MESSAGE SUPPORT */

.flip-message {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    text-align: center;
}
/* ================= IMAGE RESIZING (PORTED FROM IMAGE FLIPPER) ================= */

.flip-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-image img,
.flip-image video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* THIS is the magic */
    border-radius: 12px;
}

