/* Galeria Max — coverflow 3D.
   O posicionamento 3D de cada card é feito via JS (transform inline).
   Aqui: palco em perspectiva, aparência dos cards, setas, dots e modal. */

.wgm-wrap {
    position: relative;
    width: 100%;
    padding: 40px 0 24px;
    background: #111111;
    overflow: hidden;
    --wgm-card: var(--wgm-card-d, 300px);
}

.wgm-viewport {
    position: relative;
    width: 100%;
    /* perspectiva = 3x a largura do card (lente do coverflow) */
    perspective: calc(var(--wgm-card, 300px) * 3);
    outline: none;
    cursor: grab;
    touch-action: pan-y;
    padding: 20px 0;
}
.wgm-viewport:active { cursor: grabbing; }

.wgm-stage {
    position: relative;
    height: var(--wgm-card, 300px);
    transform-style: preserve-3d;
    user-select: none;
}

.wgm-card {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--wgm-card, 300px);
    height: var(--wgm-card, 300px);
    will-change: transform, opacity;
    /* o transform vem do JS; a transição suaviza o arrasto/settle */
    transition: none;
}

.wgm-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 20px 45px rgba(0,0,0,.45);
}
.wgm-card-inner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 55%);
    pointer-events: none;
}

.wgm-card img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center;
    display: block;
}

/* Legenda (título + descrição) */
.wgm-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 18px;
}
.wgm-titulo { margin: 0 0 6px; font-size: 20px; font-weight: 700; line-height: 1.2; color: #fff; }
.wgm-desc   { margin: 0; font-size: 14px; line-height: 1.4; color: rgba(255,255,255,.8); }
.wgm-titulo, .wgm-desc { font-family: inherit; }

.wgm-link { position: absolute; inset: 0; z-index: 3; }

/* Card central: leve destaque */
.wgm-card.wgm-center .wgm-card-inner { box-shadow: 0 26px 60px rgba(0,0,0,.6); }

/* ── Setas redondas (padrão dos demais blocos) ── */
.wgm-seta {
    position: absolute;
    bottom: 8px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background .25s ease, transform .2s ease;
}
.wgm-seta svg { display: block; }
.wgm-seta:hover { background: #0066ff; transform: translateY(-2px); }
.wgm-seta.wgm-prev { left: calc(50% - 60px); }
.wgm-seta.wgm-next { left: calc(50% + 8px); }

/* Dots */
.wgm-dots { display: flex; justify-content: center; gap: 8px; margin-top: 28px; }
.wgm-dot {
    width: 8px; height: 8px;
    border: none; border-radius: 999px;
    background: #fff; opacity: .35;
    cursor: pointer;
    transition: opacity .25s ease, transform .2s ease;
    padding: 0;
}
.wgm-dot.ativo { opacity: 1; transform: scale(1.3); }

/* Quando há setas, dá espaço embaixo pra elas */
.wgm-wrap:has(.wgm-seta) .wgm-dots { margin-top: 64px; }

/* ── Modal (lightbox) ── */
.wgm-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.wgm-modal.aberto { display: flex; }
.wgm-modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,.85); }
.wgm-modal-box { position: relative; z-index: 1; max-width: 92vw; max-height: 90vh; }
.wgm-modal-box img {
    display: block;
    max-width: 92vw;
    max-height: 90vh;
    width: auto; height: auto;
    border-radius: 12px;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.wgm-modal-x {
    position: absolute;
    top: -18px; right: -18px;
    width: 40px; height: 40px;
    border: none; border-radius: 999px;
    background: #fff; color: #111;
    font-size: 24px; line-height: 1;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

@media (max-width: 1024px) {
    .wgm-wrap { --wgm-card: var(--wgm-card-t, 240px); }
}
@media (max-width: 767px) {
    .wgm-wrap { --wgm-card: var(--wgm-card-m, 200px); }
    .wgm-titulo { font-size: 17px; }
    .wgm-desc { font-size: 13px; }
    .wgm-seta { width: 46px; height: 46px; }
}

/* ── Botão de tela cheia ── */
.wgm-fs {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 999px;
    background: rgba(31,41,55,.85);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .25s ease, transform .2s ease;
}
.wgm-fs svg { display: block; }
.wgm-fs:hover { background: #0066ff; transform: scale(1.06); }

/* ── Modo tela cheia ativo ── */
.wgm-wrap.wgm-tela-cheia {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
}
.wgm-wrap.wgm-tela-cheia .wgm-viewport { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; }
body.wgm-fs-lock { overflow: hidden !important; }
