.atx-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    max-width: 1320px;
    margin: 0 auto;
}

.atx-card {
    position: relative;
    height: 550px;
    min-height: 550px;
    perspective: 1500px;
}

.atx-card-front,
.atx-card-back {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #f7f7f7;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform .8s cubic-bezier(.4, .2, .2, 1);
    overflow: hidden;
}

.atx-card-front {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.atx-card-back {
    position: absolute;   /* ← changed from relative */
    inset: 0;
    width: 100%;
    height: 100%;         /* ← now properly fills parent */
    padding: 32px;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-position: center !important;
    background-size: cover !important;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, .08);
    background: #f7f7f7;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform .8s cubic-bezier(.4, .2, .2, 1);
}

.atx-card-back::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient( 180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.83) 100% );
    z-index: 1;
}

.atx-card-back .atx-card-text{
    font-size: 14px;
    color: #fff !important;
    z-index: 9;
}

.atx-card-back .atx-card-title{
    z-index: 9;
    color: #fff !important;
}

.atx-card-back-content{
    position:relative;
    z-index:2;
}

.atx-card:hover .atx-card-front {
    transform: rotateY(180deg);
}

.atx-card:hover .atx-card-back {
    transform: rotateY(360deg);
}

.atx-card-image {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
    border-radius: 11px !important;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.atx-card-title {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 400;
    color: #111;
    margin: 0 0 18px;
}

.atx-card-text {
    font-family: "Poppins", sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: #5c5c5c;
    margin: 0;
}

.atx-card-front .atx-card-text {
    flex: 1;
}

.atx-card-back .atx-card-title {
    margin-bottom: 20px;
}

.atx-card-back .atx-card-text {
    overflow-y: auto;
}

.atx-card:hover {
    z-index: 5;
}

.atx-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 80px;
}

.atx-title {
    font-family: "Playfair Display", serif;
    font-size: 62px;
    line-height: 1;
    font-weight: 400;
    color: #111;
    margin: 0 0 20px;
}

.atx-subtitle {
    font-family: "Poppins", sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

@media(max-width:1024px) {

    .atx-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .atx-card {
        height: 700px;
    }

    .atx-title {
        font-size: 48px;
    }

    .atx-card-image {
        height: 320px;
    }
}

@media(max-width:767px) {

    .atx-grid {
        grid-template-columns: 1fr;
    }

    .atx-card {
        height: 650px;
    }

    .atx-title {
        font-size: 38px;
    }

    .atx-card-image {
        height: 260px;
    }
}