/* =========================== */
/* Coping ToolKit */
/* =========================== */
/* Force 4 columns even on mobile */
.custom-grid > .col {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0.25rem; /* tighter spacing */
}

/* Card size & aspect ratio */
.coping-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.card-inner {
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    position: relative;
}

.coping-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    backface-visibility: hidden;
    top: 0;
    left: 0;
    border-radius: 10px;
}

.card-front {
    background-color: #fff;
    z-index: 2;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-back {
    background: var(--base-color);
    border: 1px solid #e6f1f1;
    box-shadow: 0 0 0 0.15rem rgba(111, 96, 160, 0.25);
    color: var(--color-muted-grey);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    font-size: 0.85rem;
}

/* Overlay for when card is expanded */
.card-overlay {
    display: none;
}

@media (max-width: 576px) {
.card-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    }
}

.coping-card.flipped ~ .card-overlay {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 576px) {
    .coping-card.flipped {
        position: fixed;
        top: 50%;
        left: 50%;
        width: 90vw;
        max-height: 80vh;
        transform: translate(-50%, -50%) scale(1.05);
        z-index: 1050;
        aspect-ratio: auto;
        overflow-y: auto;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
        cursor: zoom-out;
        border-radius: 15px;
    }
    .coping-card.flipped .card-inner {
        height: auto;
        min-height: 100%;
    }
    .coping-card.flipped .card-back {
        position: relative;
        height: auto;
        padding: 2rem;
        overflow-y: auto;
    }
    .coping-card.flipped .card-back h5 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    .coping-card.flipped .card-back p {
        font-size: 1rem;
    }
}

/* Make keyboard + mouse look identical: no focus ring on the card */
.coping-card:focus,
.coping-card:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}


