/* RTV Veículos — galeria de fotos (site e painel). Usa os tokens --gold e --text de cada página. */
.rg { --rg-gold: var(--gold, #d7b568); --rg-radius: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; user-select: none; }
.rg-stage { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: var(--rg-radius); background: #070707; cursor: zoom-in; touch-action: pan-y; isolation: isolate; }
.rg-stage:focus-visible { outline: 2px solid var(--rg-gold); outline-offset: 3px; }
.rg-track { display: flex; height: 100%; transition: transform .45s cubic-bezier(.22, .8, .24, 1); will-change: transform; }
.rg-track.no-anim { transition: none; }
.rg-slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; }
.rg-bg { position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px); object-fit: cover; filter: blur(28px) brightness(.45) saturate(1.2); transform: scale(1.05); }
.rg-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }

.rg-nav { position: absolute; top: 50%; z-index: 2; width: 46px; height: 46px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(10,10,10,.6); color: #fff; backdrop-filter: blur(6px); transform: translateY(-50%); opacity: 0; transition: opacity .25s, background .2s, transform .2s; cursor: pointer; }
.rg-prev { left: 12px; }
.rg-next { right: 12px; }
.rg-stage:hover .rg-nav, .rg-stage:focus-within .rg-nav, .rg-full .rg-nav { opacity: 1; }
.rg-nav:hover { background: var(--rg-gold); color: #15120b; border-color: var(--rg-gold); }
.rg-nav:active { transform: translateY(-50%) scale(.92); }
.rg-counter { position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 4px 11px; border-radius: 999px; background: rgba(8,8,8,.72); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; backdrop-filter: blur(6px); pointer-events: none; }
.rg-expand { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(8,8,8,.72); color: #fff; backdrop-filter: blur(6px); cursor: pointer; transition: background .2s, color .2s; }
.rg-expand:hover { background: var(--rg-gold); color: #15120b; }

.rg-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #3a352a transparent; }
.rg-thumb { flex: 0 0 auto; width: 84px; aspect-ratio: 4 / 3; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #0c0c0c; opacity: .55; cursor: pointer; scroll-snap-align: start; transition: opacity .2s, border-color .2s, transform .2s; }
.rg-thumb:hover { opacity: .9; }
.rg-thumb[aria-selected="true"] { opacity: 1; border-color: var(--rg-gold); }
.rg-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.rg-empty { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed rgba(255,255,255,.15); border-radius: 14px; background: #0f0f0f; color: #8d897f; font-size: 14px; }

/* Tela cheia */
dialog.rg-lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 56px 0 16px; border: 0; background: rgba(3,3,3,.97); color: #fff; overflow: hidden; }
dialog.rg-lightbox::backdrop { background: rgba(0,0,0,.9); }
dialog.rg-lightbox[open] { display: flex; flex-direction: column; animation: rg-fade .25s ease-out; }
.rg-lightbox .rg { flex: 1; min-height: 0; padding: 0 16px; }
.rg-full .rg-stage { flex: 1; aspect-ratio: auto; min-height: 0; border-radius: 10px; background: transparent; cursor: grab; }
.rg-full .rg-stage:active { cursor: grabbing; }
.rg-full .rg-bg { display: none; }
.rg-full .rg-thumbs { justify-content: center; }
.rg-full .rg-thumb { width: 72px; }
.rg-lightbox-title { position: absolute; top: 0; left: 20px; right: 70px; height: 56px; margin: 0; display: flex; align-items: center; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rg-close { position: absolute; top: 6px; right: 10px; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.rg-close:hover { background: rgba(255,255,255,.1); }

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

@media (hover: none) {
  .rg-nav { opacity: 1; width: 40px; height: 40px; }
}
@media (max-width: 600px) {
  .rg-thumb { width: 64px; }
  .rg-full .rg-thumbs { justify-content: flex-start; }
  .rg-lightbox .rg { padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-track, .rg-nav, .rg-thumb { transition: none; }
  dialog.rg-lightbox[open] { animation: none; }
}
