/* Estrutura (estrutura.html) — só o que é específico desta aba
   Orbes (3): vinho, prata, nude. Blur: 6 molduras + lightbox (fechado: não
   renderiza) (+ header, tab bar, menu, WA = 11).
   Fase 3: lightbox (page-estrutura.js) — moldura vira botão; <dialog> em tela cheia. */
/* --- Fase 4 · CSS só de quem usa ---
   Componentes usados por 2 abas moraram em base/glass/motion.css até a Fase 3; agora
   cada aba carrega só o que usa (cobertura de CSS). CÓPIAS IDÊNTICAS: placeholder de foto em page-dra.css —
   ao mudar um bloco aqui, mude também lá. Ordem = a cascata antiga (base → glass → motion). */
/* Placeholder de fotografia (Dra. + Estrutura) · antes em base.css */
.photo-placeholder {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(233, 221, 216, 0.85), rgba(247, 244, 242, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--espaco-3);
  overflow: hidden;
  text-align: center;
}
.photo-placeholder-mark { width: 90px; opacity: 0.18; }
.photo-placeholder-label { font-family: var(--fonte-titulo); color: var(--or-grafite); font-size: 16px; }
.photo-placeholder .p-badge { position: absolute; top: 14px; right: 14px; }
/* Movimento · orbe que encosta na borda clara: parallax curto e deriva suave */
.gallery-section { --par: 10px; --drift: 0.4; }

.gallery-section {
  --o1-x: 12%; --o1-y: 42%; --o1-s: 34vw; --o1-c: var(--orb-vinho);
  --o2-x: 90%; --o2-y: 66%; --o2-s: 34vw; --o2-c: var(--orb-prata);
  --o3-x: 60%; --o3-y: 45%; --o3-s: 32vw; --o3-c: rgba(116, 24, 43, 0.10);
}

.gallery-grid { display: grid; gap: var(--espaco-4); }
@media (min-width: 480px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--espaco-5); } }

/* Moldura de vidro 4:3 */
.gallery-item { position: relative; padding: 10px; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.gallery-item .photo-placeholder { aspect-ratio: 4 / 3; }
.gallery-item > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
}
@media (hover: hover) {
  .gallery-item:hover { transform: translateY(-2px); box-shadow: var(--glass-shadow-hover), var(--glass-inner); }
}

/* Gatilho do lightbox: cobre a moldura inteira (o placeholder continua visual). */
.gallery-trigger {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  cursor: zoom-in;
}

/* --- Lightbox (dialog.lightbox.glass--dark) --- */
html.lightbox-open { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  overflow: hidden;
  overscroll-behavior: contain;
  color: var(--branco);
}
.lightbox.glass--dark {
  border: 0;
  border-radius: 0;
  background: rgba(74, 17, 32, 0.9);   /* vidro escuro denso: legenda prata-clara ≥ 9:1 */
  box-shadow: none;
}
.lightbox::backdrop { background: rgba(36, 34, 36, 0.4); }
.lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--espaco-3);
}

.lightbox-top { display: flex; align-items: center; justify-content: space-between; gap: var(--espaco-3); }
.lightbox-count {
  padding-left: 8px;
  font-family: var(--fonte-titulo);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--or-prata-clara);
}

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--espaco-4);
  min-height: 0;
  margin: 0;
}
.lightbox-stage {
  width: min(100%, 1100px, calc((100dvh - 220px) * 4 / 3));
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;      /* gesto horizontal vai para o swipe */
  transform-origin: center;
}
.lightbox-media { width: 100%; height: 100%; }
.lightbox-media > img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-media .photo-placeholder { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 20px; }
.lightbox-media .photo-placeholder-mark { width: clamp(90px, 18%, 180px); }
.lightbox-media .photo-placeholder-label { font-size: clamp(16px, 2vw, 22px); }
.lightbox-media .photo-placeholder .p-badge { top: 18px; right: 18px; }
.lightbox-caption {
  max-width: 60ch;
  text-align: center;
  font-size: var(--texto-base);
  line-height: 1.5;
  color: var(--or-prata-clara);
}

.lightbox-nav { display: flex; justify-content: center; gap: var(--espaco-4); }
@media (min-width: 768px) {
  .lightbox-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    justify-content: space-between;
    padding-inline: var(--espaco-5);
    translate: 0 -50%;
    pointer-events: none;
  }
  .lightbox-nav .lightbox-btn { pointer-events: auto; }
}

/* Botões redondos de vidro escuro. Setas tipográficas (o kit não tem ícone de
   seta/fechar; o "→" já é usado nos links do site) e "×" desenhado em CSS,
   como o do menu móvel. */
.lightbox-btn {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(216, 219, 223, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--branco);
  font-family: var(--fonte-titulo);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform var(--t-press) var(--ease-out);
}
.lightbox-btn.glass--pill { --spec: 0.18; }
.lightbox-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: var(--branco); }
.lightbox-btn:focus-visible { outline: 3px solid var(--branco); outline-offset: 3px; }
.lightbox-x { position: relative; display: block; width: 20px; height: 20px; }
.lightbox-x::before,
.lightbox-x::after {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--branco);
}
.lightbox-x::before { transform: rotate(45deg); }
.lightbox-x::after { transform: rotate(-45deg); }

/* ============================================================================
   GALERIA COM AS FOTOS REAIS — .gallery-grid--fotos (nov/2026)
   Usada na aba Estrutura e no Início (que também carrega este arquivo).
   As fotos são verticais e de proporções diferentes: colunas (CSS columns), cada foto na proporção
   do arquivo — nada é cortado. 2 colunas no celular, 3 no tablet, 4 no desktop. A moldura de vidro,
   a entrada na rolagem, a subida no hover e o lightbox são os de sempre; aqui só muda a grade.
   Molduras em .glass--lite (14 molduras com blur estourariam o orçamento de 12 por página).
   ========================================================================== */
.gallery-grid--fotos { display: block; columns: 2; column-gap: var(--espaco-3); }
.gallery-grid--fotos .gallery-item {
  break-inside: avoid;
  margin-bottom: var(--espaco-3);
  padding: 6px;
  border-radius: 20px;
}
.gallery-grid--fotos .gallery-item > img { aspect-ratio: auto; height: auto; border-radius: 14px; }
@media (min-width: 768px) {
  .gallery-grid--fotos { columns: 3; column-gap: var(--espaco-4); }
  .gallery-grid--fotos .gallery-item { margin-bottom: var(--espaco-4); padding: 8px; border-radius: 22px; }
  .gallery-grid--fotos .gallery-item > img { border-radius: 15px; }
}
@media (min-width: 1024px) {
  .gallery-grid--fotos { columns: 4; column-gap: var(--espaco-5); }
  .gallery-grid--fotos .gallery-item { margin-bottom: var(--espaco-5); }
}

/* ============================================================================
   GALERIA EM DUAS FILEIRAS DESLIZANTES — .gallery-marquee
   Fileira 1: 8 fotos do consultório (esquerda) · Fileira 2: 6 fotos de atendimentos (direita).
   Cada foto aparece inteira na proporção natural (width: auto; height: 100%; object-fit: contain).
   Loop infinito sem salto: .gallery-group tem padding-right igual ao gap entre itens.
   Pausa no hover/foco; reduzido/sem JS: rolagem horizontal manual sem clones.
   ========================================================================== */
.gallery-marquee {
  --marquee-h: 250px;
  --marquee-gap: var(--espaco-4);
  display: flex;
  flex-direction: column;
  gap: var(--espaco-4);
  width: 100%;
  margin-top: var(--espaco-5);
}
@media (min-width: 768px) {
  .gallery-marquee { --marquee-h: 310px; --marquee-gap: var(--espaco-5); gap: var(--espaco-5); }
}
@media (min-width: 1024px) {
  .gallery-marquee { --marquee-h: 350px; }
}

.gallery-row {
  overflow: hidden;
  padding-block: 6px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.gallery-row[data-dir="left"] { --marquee-dur: 58s; }
.gallery-row[data-dir="right"] { --marquee-dur: 48s; }

.gallery-track {
  display: flex;
  width: max-content;
}
.gallery-group {
  display: flex;
  flex-shrink: 0;
  gap: var(--marquee-gap);
  padding-right: var(--marquee-gap);
  list-style: none;
  margin: 0;
  padding-left: 0;
}
.gallery-row .gallery-item {
  flex: 0 0 auto;
  height: var(--marquee-h);
  padding: 6px;
  border-radius: 20px;
}
.gallery-row .gallery-item > img {
  display: block;
  width: auto;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 14px;
}
@media (min-width: 768px) {
  .gallery-row .gallery-item { padding: 8px; border-radius: 22px; }
  .gallery-row .gallery-item > img { border-radius: 15px; }
}

@keyframes gallery-marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

html:not(.reduce-motion) .gallery-row.is-marquee .gallery-track {
  animation: gallery-marquee-scroll var(--marquee-dur, 54s) linear infinite;
  will-change: transform;
}
html:not(.reduce-motion) .gallery-row.is-marquee[data-dir="right"] .gallery-track {
  animation-direction: reverse;
}

@media (hover: hover) {
  html:not(.reduce-motion) .gallery-row.is-marquee:hover .gallery-track {
    animation-play-state: paused;
  }
}
html:not(.reduce-motion) .gallery-row.is-marquee:focus-within .gallery-track {
  animation-play-state: paused;
}

/* Não aplicar animação de saída por scroll vertical dentro das fileiras horizontais */
.home-section .gallery-row .gallery-item { animation: none; }

/* Modo reduzido ou sem JS: lista horizontal navegável, sem clones */
html.reduce-motion .gallery-row,
html:not(.js) .gallery-row {
  overflow-x: auto;
  padding-inline: var(--gutter);
  -webkit-mask-image: none;
  mask-image: none;
}
html.reduce-motion .gallery-row .gallery-track,
html:not(.js) .gallery-row .gallery-track {
  animation: none;
  will-change: auto;
}
html.reduce-motion .gallery-group--clone,
html:not(.js) .gallery-group--clone {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .gallery-row {
    overflow-x: auto;
    padding-inline: var(--gutter);
    -webkit-mask-image: none;
    mask-image: none;
  }
  .gallery-row .gallery-track { animation: none; will-change: auto; }
  .gallery-group--clone { display: none; }
}
