/* vlsocial — front home (Instagram + Avis Google) */

/* === Tile Instagram (4 layouts) === */
.vlsoc-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f0f0;
    text-decoration: none;
    color: inherit;
    /* Reset button defaults pour les tiles VIDEO */
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: inherit;
}
.vlsoc-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease, filter .25s ease;
}
.vlsoc-tile:hover img {
    transform: scale(1.05);
    filter: brightness(.55);
}
.vlsoc-tile__caption {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 14px 16px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,0) 55%);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
}
.vlsoc-tile:hover .vlsoc-tile__caption {
    opacity: 1;
}
.vlsoc-tile__caption span {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Layout : grid — 2/3/4/6 colonnes selon breakpoint (max 6, aligné sur le count par défaut) */
.vlsoc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) { .vlsoc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .vlsoc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .vlsoc-grid { grid-template-columns: repeat(6, 1fr); } }
.vlsoc-grid .vlsoc-tile { aspect-ratio: 1 / 1; }
.vlsoc-grid .vlsoc-tile--reel { aspect-ratio: 9 / 16; }
.vlsoc-grid { align-items: start; }

/* Layout : mosaic — 5 colonnes, aspect-ratio par type */
.vlsoc-mosaic {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    align-items: start;
}
.vlsoc-mosaic .vlsoc-tile { aspect-ratio: 1 / 1; }
.vlsoc-mosaic .vlsoc-tile--reel { aspect-ratio: 9 / 16; }
@media (max-width: 1024px) { .vlsoc-mosaic { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .vlsoc-mosaic { grid-template-columns: repeat(2, 1fr); } }

/* Layout : slider */
.vlsoc-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
}
.vlsoc-slider .vlsoc-tile {
    flex: 0 0 240px;
    aspect-ratio: 1 / 1;
    scroll-snap-align: start;
}
.vlsoc-slider .vlsoc-tile--reel { aspect-ratio: 9 / 16; flex-basis: 200px; }

/* Layout : masonry — positionnement JS, --vlsoc-cols expose le nombre de cols */
.vlsoc-masonry {
    position: relative;
    --vlsoc-cols: 6;
    --vlsoc-gap: 12px;
}
.vlsoc-masonry .vlsoc-tile {
    position: absolute;
    aspect-ratio: 1 / 1;
    transition: transform .25s ease, top .25s ease, left .25s ease;
}
.vlsoc-masonry .vlsoc-tile--reel { aspect-ratio: 9 / 16; }
@media (max-width: 1280px) { .vlsoc-masonry { --vlsoc-cols: 5; } }
@media (max-width: 1024px) { .vlsoc-masonry { --vlsoc-cols: 4; } }
@media (max-width: 768px)  { .vlsoc-masonry { --vlsoc-cols: 3; } }
@media (max-width: 540px)  { .vlsoc-masonry { --vlsoc-cols: 2; } }

/* === Overlay play icon sur les Reels === */
.vlsoc-tile__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background .25s ease, transform .25s ease;
}
.vlsoc-tile__play svg { width: 24px; height: 24px; margin-left: 3px; }
.vlsoc-tile--reel:hover .vlsoc-tile__play {
    background: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.08);
}

/* === Modal Reel === */
.vlsoc-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.vlsoc-modal[hidden] { display: none; }
.vlsoc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}
.vlsoc-modal__dialog {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.vlsoc-modal__close {
    position: absolute;
    top: -44px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}
.vlsoc-modal__close:hover { background: rgba(255, 255, 255, 0.25); }
.vlsoc-modal__close svg { width: 20px; height: 20px; }
.vlsoc-modal__video-wrap {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    max-height: 80vh;
    aspect-ratio: 9 / 16;
}
.vlsoc-modal__video {
    display: block;
    height: 80vh;
    max-width: 95vw;
    width: auto;
}
.vlsoc-modal__permalink {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    transition: background .2s ease;
}
.vlsoc-modal__permalink:hover { background: rgba(255, 255, 255, 0.28); color: #fff; }

/* Body scroll lock quand modal ouverte */
body.vlsoc-modal-open { overflow: hidden; }
