.tpw-wrapper {
    width: 100%;
    margin: 0 auto;
}

.tpw-layout-container {
    display: flex;
    align-items: flex-start;
}

.tpw-tabs-sidebar {
    display: flex;
    flex-direction: column;
}

.tpw-tab-button {
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    font-family: inherit;
}

.tpw-tabs-content-area {
    flex: 1;
    min-width: 0;
}

.tpw-tab-content {
    display: none;
    animation: tpwFadeIn 0.4s ease forwards;
}

.tpw-tab-content.active {
    display: block;
}

/* =========================================
   IMAGE LAYOUTS
========================================= */
.tpw-images-grid {
    margin-bottom: 25px;
}

/* 1. Row Layout (Forced Same Line) */
.tpw-images-grid.layout-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
}
.tpw-images-grid.layout-row .tpw-image-item {
    flex: 1 1 0; 
    min-width: 0; 
}

/* 2. Grid Layout (Multi-line configurable columns) */
.tpw-images-grid.layout-grid {
    display: grid;
}

/* =========================================
   DOPAMINERGIC HOVER EFFECT & HEIGHT FIX
========================================= */
.tpw-image-item {
    position: relative;
    overflow: hidden;
    /* Fallback height just in case Elementor CSS delays */
    height: 450px; 
    /* Smooth transition for the wrapper moving up and casting shadow */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.tpw-image-item img {
    width: 100%;
    height: 100%; /* <-- THIS RESTORES THE UNIFORM HEIGHT */
    display: block;
    /* Smooth transition for the image scaling and brightening */
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), 
                filter 0.4s ease;
}

.tpw-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    z-index: 2; 
}

.tpw-image-item:hover img {
    transform: scale(1.04);
    filter: brightness(1.03) contrast(1.02);
}

/* =========================================
   ANIMATIONS & RESPONSIVE
========================================= */
@keyframes tpwFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .tpw-layout-container {
        flex-direction: column;
    }
    .tpw-tabs-sidebar {
        flex: 1 1 100% !important;
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .tpw-tab-button {
        flex: 1 1 auto;
        text-align: center;
    }
    .tpw-images-grid.layout-row {
        flex-direction: column; 
    }
    .tpw-images-grid.layout-grid {
        grid-template-columns: 1fr !important;
    }
}