/* Recursos do site (Minha conta > Recursos do site). Cada bloco vale só com o recurso ligado em <html data-feats>.
   Só transform e opacity nas animações, e tudo desliga com "menos animações". */

/* ---------- Grade justificada ---------- */
.jgrid { display: flex; flex-direction: column; gap: var(--jgap, .6rem); }
.jrow { display: flex; gap: var(--jgap, .6rem); }
.jrow .tile { flex: 0 0 auto; width: var(--w); height: var(--h); }
.jrow .tile .im, .jrow .tile .lq { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jrow .tile::before { display: none; }

/* ---------- Entrada em cascata (desligada) ---------- */
:root:not([data-feats~="cascade"]) .tile.enter { animation: none; }

/* ---------- Coração com partículas nos cards ---------- */
.tile .fav { overflow: visible; }

/* ---------- Visualizador em tela cheia ---------- */
:root[data-feats~="viewer_full"] .viewer-media { background: #08080a; cursor: zoom-in; touch-action: none; }
:root[data-feats~="viewer_full"] .viewer-media.zoomed { cursor: grab; }
:root[data-feats~="viewer_full"] .viewer-media.zoomed.drag { cursor: grabbing; }
.viewer-media img.zoomable { transition: transform .18s var(--ease-out), opacity var(--t3), filter var(--t3); will-change: transform; }
.viewer-zoom { position: absolute; right: .75rem; bottom: .75rem; display: flex; gap: .25rem; padding: .25rem; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; z-index: 2; }
.viewer-zoom button { width: 2rem; height: 2rem; border-radius: 50%; color: inherit; display: grid; place-items: center; }
.viewer-zoom button:hover { background: rgba(255, 255, 255, .15); }
.viewer-zoom span { font-size: .75rem; min-width: 2.6rem; text-align: center; align-self: center; font-variant-numeric: tabular-nums; }

/* ---------- Cor da página acompanha a obra ---------- */
:root[data-feats~="tint"] .viewer-bg { background: color-mix(in srgb, var(--tint, #000) 45%, rgba(0, 0, 0, .78)); transition: background .6s var(--ease-out), opacity var(--t3); }
:root[data-feats~="tint"] .viewer-shell { background: color-mix(in srgb, var(--tint, var(--bg-elev)) 7%, var(--bg-elev)); transition: background .6s var(--ease-out), opacity var(--t3), transform var(--t4) var(--ease-out); }

/* ---------- Visualizador que cresce do card ---------- */
.v-grow { position: fixed; z-index: 260; border-radius: var(--r); object-fit: cover; pointer-events: none; transform-origin: 0 0; transition: transform .38s cubic-bezier(.2, .8, .2, 1), opacity .2s .3s; }

/* ---------- Prévia na sua tela (moldura) ---------- */
.frame-view { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg-sunken); z-index: 1; padding: 1.5rem; }
.frame-view[hidden] { display: none; }
.frame { position: relative; display: grid; place-items: center; transition: width .45s var(--ease-out), height .45s var(--ease-out), border-radius .45s var(--ease-out), padding .45s var(--ease-out); background: #111; box-shadow: 0 20px 60px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .06); }
:root:not([data-feats~="format_morph"]) .frame { transition: none; }
.viewer-media .frame img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; object-position: var(--fp, 50% 50%); display: block; border-radius: inherit; box-shadow: none; transform: none; }
.frame[data-kind="desktop"] { border-radius: 14px; padding: 12px; }
.frame[data-kind="desktop"]::after { content: ""; position: absolute; left: 50%; bottom: -46px; width: 120px; height: 46px; transform: translateX(-50%); background: linear-gradient(#2a2a2e, #1a1a1e); clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.frame[data-kind="phone"] { border-radius: 38px; padding: 10px; }
.frame[data-kind="phone"]::before { content: ""; position: absolute; top: 18px; left: 50%; width: 70px; height: 20px; transform: translateX(-50%); border-radius: 20px; background: #000; z-index: 2; }
.frame[data-kind="tablet"] { border-radius: 26px; padding: 16px; }
.viewer-media .frame[data-kind="phone"] img { border-radius: 30px; }
.viewer-media .frame[data-kind="tablet"] img { border-radius: 12px; }
.frame-tabs { position: absolute; top: .75rem; left: 50%; transform: translateX(-50%); z-index: 3; }

/* ---------- Recorte manual ---------- */
.crop-layer { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(0, 0, 0, .55); }
.crop-layer[hidden] { display: none; }
.crop-stage { position: relative; max-width: 92%; max-height: 86%; }
.viewer-media .crop-stage img { box-shadow: none; transform: none; border-radius: 0; display: block; max-width: 100%; max-height: 70vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); outline: 2px solid #fff; cursor: move; touch-action: none; }
.crop-box::before, .crop-box::after { content: ""; position: absolute; inset: 0; border: 1px dashed rgba(255, 255, 255, .5); }
.crop-box::before { left: 33.3%; right: 33.3%; border-top: 0; border-bottom: 0; }
.crop-box::after { top: 33.3%; bottom: 33.3%; border-left: 0; border-right: 0; }
.crop-bar { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }

/* ---------- Painel lateral: blocos novos ---------- */
.v-extra { display: grid; gap: .5rem; }
.v-custom { display: flex; gap: .4rem; align-items: center; }
.v-custom .input { width: 6.5rem; }
.v-screen { font-size: .82rem; color: var(--fg-3); display: flex; gap: .4rem; align-items: center; }
.v-folders { display: flex; flex-wrap: wrap; gap: .35rem; }
.qr-box { display: grid; justify-items: center; gap: .75rem; text-align: center; }
.qr-box svg { width: 220px; height: 220px; background: #fff; border-radius: 12px; padding: 8px; }

/* ---------- Progresso no botão de download ---------- */
.dl-btn.progress { background: linear-gradient(90deg, color-mix(in srgb, var(--fg) 20%, transparent) var(--p, 0%), transparent var(--p, 0%)), var(--accent); }

/* ---------- Seleção para download em lote ---------- */
[data-selecting] .tile { cursor: pointer; }
.tile .sel { position: absolute; top: .55rem; left: .55rem; z-index: 3; width: 1.6rem; height: 1.6rem; border-radius: 8px; border: 2px solid #fff; background: rgba(0, 0, 0, .3); display: none; place-items: center; color: #fff; }
[data-selecting] .tile .sel { display: grid; }
.tile.is-sel .sel { background: var(--accent); border-color: var(--accent); }
.tile.is-sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.tile .sel svg { width: .9rem; height: .9rem; opacity: 0; }
.tile.is-sel .sel svg { opacity: 1; }
.zipbar { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); z-index: 120; display: flex; gap: .5rem; align-items: center; padding: .5rem .5rem .5rem 1rem; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.zipbar[hidden] { display: none; }
@media (max-width: 960px) { .zipbar { bottom: 5.25rem; } }

/* ---------- Pastas de favoritos e filtros salvos ---------- */
.folders { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.folders .chip.is-active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sb-saved .nav-item { font-size: .9rem; }
.ex-tools { display: flex; gap: .35rem; flex-wrap: wrap; }
.palette-pick { display: inline-flex; align-items: center; gap: .4rem; }
.palette-pick input[type="color"] { width: 2rem; height: 2rem; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; }
.didyoumean { margin: .25rem 0 1rem; color: var(--fg-2); }
.didyoumean button { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 550; }

/* ---------- Coleção como revista ---------- */
.editorial-hero { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: clamp(16rem, 42vw, 30rem); display: grid; align-items: end; margin-bottom: 1.5rem; background: var(--img-bg); }
.editorial-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.editorial-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0, 0, 0, .7)); }
.editorial-hero > div { position: relative; z-index: 1; padding: clamp(1.25rem, 4vw, 2.5rem); color: #fff; max-width: 46rem; }
.editorial-hero h1 { color: #fff; }
.editorial-hero p { color: rgba(255, 255, 255, .86); font-size: 1.05rem; line-height: 1.6; }

/* ---------- Início da galeria: obra do dia, votação e avisos ---------- */
.daily-card { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0; overflow: hidden; padding: 0; margin-bottom: 1.5rem; }
.daily-card img { width: 100%; height: 100%; min-height: 14rem; object-fit: cover; display: block; cursor: zoom-in; }
.daily-card > div { padding: 1.5rem; display: grid; gap: .6rem; align-content: center; }
@media (max-width: 760px) { .daily-card { grid-template-columns: 1fr; } }
.poll { display: grid; gap: .5rem; }
.poll-opt { position: relative; display: flex; justify-content: space-between; padding: .65rem .9rem; border-radius: var(--r-sm); border: 1px solid var(--border); overflow: hidden; text-align: left; width: 100%; }
.poll-opt i { position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); background: color-mix(in srgb, var(--accent) 14%, transparent); transition: width .6s var(--ease-out); }
.poll-opt span, .poll-opt b { position: relative; }
.poll-opt.mine { border-color: var(--accent); }
.new-alerts { margin-bottom: 1.5rem; }

/* ---------- Recursos do site (conta) ---------- */
.feat-group { margin: 1.75rem 0 0; }
.feat-group h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); margin: 0 0 .25rem; }
.feat-group > p { margin: 0 0 .75rem; }
.feat-row { display: flex; align-items: center; gap: 1rem; padding: .8rem 1rem; }
.feat-row + .feat-row { border-top: 1px solid var(--border); }
.feat-row > div { flex: 1; min-width: 0; }
.feat-row strong { display: block; font-weight: 550; }
.feat-row small { color: var(--fg-3); }

/* ---------- Mapa do acervo ---------- */
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem; }
.map-cat { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-radius: var(--r); border: 1px solid var(--border); background: var(--bg-elev); transition: transform var(--t2) var(--ease), border-color var(--t2); }
.map-cat:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.map-cat b { font-variant-numeric: tabular-nums; color: var(--fg-3); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag-cloud a { font-size: calc(.8rem + var(--w, 0) * .5rem); }
.color-bars { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; }
.color-bars a { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border-radius: var(--r-sm); border: 1px solid var(--border); }
.color-bars i { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }

/* ---------- Barra inferior no celular ---------- */
:root:not([data-feats~="mobile_bar"]) .tabbar { display: none !important; }
:root[data-feats~="mobile_bar"] .tabbar { backdrop-filter: blur(12px); }

/* ---------- Logo viva ---------- */
:root[data-feats~="living_logo"] .lg-sun { animation: sun-rise 1.2s var(--ease-out) .2s both; transform-box: fill-box; }
@keyframes sun-rise { from { transform: translateY(5px); opacity: .4; } }

/* ---------- Paralaxe ---------- */
.parallax-layer { transition: transform .4s var(--ease-out); will-change: transform; }

/* ---------- O Mu no site ---------- */
.mu-corner { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; width: 64px; height: 80px; cursor: pointer; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.mu-corner .robot { width: 64px; height: 80px; }
.mu-help-end { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; padding: 1.25rem; border-radius: var(--r); background: var(--bg-sunken); }
.mu-help-end .robot { width: 72px; height: 90px; }
@media (max-width: 960px) { .mu-corner { bottom: 5rem; } }

/* ---------- Status ---------- */
.status-card { display: flex; gap: 1rem; align-items: center; padding: 1.5rem; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ok, #16a34a); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok, #16a34a) 18%, transparent); flex: none; }
.status-dot.bad { background: #e11d48; box-shadow: 0 0 0 6px rgba(225, 29, 72, .18); }

@media (prefers-reduced-motion: reduce) {
  .frame, .v-grow, .parallax-layer, .poll-opt i { transition: none !important; }
  :root .lg-sun { animation: none !important; }
}
:root[data-motion="reduce"] .frame, :root[data-motion="reduce"] .v-grow, :root[data-motion="reduce"] .parallax-layer { transition: none !important; }

.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.status-hist { list-style: none; padding: 0; display: grid; gap: .5rem; color: var(--fg-2); }
.footer-slim { padding: 1.25rem 0; }
.footer-slim-row { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
.footer-slim-row nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .875rem; }
.footer-slim-row nav a { color: var(--fg-2); }
