/* Gallery section — premium UI */

.gallery {
    padding: 5rem 0 5.5rem !important;
    background: linear-gradient(180deg, #faf8f5 0%, #fff 50%, #faf8f5 100%) !important;
    position: relative;
    overflow: hidden;
}

.gallery::before {
    content: '';
    position: absolute;
    top: -80px;
    left: -80px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(230, 122, 34, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.gallery .section-heading,
.gallery .small-heading {
    position: relative;
    z-index: 1;
}

.gallery-intro {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    max-width: 640px;
    position: relative;
    z-index: 1;
}

.gallery-intro span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: #fff;
    border: 1px solid rgba(230, 122, 34, 0.2);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #c45f10;
    box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05);
}

.gallery-intro i {
    font-size: 0.95rem;
}

.gallery-container {
    display: grid !important;
    grid-template-columns: repeat(12, 1fr) !important;
    grid-auto-rows: 180px !important;
    gap: 1rem !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    position: relative;
    z-index: 1;
}

.gallery-item {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 16px !important;
    border: 1px solid rgba(26, 26, 46, 0.06) !important;
    box-shadow: 0 4px 20px rgba(26, 26, 46, 0.08) !important;
    aspect-ratio: unset !important;
    grid-column: span 4;
    grid-row: span 1;
    transform: translateY(24px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease, box-shadow 0.35s ease !important;
}

.gallery-container.visible .gallery-item {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

.gallery-item:nth-child(1) { transition-delay: 0.05s; }
.gallery-item:nth-child(2) { transition-delay: 0.1s; }
.gallery-item:nth-child(3) { transition-delay: 0.15s; }
.gallery-item:nth-child(4) { transition-delay: 0.2s; }
.gallery-item:nth-child(5) { transition-delay: 0.25s; }
.gallery-item:nth-child(6) { transition-delay: 0.3s; }
.gallery-item:nth-child(n+7) { transition-delay: 0.35s; }

.gallery-item--featured {
    grid-column: span 8 !important;
    grid-row: span 2 !important;
}

.gallery-item--wide {
    grid-column: span 8;
}

.gallery-item:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px rgba(230, 122, 34, 0.15) !important;
    z-index: 2;
}

.gallery-item-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    text-decoration: none;
    color: inherit;
}

.gallery-logo {
    display: none !important;
}

.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.65s cubic-bezier(0.4, 0, 0.2, 1) !important;
    min-height: 100%;
}

.gallery-item:hover img {
    transform: scale(1.08) !important;
}

.gallery-overlay {
    position: absolute !important;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    padding: 1.1rem 1.15rem 1.15rem !important;
    background: linear-gradient(
        to top,
        rgba(15, 15, 25, 0.92) 0%,
        rgba(15, 15, 25, 0.5) 55%,
        transparent 100%
    ) !important;
    color: #fff !important;
    transform: translateY(0) !important;
    transition: padding 0.3s ease !important;
}

.gallery-item:hover .gallery-overlay {
    padding-bottom: 1.35rem !important;
}

.gallery-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    margin-bottom: 0.4rem;
    background: rgba(230, 122, 34, 0.9);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
}

.gallery-overlay h3 {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.25rem !important;
    color: #fff !important;
    line-height: 1.25;
}

.gallery-item--featured .gallery-overlay h3 {
    font-size: 1.45rem !important;
}

.gallery-overlay p {
    font-size: 0.82rem !important;
    color: rgba(255, 255, 255, 0.85) !important;
    margin: 0 !important;
    line-height: 1.45 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item--featured .gallery-overlay p {
    -webkit-line-clamp: 3;
}

.gallery-zoom {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    color: #e67a22;
    border-radius: 50%;
    font-size: 1.1rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 3;
}

.gallery-item:hover .gallery-zoom {
    opacity: 1;
    transform: scale(1);
}

.gallery-cta {
    text-align: center;
    margin-top: 2.5rem;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.gallery-cta p {
    color: #5c5c7a;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.gallery-cta .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Bento pattern for first rows on desktop */
@media (min-width: 993px) {
    .gallery-item:nth-child(2) { grid-column: span 4; }
    .gallery-item:nth-child(3) { grid-column: span 4; }
    .gallery-item:nth-child(4) { grid-column: span 4; }
    .gallery-item:nth-child(5) { grid-column: span 4; }
    .gallery-item:nth-child(6) { grid-column: span 4; grid-row: span 1; }
    .gallery-item:nth-child(7) { grid-column: span 4; }
    .gallery-item:nth-child(8) { grid-column: span 8; }
}

@media (max-width: 992px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-rows: 200px !important;
    }

    .gallery-item,
    .gallery-item--featured,
    .gallery-item--wide {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .gallery-item--featured {
        grid-column: span 2 !important;
        grid-row: span 1 !important;
    }
}

@media (max-width: 576px) {
    .gallery {
        padding: 3.5rem 0 !important;
    }

    .gallery-container {
        grid-template-columns: 1fr !important;
        grid-auto-rows: 240px !important;
        gap: 0.85rem !important;
    }

    .gallery-item,
    .gallery-item--featured {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .gallery-item:hover {
        transform: none !important;
    }

    .gallery-zoom {
        opacity: 1;
        transform: scale(1);
    }
}
