/* Structural CSS for Architect Flip Box */
.afb-card-container {
    perspective: 1200px;
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.afb-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Flip Triggers */
.afb-card-container:hover .afb-card-inner,
.afb-card-container.afb-hovered .afb-card-inner {
    transform: rotateY(180deg);
}

.afb-card-container.flip-vertical:hover .afb-card-inner,
.afb-card-container.flip-vertical.afb-hovered .afb-card-inner {
    transform: rotateX(180deg);
}

/* Faces */
.afb-card-face {
	border: none !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    display: flex;
    align-items: center;
}

.afb-card-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.afb-card-back {
    transform: rotateY(180deg);
}

.afb-card-container.flip-vertical .afb-card-back {
    transform: rotateX(180deg);
}

/* Layout Grid Flex */
.afb-inner-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 40px;
}

/* Left to Right / Right to Left Order styling */
.afb-left-to-right .afb-inner-layout {
    flex-direction: row;
}

.afb-right-to-left .afb-inner-layout {
    flex-direction: row-reverse;
}

/* Image styling */
.afb-img-wrapper {
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afb-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Area */
.afb-content-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Front Side Content styling */
.afb-front-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Montserrat', sans-serif;
}

/* Back Side Content styling */
.afb-back-columns-wrapper {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertically centers the column-block and button inside the back face height */
}

.afb-back-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start; /* Aligns text of both columns at the top */
    margin-bottom: auto; /* Ensures space distribution works with the button */
    padding: 20px 0; /* Add visual spacing */
}

.afb-back-col {
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: #e0e0e0;
}

/* Button & Arrow Placement */
.afb-btn-holder {
    display: flex;
    width: 100%;
    margin-top: 15px; /* Fixed space between columns block and the button */
}

/* Align button to the left if the container layout direction is Reversed (Right to left) */
.afb-right-to-left .afb-btn-holder {
    justify-content: flex-start;
}
.afb-left-to-right .afb-btn-holder {
    justify-content: flex-end;
}

.afb-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Montserrat', sans-serif;
    transition: transform 0.3s ease;
}

.afb-btn:hover {
    transform: translateX(4px);
}

.afb-arrow-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.afb-btn:hover .afb-arrow-icon {
    transform: translateX(4px);
}

/* Responsive Overrides (Collapses at 1024px and below to support tablets & mobile in Elementor Simulator) */
@media (max-width: 1024px) {
    .afb-inner-layout {
        flex-direction: column !important;
        gap: 20px !important;
        padding: 20px 0;
    }
    
    .afb-img-wrapper {
        width: 100% !important;
        height: 160px !important;
        flex-basis: auto !important;
    }
    
    .afb-content-wrapper {
        width: 100% !important;
        flex-basis: auto !important;
    }

    .afb-front-title {
        font-size: 1.8rem;
        text-align: center;
    }
    
    .afb-back-columns {
        grid-template-columns: 1fr !important; /* Forces 1 column */
        gap: 15px !important;
        padding: 10px 0 !important;
    }
    
    .afb-back-col {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .afb-card-container {
        height: auto !important;
        min-height: 480px;
    }
    
    .afb-card-face {
        height: auto !important;
        min-height: 100%;
        padding: 20px !important;
    }
}
