/**
 * AMENITIES.CSS
 * Estilos para a seção de galeria de amenities
 * Depende de base.css para tokens
 */

/* ===== AMENITIES ===== */
.amenities {
    padding: clamp(64px, 12vw, 96px) 0;
}

.amenities__head {
    display: flex;
    align-items: center;
    gap: 48px;
    margin-bottom: 64px;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 22px;
}

.amenities__title {
    flex: 1;
    min-width: 0;
    max-width: 400px;

}

.amenities__title h2 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.25;
    color: var(--blue);
    margin: 0;
}

.amenities__desc {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: left;
}

.amenities__desc p {
    font-size: 18px;
    line-height: 1.33;
    color: var(--blue);
    margin: 0 0 32px 0;
}

.amenities__desc .btn {
    margin-top: 0;
}

/* ===== GALLERY CONFORME FIGMA ===== */
.amenities__grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 22px;
}

.amenities__row {
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Tiles grandes e pequenas conforme Figma */
.tile--large {
    width: 624px;
    height: 264px;
    flex-shrink: 0;
}

.tile--small {
    width: 304px;
    height: 264px;
    flex: 1;
}

.tile {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--sand);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    margin: 2px;
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Garantir que lazy loading funcione corretamente */
.tile img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tile img[loading="lazy"].loaded {
    opacity: 1;
}

/* Melhorias para mobile */
@media (max-width: 768px) {
    .tile img[loading="lazy"] {
        /* Transição mais rápida no mobile */
        transition: opacity 0.2s ease;
    }

    /* Fallback: mostrar imagens após 1 segundo no mobile */
    .tile img[loading="lazy"]:not(.loaded) {
        animation: fadeInFallback 0.2s ease 1s forwards;
    }
}

@keyframes fadeInFallback {
    to {
        opacity: 1;
    }
}

/* Overlay com gradiente e conteúdo */
.tile__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(34, 59, 90, 0) 60.8%, #223B5A 100%);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
    min-height: 80px;
}

.tile__icon {
    width: 28px;
    height: 28px;
    background: #223B5A;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}


.tile__title {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 24px;
    color: #F7ECDD;
    margin: 0;
    text-align: center;
    width: 100%;
}

/* Stack para as duas imagens pequenas da última linha */
.amenities__stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

/* Hover effects */
.tile:hover img {
    transform: scale(1.02);
}

.tile:hover .tile__overlay {
    background: linear-gradient(180deg, rgba(34, 59, 90, 0) 50%, #223B5A 100%);
}

/* Responsividade */
@media (max-width: 1440px) {
    .amenities__grid {
        padding: 0 44px;
    }

    .tile--large {
        width: calc(50% - 8px);
        max-width: 624px;
    }

    .tile--small {
        width: calc(25% - 12px);
        max-width: 304px;
    }
}

@media (max-width: 1024px) {
    .amenities__head {
        flex-direction: column;
        gap: 24px;
        text-align: center;
        padding: 0 24px;
    }

    .amenities__desc {
        align-items: center;
        text-align: center;
    }

    .amenities__desc p {
        max-width: none;
    }

    .amenities__grid {
        padding: 0 24px;
    }

    .amenities__row {
        flex-direction: column;
        gap: 16px;
    }

    .tile--large,
    .tile--small {
        width: 100%;
        max-width: none;
        height: 200px;
    }

    .amenities__stack {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .amenities__head {
        padding: 0 16px;
    }

    .amenities__grid {
        padding: 0 16px;
    }

    .tile--large,
    .tile--small {
        height: 180px;
    }

    .tile__title {
        font-size: 16px;
    }
    
    .tittle--small{
        flex-shrink: 0 !important;
    }
}
