/*
 *  package: Joomill Client Response Gallery
 *  copyright: Copyright (c) 2025. Jeroen Moolenschot | Joomill
 *  license: GNU General Public License version 3 or later
 *  link: https://www.joomill-extensions.com
 */

/**
 * Gallery photo display styles
 * @since 1.0.0
 */
.com-clientresponsegallery__photos .card-img-top {
    overflow: hidden;
    position: relative;
}

.com-clientresponsegallery__photos .favorite-toggle {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 500px;
    text-decoration: none;
}

.com-clientresponsegallery__photos .favorite-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

.com-clientresponsegallery__photos .fa-solid.fa-heart,
.favorite-toggle .fa-solid.fa-heart {
    color: #a51f18;
}

.com-clientresponsegallery__message {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 2rem 0;
}

.photo-card {
    position: relative;
    overflow: hidden;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay .btn {
    margin: 0 5px;
}

.photo-overlay .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
}

.photo-overlay .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: white;
}

.photo-card-hover-group:hover .transition-image {
    transform: scale(1.05);
}
.transition-image {
    transition: transform 0.5s ease;
}

.photo-overlay {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.photo-overlay i {
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.photo-card-hover-group:hover .photo-overlay {
    opacity: 1;
}
.photo-card-hover-group:hover .photo-overlay i {
    transform: scale(1);
}

/**
 * Gallery access styles
 * @since 1.0.0
 */
.gallery-access-icon {
    font-size: 1.2em;
}

/**
 * Photo selection styles
 * @since 1.0.0
 */
.selected-photo {
    border: 3px solid #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/**
 * Gallery photo hover effects
 * @since 1.0.0
 */
.gallery-photo:hover .photo-overlay {
    opacity: 1;
}

/**
 * Grid layout styles - Horizontal grid layout with 3 columns
 * @since 1.0.0
 */
.row.g-4 {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.75rem;
}

.row.g-4 > * {
    padding: 0 0.75rem;
    margin-bottom: 1.5rem;
    flex: 0 0 auto;
}

/* Force 3 columns on large screens, 2 on medium, 1 on small */
.row.g-4 > .col-lg-4 {
    width: 33.333333%;
}

@media (max-width: 992px) {
    .row.g-4 > .col-lg-4 {
        width: 50%;
    }
}

@media (max-width: 576px) {
    .row.g-4 > .col-lg-4 {
        width: 100%;
    }
}

/**
 * Responsive styles
 * @since 1.0.0
 */
@media (max-width: 768px) {
    .com-clientresponsegallery-gallery {
        padding: 1rem 0.5rem;
    }
}


/**
 * Masonry vertical layout styles (dynamic column count handled via inline styles)
 * @since 1.0.0
 */
.masonry-container {
    column-gap: 1.5rem;
    column-fill: balance;
}

.masonry-item {
    display: inline-block;
    margin-bottom: 1.5rem;
    break-inside: avoid;
    page-break-inside: avoid;
}

/**
 * Masonry horizontal layout styles
 * @since 1.0.0
 */
.masonry-horizontal-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-gap: 1.5rem;
    grid-auto-rows: 10px;
}

.masonry-horizontal-item {
    /* Row span will be set dynamically via JavaScript */
}

.masonry-horizontal-item .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.masonry-horizontal-item .card-img-top {
    height: auto;
    flex-shrink: 0;
}

.masonry-horizontal-item .card-img-top img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.masonry-horizontal-item .card-body {
    flex-grow: 1;
}

/* Responsive adjustments for horizontal masonry */
@media (max-width: 992px) {
    .masonry-horizontal-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .masonry-horizontal-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-gap: 1rem;
    }
}

@media (max-width: 576px) {
    .masonry-horizontal-container {
        grid-template-columns: 1fr;
        grid-gap: 1rem;
    }
}

/**
 * Modal photo centering
 * @since 1.0.0
 */
#photoLightbox .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

#photoLightbox .modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.selected-photos {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 10px;
    right: 0;
    background: #d5d1c8;
    box-shadow: 2px 0 5px rgba(57, 63, 72, 0.1);
    z-index: 9999;
}