/* ==========================================================
   Galeria Editorial — Reinauguração Sicredi Videira
   ========================================================== */

/* Barra superior limpa: somente a logo centralizada em fundo branco */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--sicredi-white);
  border-bottom: 1px solid var(--sicredi-border);
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.top-bar-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

/* Conteúdo principal */
.gallery-main {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 14px 64px;
}

@media (min-width: 768px) {
  .gallery-main {
    padding: 32px 28px 80px;
  }
}

/* Palco do Título e Subtítulo — Artboard proporcional (720px virtuais)
   Garante 100% de fidelidade entre o Editor (/adm), Desktop e Celular */
.title-stage {
  --stage-height: 130;
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 14px;
  aspect-ratio: 720 / var(--stage-height);
  border-radius: 6px;
  overflow: hidden;
}

.stage-text-layer {
  --layer-size: 32;
  position: absolute;
  margin: 0;
  padding: 0;
  font-size: calc(var(--layer-size) / 7.2 * 1cqw);
  line-height: 1.15;
  white-space: pre;
}

/* Barra discreta de contagem e atualização */
.gallery-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.photo-count {
  font-size: 0.9rem;
  color: var(--sicredi-neutral-dark);
  font-weight: 700;
}

.btn-refresh {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.86rem;
}

/* Aviso flutuante quando chegam fotos novas */
.new-photos-banner {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--sicredi-green);
  color: var(--sicredi-white);
  border: 2px solid var(--sicredi-white);
  border-radius: 999px;
  padding: 11px 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  box-shadow: 0 10px 28px rgba(20, 110, 55, 0.35);
  cursor: pointer;
  white-space: nowrap;
  animation: bannerPop 0.25s ease;
}

.new-photos-banner:hover {
  background: var(--sicredi-green-hover);
}

@keyframes bannerPop {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.new-photos-banner[hidden] {
  display: none;
}

/* Grade Fluida Justificada Exata (1, 2 ou até 3 fotos por linha)
   - Preenche 100% da largura da tela sem espaços em branco
   - Preserva 100% a proporção real (3:2 horizontal e 2:3 vertical) sem cortes */
.photo-gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 640px) {
  .photo-gallery {
    gap: 10px;
  }
}

.photo-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

@media (min-width: 640px) {
  .photo-row {
    gap: 10px;
  }
}

.photo-item {
  padding: 0;
  border: none;
  background: #ECEFE9;
  border-radius: 4px;
  overflow: hidden;
  display: block;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.16s ease;
}

.photo-item:hover {
  opacity: 0.92;
}

.photo-item:focus-visible {
  outline: 3px solid var(--sicredi-green);
  outline-offset: 2px;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Estado vazio / Carregando */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  max-width: 460px;
  margin: 24px auto;
}

.empty-state h2 {
  color: var(--sicredi-dark-green);
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--sicredi-neutral-dark);
  margin: 0 0 20px;
  font-size: 0.96rem;
}

/* ==========================================================
   Lightbox — Foto em proporção real + 2 botões claros
   ========================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(12, 15, 13, 0.96);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 12px) 16px env(safe-area-inset-bottom, 18px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  color: rgba(255, 255, 255, 0.85);
}

.lightbox-counter {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

.lightbox-close {
  background: rgba(255, 255, 255, 0.14);
  color: var(--sicredi-white);
  border: none;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100dvh - 270px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  touch-action: pan-y;
  will-change: transform, opacity;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  background: rgba(18, 22, 18, 0.82);
  color: var(--sicredi-white);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lightbox-nav:hover {
  background: var(--sicredi-green);
  border-color: var(--sicredi-green);
}

.lightbox-prev {
  left: 8px;
}

.lightbox-next {
  right: 8px;
}

@media (max-width: 560px) {
  .lightbox-nav {
    width: 42px;
    height: 42px;
  }
}

.lightbox-footer {
  width: min(100%, 420px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
}

.ig-mention-tip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 4px 18px 2px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.ig-mention-tip:hover {
  opacity: 0.85;
}

.ig-tip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.ig-tip-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--sicredi-white);
}

.ig-tip-sub {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.84);
}

.ig-tip-sub strong {
  color: #8FE063;
  font-weight: 700;
}

.ig-tip-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.lightbox-actions {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.lightbox-actions .btn {
  min-height: 56px;
  font-size: 1rem;
  border-radius: 10px;
  width: 100%;
  justify-content: flex-start;
  padding: 10px 18px;
  gap: 12px;
  text-align: left;
}

.action-btn-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.action-btn-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96rem;
}

.action-btn-sub {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.82rem;
  opacity: 0.88;
}

.btn-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.empty-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin: 0 auto 14px;
}


