/* ============================================================
   Impercont Social Viewer — CSS (trasladado del frontend del tema)
   Sección: "Impercont en Instagram" — 5 últimos posts
   ============================================================ */

.imsv-section {
    position: relative;
    overflow: hidden;
    padding: 96px 0;
    background: #0a0a0a;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.imsv-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 24rem;
    height: 24rem;
    border-radius: 50%;
    filter: blur(80px);
    background: rgba(255, 103, 2, .04);
    pointer-events: none;
}

.imsv-wrap {
    position: relative;
    z-index: 1;
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ----- Cabecera ----- */

.imsv-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 3.5rem;
}

.imsv-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
    padding: .5rem 1rem;
    border: 1px solid rgba(255, 103, 2, .3);
    border-radius: 9999px;
    background: rgba(255, 103, 2, .1);
    color: #ff6702;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.imsv-title {
    margin: 0 0 .75rem;
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.1;
    color: #fff;
}

.imsv-title span {
    color: #ff6702;
}

.imsv-sub {
    max-width: 36rem;
    margin: 0;
    color: #9ca3af;
    font-weight: 300;
    line-height: 1.7;
}

.imsv-follow {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-radius: .75rem;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease;
}

.imsv-follow:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(220, 39, 67, .35);
}

/* ----- Grid ----- */

.imsv-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .imsv-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ----- Tarjetas ----- */

.imsv-tile {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid #2a2a2a;
    border-radius: 1rem;
    background: #111;
    text-decoration: none;
}

.imsv-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.imsv-tile:hover img {
    transform: scale(1.1);
}

.imsv-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.imsv-tile:hover video {
    transform: scale(1.1);
}

.imsv-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.imsv-play svg {
    box-sizing: content-box;
    padding: 1.1rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    backdrop-filter: blur(2px);
}

.imsv-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .85) 100%);
    opacity: 1;
    transition: opacity .3s ease;
}

.imsv-tile:hover .imsv-overlay {
    opacity: 1;
}

.imsv-overlay-inner {
    display: block;
    width: 100%;
}

.imsv-caption {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 .5rem;
    color: #fff;
    font-size: .75rem;
    line-height: 1.4;
}

.imsv-goto {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #ff8a33;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ----- Sin imagen destacada ----- */

.imsv-tile--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 103, 2, .4);
}

/* ----- Placeholder / fallback ----- */

.imsv-tile--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #1a1a1a, #0a0a0a);
    color: rgba(255, 103, 2, .35);
    transition: transform .3s ease;
}

.imsv-tile--ph:hover {
    transform: scale(1.03);
    color: rgba(255, 103, 2, .6);
}

.imsv-ph-tag {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    color: #6b7280;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.imsv-note {
    margin-top: 2rem;
    text-align: center;
    color: #6b7280;
    font-size: .85rem;
}

.imsv-note a {
    color: #ff6702;
    text-decoration: none;
}

.imsv-note a:hover {
    text-decoration: underline;
}

/* ----- Responsive ----- */

@media (max-width: 640px) {
    .imsv-section {
        padding: 64px 0;
    }

    .imsv-head {
        margin-bottom: 2.25rem;
    }

    .imsv-follow {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   Lightbox — visor de archivos (imágenes y vídeos MP4)
   ============================================================ */

.imsv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .93);
}

.imsv-lightbox--open {
    display: flex;
    animation: imsv-fade .25s ease;
}

@keyframes imsv-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ----- Botón de cierre (X) ----- */

.imsv-lightbox__close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.imsv-lightbox__close:hover,
.imsv-lightbox__close:focus-visible {
    background: #ff6702;
    border-color: #ff6702;
    transform: scale(1.08);
    outline: none;
}

/* ----- Navegación ----- */

.imsv-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.imsv-lightbox__nav--prev { left: 16px; }
.imsv-lightbox__nav--next { right: 16px; }

.imsv-lightbox__nav:hover,
.imsv-lightbox__nav:focus-visible {
    background: #ff6702;
    border-color: #ff6702;
    outline: none;
}

/* ----- Contenido ----- */

.imsv-lightbox__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: min(1100px, 94vw);
    max-height: 88vh;
}

.imsv-lightbox__media {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 78vh;
}

.imsv-lightbox__media img,
.imsv-lightbox__media video {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
}

.imsv-lightbox__caption {
    margin: 0;
    color: #e5e5e5;
    font-size: .875rem;
    text-align: center;
}

/* ----- Móvil: navegación abajo, sin solapar contenido ----- */

@media (max-width: 640px) {
    .imsv-lightbox {
        padding: 16px;
    }

    .imsv-lightbox__nav {
        top: auto;
        bottom: 16px;
        transform: none;
        width: 46px;
        height: 46px;
    }

    .imsv-lightbox__nav--prev { left: 18px; }
    .imsv-lightbox__nav--next { right: 18px; }

    .imsv-lightbox__media,
    .imsv-lightbox__media img,
    .imsv-lightbox__media video {
        max-height: 70vh;
    }
}
