@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

/* Smart Collage Gallery Container */
.hero-gallery-smart-collage {
    font-family: 'Outfit', sans-serif;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    /* Strictly imposed boundaries from JS */
    height: var(--hg-max-height, 720px);
    overflow: hidden !important; /* NO SCROLL AT ALL */
    background: #f8f9fa; /* Modern art gallery light gray */
}

/* Rows populated by JS */
.hero-gallery-collage-row {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--hg-gap, 20px);
    width: 100%;
}

/* Collage Item */
.hero-gallery-collage-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    
    /* Smooth Entry Animation */
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    animation: hgItemFadeIn 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero-gallery-collage-item:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    z-index: 10;
}

.hero-gallery-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    line-height: 0;
}

/* Image preserving aspect ratio perfectly */
.hero-gallery-collage-item img {
    width: 100%;
    height: 100%;
    /* Object-fit Cover absorbs ONLY the micro-pixel adjustment of the algorithm */
    object-fit: cover; 
    display: block; 
    transition: filter 0.3s ease;
}

/* Overlay */
.hero-gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    box-sizing: border-box;
}

.hero-gallery-collage-item:hover .hero-gallery-item-overlay {
    opacity: 1;
    visibility: visible;
}

.hero-gallery-overlay-content {
    color: #fff;
    width: 100%;
    transform: translateY(15px);
    transition: transform 0.3s ease;
}

.hero-gallery-collage-item:hover .hero-gallery-overlay-content {
    transform: translateY(0);
}

.hg-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.hg-price {
    font-size: 1rem;
    margin-top: 5px;
    opacity: 0.95;
}

.hg-price ins {
    text-decoration: none;
}

.hg-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.hero-gallery-collage-item:hover .hg-icon {
    opacity: 1;
    transform: scale(1);
    background: rgba(255, 255, 255, 0.3);
}

.hg-icon span {
    color: #fff;
    font-size: 20px;
}

/* Lightbox link wrap */
.hero-gallery-collage-item a {
    text-decoration: none;
    display: block;
    height: 100%;
    width: 100%;
}

@keyframes hgItemFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
