/* =========================================================================
   PTG Gallery — galeria fullscreen imersiva (autoria Pra Toda Gente)
   Código original. Vanilla CSS, sem dependências.
   ========================================================================= */

.ptg-gallery {
    --ptg-bg: #0d0d0f;
    --ptg-fg: #f4f4f5;
    --ptg-accent: #cc0066;
    --ptg-muted: rgba(244, 244, 245, .6);
    --ptg-ui-bg: rgba(0, 0, 0, .4);
    --ptg-ui-hover: rgba(0, 0, 0, .65);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 70vh;
    min-height: 420px;
    background: var(--ptg-bg);
    color: var(--ptg-fg);
    overflow: hidden;
    border-radius: 8px;
    font-family: inherit;
    user-select: none;
}
.ptg-gallery.is-fullscreen {
    height: 100vh;
    border-radius: 0;
}

/* Palco */
.ptg-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.ptg-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .6s ease;
    pointer-events: none;
}
.ptg-slide.is-active {
    opacity: 1;
    pointer-events: auto;
}
.ptg-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    cursor: zoom-in;
}
.ptg-gallery.is-fullscreen .ptg-slide img { cursor: zoom-out; }

/* Vídeo (iframe) */
.ptg-video {
    width: min(100%, 1100px);
    aspect-ratio: 16 / 9;
    height: auto;
    max-height: 100%;
    border: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
/* Link de vídeo não embutível: cartão "assistir" */
.ptg-linkcard { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ptg-linkcard .ptg-play {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ptg-accent); color: #fff; font-size: 22px; padding-left: 4px;
}
.ptg-linkcard a {
    color: var(--ptg-fg); text-decoration: none; font-size: 15px;
    border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 8px 16px;
}
.ptg-linkcard a:hover { border-color: var(--ptg-accent); color: var(--ptg-accent); }
/* Miniatura de vídeo sem thumbnail */
.ptg-thumb-video { background: #1c1c22; display: grid; place-items: center; }
.ptg-thumb-video span { color: rgba(255,255,255,.8); font-size: 14px; }
/* variação "cover" (preenche a tela) — classe opcional no container */
.ptg-gallery.is-cover .ptg-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: none;
}

/* Legenda + contador */
.ptg-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 24px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, .7), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .3s ease, transform .3s ease;
}
.ptg-gallery.show-ui .ptg-caption { opacity: 1; transform: none; }
.ptg-caption .ptg-title { font-size: 1.15rem; font-weight: 600; line-height: 1.3; }
.ptg-caption .ptg-counter { font-size: .85rem; color: var(--ptg-muted); white-space: nowrap; }

/* Setas prev/next */
.ptg-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: var(--ptg-ui-bg);
    color: var(--ptg-fg);
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease, background .2s ease;
    z-index: 3;
}
.ptg-gallery.show-ui .ptg-nav { opacity: 1; }
.ptg-nav:hover { background: var(--ptg-accent); }
.ptg-nav.ptg-prev { left: 16px; }
.ptg-nav.ptg-next { right: 16px; }

/* Controles (play/pause, fullscreen) */
.ptg-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    gap: 8px;
    z-index: 6;               /* acima do painel de detalhes */
    opacity: 0;
    transition: opacity .3s ease;
}
.ptg-gallery.show-ui .ptg-controls { opacity: 1; }
.ptg-ctrl {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--ptg-ui-bg);
    color: var(--ptg-fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}
.ptg-ctrl:hover { background: var(--ptg-ui-hover); }
.ptg-ctrl svg { width: 18px; height: 18px; fill: currentColor; }

/* Barra de progresso do autoplay */
.ptg-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 3px;
    width: 0;
    background: var(--ptg-accent);
    z-index: 4;
    transition: width .1s linear;
}

/* Tira de miniaturas */
.ptg-thumbs {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, .35);
    overflow-x: auto;
    scrollbar-width: thin;
}
.ptg-thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: .5;
    border: 2px solid transparent;
    transition: opacity .2s ease, border-color .2s ease;
    background-size: cover;
    background-position: center;
}
.ptg-thumb:hover { opacity: .85; }
.ptg-thumb.is-active { opacity: 1; border-color: var(--ptg-accent); }

/* Acessibilidade / foco */
.ptg-gallery :focus-visible { outline: 2px solid var(--ptg-accent); outline-offset: 2px; }

@media (max-width: 600px) {
    .ptg-gallery { height: 60vh; min-height: 320px; }
    .ptg-nav { width: 40px; height: 40px; }
    .ptg-thumb { width: 56px; height: 38px; }
    .ptg-caption { padding: 30px 16px 14px; }
    .ptg-caption .ptg-title { font-size: 1rem; }
}

/* ============ Modo rico (artes): barra topo, tipo e painel de autoria ============ */
.ptg-topbar {
    position: absolute; top: 16px; left: 18px; z-index: 4;
    display: none; align-items: center; gap: 10px;
    opacity: 0; transition: opacity .3s ease;
}
.ptg-gallery.is-rich .ptg-topbar { display: flex; }
.ptg-gallery.is-rich.show-ui .ptg-topbar { opacity: 1; }
.ptg-topbar .ptg-counter { font-size: 13px; color: var(--ptg-muted); letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.ptg-kind {
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ptg-fg);
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
    padding: 4px 10px; border-radius: 999px;
}

/* no modo rico, a legenda inferior some (o painel assume) */
.ptg-gallery.is-rich .ptg-caption { display: none; }

/* botão de info ativo */
.ptg-ctrl.is-on, .ptg-ctrl.is-on:hover { background: var(--ptg-accent); }

/* painel lateral */
.ptg-info {
    position: absolute; top: 0; right: 0; height: 100%; width: min(380px, 84%);
    background: rgba(14,14,20,.74);
    backdrop-filter: blur(14px) saturate(1.1);
    -webkit-backdrop-filter: blur(14px) saturate(1.1);
    border-left: 1px solid rgba(255,255,255,.10);
    transform: translateX(100%); transition: transform .38s cubic-bezier(.4,.02,.2,1);
    z-index: 3; display: flex; flex-direction: column;
    padding: 62px 24px 20px; gap: 16px; overflow-y: auto;
}
.ptg-gallery.is-rich.show-info .ptg-info { transform: none; }
.ptg-gallery.is-rich.show-info .ptg-thumbs { right: min(380px, 84%); }
/* a seta direita recua para não ficar sob o painel */
.ptg-gallery.is-rich.show-info .ptg-nav.ptg-next { right: calc(min(380px, 84%) + 16px); }

.ptg-obra-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ptg-accent); }
.ptg-obra-title { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 24px; line-height: 1.15; margin: 4px 0 0; color: var(--ptg-fg); }
.ptg-divider { height: 1px; background: rgba(255,255,255,.10); border: 0; margin: 2px 0; }
.ptg-credit-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ptg-muted); }
.ptg-collective {
    display: inline-flex; align-items: center; gap: 6px; width: fit-content;
    font-size: 12px; color: var(--ptg-fg);
    background: rgba(204,0,102,.16); border: 1px solid rgba(204,0,102,.4);
    padding: 4px 10px; border-radius: 999px;
}
.ptg-artist { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: start; }
.ptg-avatar { width: 44px; height: 44px; border-radius: 50%; background-size: cover; background-position: center; display: grid; place-items: center; }
.ptg-avatar-ini { color: #fff; font-weight: 600; font-size: 15px; background: linear-gradient(135deg, var(--ptg-accent), #7a3cff); }
.ptg-artist-names .ptg-stage { font-family: Georgia, "Times New Roman", serif; font-size: 18px; line-height: 1.1; color: var(--ptg-fg); }
.ptg-artist-names .ptg-realname { font-size: 12px; color: var(--ptg-muted); margin-top: 1px; }
.ptg-bio { grid-column: 1 / -1; font-size: 13.5px; line-height: 1.55; color: #d9d6de; margin: 6px 0 0; }
.ptg-socials { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ptg-socials a {
    display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ptg-fg);
    border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 5px 9px; text-decoration: none;
    transition: border-color .2s, color .2s;
}
.ptg-socials a:hover { border-color: var(--ptg-accent); color: var(--ptg-accent); }
.ptg-socials svg { width: 14px; height: 14px; fill: currentColor; }

@media (max-width: 600px) {
    .ptg-info {
        top: auto; bottom: 0; height: auto; max-height: 62%; width: 100%;
        border-left: none; border-top: 1px solid rgba(255,255,255,.10);
        transform: translateY(100%); border-radius: 16px 16px 0 0; padding: 20px;
    }
    .ptg-gallery.is-rich.show-info .ptg-info { transform: none; }
    .ptg-gallery.is-rich.show-info .ptg-thumbs { right: 0; bottom: 62%; }
}
