/* Before/After Gallery Widget Styles - Matching Reference Design */

:root {
    --gallery-primary-color: #333;
    --gallery-secondary-color: #666;
    --gallery-light-color: #f9f9f9;
    --gallery-border-color: #e8e8e8;
    --gallery-button-color: #4a6fa5;
    --gallery-button-hover-color: #3d5a87;
}

.before-after-gallery-wrapper {
    width: 100%;
    padding: 20px;
    background: #fff;
}

.before-after-gallery-container {
    display: flex;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar Styles */
.gallery-sidebar {
    flex: 0 0 280px;
    min-width: 280px;
}

.gallery-filters {
    background: #fff;
    padding: 0;
}

.filter-category {
    margin-bottom: 0;
    border-bottom: 1px solid var(--gallery-border-color);
}

.filter-category:last-child {
    border-bottom: none;
}

.filter-category-title {
    cursor: pointer;
    user-select: none;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gallery-primary-color);
}

.filter-category-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--gallery-primary-color);
}

.filter-category-title h3 span {
    font-size: 13px;
    color: var(--gallery-secondary-color);
    font-weight: 400;
    margin-left: 5px;
}

.filter-category-link {
    display: block;
    padding: 15px 0;
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.filter-category-link:hover,
.filter-category-link.active {
    color: var(--gallery-button-color);
}

.filter-category-link.active h3 {
    color: var(--gallery-button-color);
}

.filter-link {
    color: var(--gallery-secondary-color);
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 8px 0;
    padding-left: 15px;
    transition: color 0.3s ease;
    position: relative;
}

.filter-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    background: var(--gallery-secondary-color);
    border-radius: 50%;
}

.filter-link:hover,
.filter-link.active {
    color: var(--gallery-button-color);
    font-weight: 500;
}

.filter-link.active::before {
    background: var(--gallery-button-color);
}

.filter-all {
    font-weight: 600;
    color: var(--gallery-button-color);
}

/* Gallery Content */
.gallery-content {
    flex: 1;
    min-width: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
}

/* Gallery Card */
.gallery-card {
    background: #fff;
    border: 1px solid var(--gallery-border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.gallery-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Card Images */
.gallery-card-images {
    background: var(--gallery-light-color);
    overflow: hidden;
    position: relative;
    width: 100%;
    height: auto;
    padding: 0;
    margin: 0;
}

.gallery-card-image-wrapper {
    width: 100%;
    height: auto;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.gallery-single-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 0;
}

/* Card Content */
.gallery-card-content {
    padding: 0 20px 20px 20px;
    background: #fff;
}

.gallery-card-title {
    margin: 0 0 20px 0;
    padding: 20px 0 0 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gallery-primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Details - HTML Editor Content */
.gallery-card-details {
    margin-top: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gallery-border-color);
    font-size: 13px;
    color: var(--gallery-primary-color);
    line-height: 1.7;
    word-break: break-word;
}

.gallery-card-details p {
    margin: 0 0 8px 0;
    word-break: break-word;
}

.gallery-card-details br {
    display: block;
    content: "";
    margin: 0;
}

/* Button */
.gallery-card-cta {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.gallery-button {
    display: inline-block;
    background-color: var(--gallery-button-color);
    color: white;
    padding: 11px 40px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 180px;
    text-align: center;
}

.gallery-button:hover {
    background-color: var(--gallery-button-hover-color);
    box-shadow: 0 2px 8px rgba(74, 111, 165, 0.3);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .before-after-gallery-container {
        gap: 30px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .before-after-gallery-container {
        flex-direction: column;
        gap: 30px;
    }

    .gallery-sidebar {
        flex: 1;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .before-after-gallery-wrapper {
        padding: 15px;
    }

    .before-after-gallery-container {
        gap: 20px;
    }

    .gallery-sidebar {
        flex: 1;
        flex: 0 0 auto;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .gallery-card-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .before-after-gallery-wrapper {
        padding: 10px;
    }

    .before-after-gallery-container {
        flex-direction: column;
        gap: 15px;
    }

    .gallery-sidebar {
        flex: none;
    }

    .gallery-content {
        flex: none;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-card {
        border-radius: 3px;
    }

    .gallery-card-images {
        min-height: 200px;
    }

    .gallery-card-content {
        padding: 15px;
    }

    .gallery-card-title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .gallery-button {
        padding: 10px 25px;
        font-size: 12px;
    }
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-card.fade-in {
    animation: fadeIn 0.3s ease forwards;
}
