/* ============================================================
   web_galeria.css — Galería pública de RanchitoCountry
   Mobile-first. Solo estilos que Tailwind no cubre.
   ============================================================ */

/* ─── Filtros de categoría ─────────────────────────────────── */
.filter-tab {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    border: 1.5px solid var(--color-detail, #c8a96e);
    color: var(--color-text-muted, #6b6b5e);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.filter-tab:hover {
    background-color: var(--color-primary, #8b3a3a);
    border-color: var(--color-primary, #8b3a3a);
    color: #fff;
}

.filter-tab--active {
    background-color: var(--color-primary, #8b3a3a);
    border-color: var(--color-primary, #8b3a3a);
    color: #fff;
}

/* ─── Grid de imágenes ─────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 640px) {
    .gallery-grid {
        gap: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* ─── Card de imagen ───────────────────────────────────────── */
.gallery-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 0.75rem;
    border: none;
    padding: 0;
    cursor: pointer;
    background: #f0ece4;
    /* touch target mínimo 44px garantizado por aspect-ratio */
}

.gallery-card:focus-visible {
    outline: 3px solid var(--color-primary, #8b3a3a);
    outline-offset: 2px;
}

.gallery-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-card__img,
.gallery-card:focus-visible .gallery-card__img {
    transform: scale(1.05);
}

/* ─── Badge "Destacada" ────────────────────────────────────── */
.gallery-card__badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--color-primary, #8b3a3a);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    z-index: 2;
}

/* ─── Overlay de texto (hover) ─────────────────────────────── */
.gallery-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-card:hover .gallery-card__overlay,
.gallery-card:focus-visible .gallery-card__overlay {
    opacity: 1;
}

.gallery-card__overlay-title {
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.gallery-card__overlay-caption {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.8125rem;
    margin: 0.25rem 0 0;
    line-height: 1.4;
}

/* ─── Lightbox ─────────────────────────────────────────────── */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.lightbox__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(90vw, 900px);
    max-height: 90vh;
    padding: 0.5rem;
}

.lightbox__close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: opacity 0.2s;
}

.lightbox__close:hover {
    opacity: 0.75;
}

.lightbox__img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0.5rem;
    display: block;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__info {
    text-align: center;
    margin-top: 0.75rem;
    padding: 0 0.5rem;
}

.lightbox__title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.lightbox__caption {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

/* ─── FAB — Floating Action Button ────────────────────────── */
.fab-group {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 100;
}

.fab {
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
}

.fab--primary {
    background: var(--color-primary, #8b3a3a);
    color: #fff;
}

.fab--whatsapp {
    background: #25d366;
    color: #fff;
}
