/* =========================================================
   Evangelho Diário — Galeria de Imagens
   Identidade visual de evangelhodiario24.com.br
   Fontes: Playfair Display (títulos) + Atkinson Hyperlegible
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Paleta oficial do site */
:root {
  --primary: #9999cc;
  --primary-dark: #7070b8;
  --primary-light: #aaaadd;
  --primary-pale: #eeeef8;
  --cream: #f0f8ff;
  --cream-dark: #e2eff9;
  --ink: #1a2333;
  --ink-secondary: #4a5568;
  --ink-muted: #8896a5;
  --rim: #b0d0d3;
  --sea: #5a95a0;
  --sea-light: #c4dfe6;
  --sea-pale: #eaf4f6;

  --gradient-brand: linear-gradient(135deg, #7070b8 0%, #9999cc 60%, #8888be 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #f0f8ff 100%);

  --shadow-card: 0 1px 3px rgba(153, 153, 204, 0.1), 0 4px 12px rgba(153, 153, 204, 0.08);
  --shadow-card-hover: 0 4px 16px rgba(153, 153, 204, 0.2), 0 1px 4px rgba(153, 153, 204, 0.12);

  --radius-card: 24px;
  --radius-btn: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* brilhos ambiente suaves no topo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 40% at 50% -5%, rgba(153, 153, 204, 0.16), transparent 70%),
    radial-gradient(ellipse 45% 30% at 88% 12%, rgba(90, 149, 160, 0.1), transparent 70%);
  pointer-events: none;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(153, 153, 204, 0.35);
}

/* ===== Header ===== */
.site-header {
  position: relative;
  text-align: center;
  padding: 44px 0 32px;
}

.site-logo {
  width: 108px;
  height: auto;
  margin: 0 auto 18px;
  opacity: 0;
  animation: rise 0.8s var(--ease-out) forwards;
  filter: drop-shadow(0 4px 14px rgba(153, 153, 204, 0.3));
}

.site-verse {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--sea);
  opacity: 0;
  animation: rise 0.8s var(--ease-out) 0.15s forwards;
}

.site-title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  margin-top: 8px;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 16px rgba(153, 153, 204, 0.35));
  opacity: 0;
  animation: rise 0.8s var(--ease-out) 0.3s forwards;
}

.site-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px auto 0;
  color: var(--primary);
  font-size: 0.75rem;
  opacity: 0;
  animation: rise 0.8s var(--ease-out) 0.42s forwards;
}

.site-ornament span {
  display: block;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(153, 153, 204, 0.7));
}

.site-ornament span:last-child {
  background: linear-gradient(90deg, rgba(153, 153, 204, 0.7), transparent);
}

.site-subtitle {
  max-width: 480px;
  margin: 14px auto 0;
  font-size: 0.95rem;
  color: var(--ink-secondary);
  opacity: 0;
  animation: rise 0.8s var(--ease-out) 0.52s forwards;
}

.site-subtitle strong {
  color: var(--primary-dark);
  font-weight: 700;
}

.site-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(153, 153, 204, 0.4);
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-card);
  font-size: 0.82rem;
  color: var(--ink-secondary);
  opacity: 0;
  animation: rise 0.8s var(--ease-out) 0.62s forwards;
}

.site-badge strong {
  color: var(--primary-dark);
  font-weight: 700;
}

.site-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sea);
  box-shadow: 0 0 8px rgba(90, 149, 160, 0.8);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ===== Galeria ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 28px 0 48px;
}

/* --- Card --- */
.card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(176, 208, 211, 0.45);
  box-shadow: var(--shadow-card);
  aspect-ratio: 3 / 4;

  /* animação de entrada (revelado pelo IntersectionObserver) */
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  transition-delay: var(--d, 0ms);
}

.card.visible {
  opacity: 1;
  transform: none;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.06);
  transition:
    opacity 0.8s ease,
    transform 1.1s var(--ease-out);
}

.card img.loaded {
  opacity: 1;
  transform: scale(1);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(153, 153, 204, 0.55);
  transform: translateY(-3px);
}

.card-img-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  z-index: 1;
}

/* overlay inferior com degradê */
.card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 36px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(26, 35, 51, 0.6));
  pointer-events: none; /* o botão dentro reativa os eventos */
}

.card-overlay .btn-download {
  pointer-events: auto;
}

/* ===== Botão de download ===== */
.btn-download {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px; /* min-h-touch do site oficial */
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  background: var(--gradient-brand);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.15s ease, opacity 0.2s ease, box-shadow 0.25s ease;
}

/* efeito de brilho que atravessa o botão */
.btn-download::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.4) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.btn-download:hover::after {
  transform: translateX(120%);
}

.btn-download:hover {
  opacity: 0.92;
  box-shadow: var(--shadow-card-hover);
}

.btn-download:active {
  transform: scale(0.95); /* active:scale-95 do site oficial */
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  padding: 28px 0 34px;
  text-align: center;
  border-top: 1px solid rgba(176, 208, 211, 0.4);
  background: linear-gradient(180deg, transparent, rgba(238, 238, 248, 0.6));
}

.site-footer .site-ornament {
  opacity: 1;
  animation: none;
  margin: 0 auto 12px;
}

.site-footer-verse {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--primary-dark);
}

.site-footer-note {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.site-footer-note a {
  color: var(--sea);
  text-decoration: none;
  font-weight: 700;
}

.site-footer-note a:hover {
  text-decoration: underline;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(26, 35, 51, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeIn 0.3s ease;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-btn);
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(153, 153, 204, 0.35);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out);
}

.lightbox-content img.show {
  opacity: 1;
  transform: scale(1);
}

.lb-btn {
  position: absolute;
  z-index: 102;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.lb-btn:hover {
  background: rgba(153, 153, 204, 0.4);
  border-color: rgba(153, 153, 204, 0.7);
}

.lb-btn:active {
  transform: scale(0.9);
}

.lightbox-close {
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 10px;
}

.lightbox-next {
  right: 10px;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  padding-top: 14px;
}

.lightbox-counter {
  flex-shrink: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: #fff;
  min-width: 64px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(16px) scale(0.96);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(153, 153, 204, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--primary-dark);
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: var(--shadow-card-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.35s var(--ease-out);
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* ===== Animações ===== */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.6;
  }
}

/* ===== Telas maiores ===== */
@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (min-width: 980px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* Respeita usuários que preferem menos animação */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
