/* ===== GRID TIPO INSTAGRAM (2 por fila) ===== */

.galeria-ig {
    padding: 20px 16px;
}

.galeria-ig-titulo {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.galeria-ig-subtitulo {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: #555;
}

/* Siempre 2 columnas, móvil y escritorio */
.galeria-ig-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
}

/* ESCRITORIO → 4 columnas */
@media (min-width: 992px) {
    .galeria-ig-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px; /* un poco más de aire en PC */
    }
}

.galeria-ig-item {
    position: relative;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.galeria-ig-media {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 */
    overflow: hidden;
}

.galeria-ig-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galeria-ig-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: opacity .2s ease;
}

.galeria-ig-meta {
    display: flex;
    gap: 12px;
}

.galeria-ig-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.galeria-ig-item:hover .galeria-ig-overlay {
    opacity: 1;
}


/* ================== MODAL ================== */

.galeria-ig-modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: system-ui;
}

.galeria-ig-modal.is-open {
    display: flex;
}

.galeria-ig-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.85);
}

.galeria-ig-modal-dialog {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 900px;
}

.galeria-ig-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: 0;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

/* CONTENIDO PRINCIPAL */

.galeria-ig-modal-content {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@media (min-width: 768px) {
    .galeria-ig-modal-content {
        flex-direction: row;
    }
}

/* FOTO IZQUIERDA */

.galeria-ig-modal-media {
    flex: 1.1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galeria-ig-modal-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* DERECHA (COMPACTADO) */

.galeria-ig-modal-side {
    flex: .9;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 12px;           /* ↓ antes 16 */
    font-size: 0.88rem;      /* ↓ un pelín */
}

/* HEADER */

.galeria-ig-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;     /* ↓ */
    margin-bottom: 6px;      /* ↓ */
    border-bottom: 1px solid #e5e7eb;
}

.galeria-ig-modal-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.galeria-ig-modal-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg,#f97316,#ec4899);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
}

.galeria-ig-modal-userinfo {
    display: flex;
    flex-direction: column;
}

.galeria-ig-modal-location {
    font-size: 0.75rem;
    color: #6b7280;
}

.galeria-ig-modal-more {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.3rem;
    color: #444;
}

/* BODY (COMPACTADO) */

.galeria-ig-modal-body {
    flex: 1;
    padding: 2px 0 6px;      /* ↓ antes 4px 0 8px */
    overflow-y: auto;
}

.galeria-ig-modal-caption {
    display: flex;
    gap: 6px;
    line-height: 1.35;       /* ↓ antes 1.4 */
}

.galeria-ig-modal-caption-user {
    font-weight: 600;
}

/* FOOTER */

.galeria-ig-modal-footer {
    padding-top: 6px;        /* ↓ antes 8 */
    border-top: 1px solid #e5e7eb;
}

.galeria-ig-modal-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.galeria-ig-modal-actions-left,
.galeria-ig-modal-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.galeria-ig-icon-btn {
    background: none;
    border: 0;
    cursor: pointer;
    padding: 4px;
    font-size: 1.3rem;
}

.galeria-ig-modal-likes {
    font-weight: 600;
    margin-bottom: 2px;
}

.galeria-ig-modal-time {
    font-size: .65rem;       /* ↓ antes .7 */
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin-top: 6px;         /* ↓ control del aire */
}


/* =========================================================
   ✅ BLOQUE PROFESIONAL INYECTADO EN EL MODAL (CTA + copy)
   ========================================================= */

.galeria-detalle {
    display: block;
}

/* Título dentro del modal (COMPACTADO) */
.galeria-detalle-titulo {
    font-size: 1rem;         /* ↓ antes 1.05 */
    font-weight: 700;
    margin: 0 0 6px;         /* ↓ antes 10 */
    color: #111;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

/* Texto principal (COMPACTADO) */
.galeria-detalle-texto {
    margin: 0 0 8px;         /* ↓ antes 12 */
    line-height: 1.45;       /* ↓ antes 1.55 */
    color: #222;
}

/* Línea de referencia (COMPACTADO) */
.galeria-detalle-ref {
    font-size: 0.78rem;      /* ↓ antes 0.82 */
    color: #6b7280;
    margin: 4px 0 10px;      /* ↓ antes 8 0 14 */
}

/* Contenedor de CTAs (COMPACTADO) */
.galeria-detalle-cta {
    display: flex;
    flex-direction: column;
    gap: 6px;                /* ↓ antes 10 */
    margin: 0 0 8px;         /* ↓ antes 12 */
}

/* Botón base (COMPACTADO) */
.galeria-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 12px;      /* ↓ antes 12px 14px */
    border-radius: 8px;      /* ↓ antes 10 */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;      /* ↓ */
    line-height: 1.05;
    border: 1px solid transparent;
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.galeria-btn:active {
    transform: translateY(1px);
    opacity: .95;
}

/* CTA principal (llamada) */
.galeria-btn-primary {
    background: #111;
    color: #fff;
}

/* CTA WhatsApp */
.galeria-btn-whatsapp {
    background: #25d366;
    color: #fff;
}

/* CTA secundaria */
.galeria-btn-secondary {
    background: #f3f4f6;
    color: #111;
    border-color: #e5e7eb;
}

/* Nota final (COMPACTADO) */
.galeria-detalle-nota {
    margin: 0;
    font-size: 0.72rem;      /* ↓ antes 0.78 */
    color: #6b7280;
    line-height: 1.35;       /* ↓ antes 1.45 */
}


/* Mejoras sutiles en PC (sin añadir aire) */
@media (min-width: 992px) {

    /* No subimos padding aquí para no volver a meter aire */
    .galeria-ig-modal-side {
        padding: 12px;
    }

    .galeria-btn:hover {
        box-shadow: 0 10px 25px rgba(0,0,0,0.08);
        transform: translateY(-1px);
    }
}
