/* A aba Fotos do link dos pais (mosaico.js): as fotos do dia em colunas, cada
   uma do tamanho que o formato dela pede, com a legenda aparecendo por cima
   ao passar o mouse (sempre à vista no toque). A pinça de dois dedos muda o
   número de colunas; no computador, os três botões de tamanho. Portado da
   galeria Mosaico (afx.art.br/galeria), pedido dele em 03/10/2026. Depende
   de base.css e pais.css. */
:root { --curva-assenta: cubic-bezier(.18, 1, .26, 1); --laranja: #ea580c; }

.bloco-fotos .bloco-cabeca { align-items: center; }
.fotos-cabeca-esquerda { display: flex; flex-direction: column; gap: 2px; }
.fotos-contagem { text-align: left; }
.fotos-cabeca-direita { display: flex; align-items: center; gap: 10px; }
/* A dica da pinça, em laranja pra chamar o olho (pedido dele em 03/10/2026):
   só no celular, onde a pinça faz o papel dos três tamanhos. */
.fotos-dica-pinca { display: none; color: var(--laranja); font-size: 12.5px; font-weight: 800; text-align: right; }

/* --- Os três tamanhos: o fundo da escolha é um só, que desliza (--densidade-x);
   some quando as colunas vieram da pinça ------------------------------------------ */
.densidade { position: relative; isolation: isolate; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--linha); border-radius: 8px; background: var(--cartao); }
.densidade::before { content: ""; position: absolute; z-index: -1; left: 0; top: 3px; width: 32px; height: 30px; border-radius: 6px; background: var(--verde-fraco); transform: translateX(var(--densidade-x, 3px)); opacity: var(--densidade-opacidade, 1); transition: transform .55s var(--curva-assenta), opacity .25s; }
.densidade button { display: grid; place-items: center; width: 32px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--texto-fraco); cursor: pointer; transition: color .25s; -webkit-tap-highlight-color: transparent; }
.densidade button[aria-pressed="true"] { color: var(--verde-escuro); }
.densidade button:hover { color: var(--texto); }
.densidade button:focus-visible { outline: 3px solid var(--verde); outline-offset: 1px; }
.densidade svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; transition: transform .45s var(--curva-assenta); }
.densidade button:active svg { transform: scale(.86); }

/* O aviso só pro leitor de tela ("3 colunas"). */
.fotos-aviso { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* --- O mosaico: colunas; pan-y faz a pinça mudar as colunas em vez de dar
   zoom na página ----------------------------------------------------------------------- */
.mosaico { column-count: var(--colunas, 2); column-gap: 10px; touch-action: pan-y; }
/* Coluna estreita demais (muitas colunas): a legenda cobriria a foto, então some. */
.mosaico[data-denso] .foto-legenda, .mosaico[data-denso] .foto::after { display: none; }

.foto { display: inline-block; position: relative; width: 100%; margin: 0 0 10px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--linha); break-inside: avoid; vertical-align: top; isolation: isolate; transform-origin: 0 0; cursor: zoom-in; transition: box-shadow .55s var(--curva-assenta); -webkit-tap-highlight-color: transparent; }
.foto:focus-visible { outline: 3px solid var(--verde); outline-offset: 2px; }
.foto img { display: block; width: 100%; height: auto; transition: transform 1.1s var(--curva-assenta); }
/* O escurecido de baixo, pra legenda ler em cima da foto. */
.foto::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); opacity: 0; pointer-events: none; transition: opacity .6s var(--curva-assenta); }
/* Uma luz discreta segue o mouse sobre a miniatura (--luz-x e --luz-y vêm do script). */
.foto::before { content: ""; position: absolute; z-index: 2; inset: 0; border-radius: inherit; background: radial-gradient(350px circle at var(--luz-x, 50%) var(--luz-y, 40%), rgba(255, 255, 255, .2), transparent 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); opacity: 0; pointer-events: none; transition: opacity .7s var(--curva-assenta); }
.foto-legenda { position: absolute; z-index: 1; bottom: 12px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #fff; font-size: 12.5px; font-weight: 700; text-align: left; opacity: 0; transform: translateY(10px); transition: opacity .5s var(--curva-assenta), transform .65s var(--curva-assenta); }
.foto-legenda span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-legenda svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transform: translate(-4px, 4px) scale(.85); transition: transform .75s var(--curva-assenta); }
.foto:hover img { transform: scale(1.035); }
.foto:hover::after, .foto:focus-visible::after, .foto:hover .foto-legenda, .foto:focus-visible .foto-legenda { opacity: 1; transform: none; }
.foto:focus-visible .foto-legenda svg { transform: none; }
.foto--falhou { min-height: 120px; }
.foto--falhou img { min-height: 120px; padding: 16px; color: var(--texto-fraco); font-size: 13px; }
.foto--falhou .foto-legenda { opacity: 1; transform: none; color: var(--texto); }

@media (hover: hover) and (pointer: fine) {
  .foto:hover { box-shadow: 0 12px 30px -12px rgba(15, 23, 42, .4); }
  .foto:hover::before { opacity: 1; }
  .foto:hover .foto-legenda svg { transform: none; }
  .foto:active img { transform: scale(1.018); }
}

/* --- No fim de propósito: media query não ganha por especificidade, ganha
   por vir depois ---------------------------------------------------------------------- */
@media (hover: none) {
  .foto::after, .foto-legenda { opacity: 1; transform: none; }
  .foto:hover img { transform: none; }
  .foto-legenda svg { transform: none; }
}

@media (max-width: 640px) {
  .densidade { display: none; }
  .fotos-dica-pinca { display: block; }
  .mosaico { column-gap: 8px; }
  .foto { margin-bottom: 8px; border-radius: 10px; }
  .foto-legenda { left: 10px; right: 10px; bottom: 10px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .foto, .foto img, .foto::before, .foto::after, .foto-legenda, .foto-legenda svg, .densidade::before, .densidade svg { transition: none; }
}
