/*
 * Seção "Fotos" da home: grid em mosaico num fundo escuro, com zoom ao passar
 * o mouse, legenda sobre a foto, entrada animada ao rolar e lightbox (photos.js).
 */

.photos-area {
  position: relative;
  padding: 110px 0 100px;
  background:
    radial-gradient(ellipse 50% 40% at 10% 0%, rgba(244, 172, 42, 0.16), transparent 70%),
    radial-gradient(ellipse 45% 35% at 95% 100%, rgba(195, 214, 90, 0.12), transparent 70%),
    #141414;
  color: #d6d6d6;
  overflow: hidden;
}

.photos-head {
  max-width: 640px;
  margin: 0 auto 50px;
  text-align: center;
}

.photos-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #f4ac2a;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.photos-head h1 {
  color: #fff;
  font-size: clamp(36px, 6vw, 56px);
}

.photos-head h1::after {
  content: '';
  display: block;
  width: 64px;
  height: 4px;
  margin: 18px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, #f4ac2a, #c3d65a);
}

.photos-head p {
  margin: 18px 0 0;
  color: #bdbdbd;
}

/* ---------- mosaico ---------- */

.photos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 230px;
  grid-auto-flow: dense;
  gap: 16px;
}

.photo-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 18px;
  background: #222;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  isolation: isolate;
}

.photo-big {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-wide {
  grid-column: span 2;
}

.photo-tile picture,
.photo-tile img {
  display: block;
  width: 100%;
  height: 100%;
}

.photo-tile img {
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1), filter 0.5s ease;
}

/* degradê para a legenda ficar legível */
.photo-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.75) 100%);
  pointer-events: none;
}

/* contorno que acende no hover */
.photo-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 2px solid transparent;
  border-radius: inherit;
  transition: border-color 0.4s ease;
  pointer-events: none;
}

.photo-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  z-index: 1;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform 0.4s ease;
}

.photo-caption::before {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 8px;
  border-radius: 2px;
  background: #f4ac2a;
  transition: width 0.4s ease;
}

.photo-big .photo-caption {
  font-size: 26px;
}

.photo-tile:hover img,
.photo-tile:focus-visible img {
  transform: scale(1.08);
  filter: saturate(1.15);
}

.photo-tile:hover::before,
.photo-tile:focus-visible::before {
  border-color: rgba(244, 172, 42, 0.85);
}

.photo-tile:hover .photo-caption,
.photo-tile:focus-visible .photo-caption {
  transform: translateY(-4px);
}

.photo-tile:hover .photo-caption::before,
.photo-tile:focus-visible .photo-caption::before {
  width: 56px;
}

.photo-tile:focus-visible {
  outline: 3px solid #f4ac2a;
  outline-offset: 3px;
}

/* entrada ao rolar (a classe só é posta pelo photos.js) */
.photos-reveal .photo-tile {
  opacity: 0;
  transform: translateY(40px) scale(0.97);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
  transition-delay: calc(var(--i) * 90ms);
}

.photos-reveal .photo-tile.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- chamada para o Instagram ---------- */

.photos-cta {
  margin-top: 44px;
  text-align: center;
}

.photos-insta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 28px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  font-weight: 500;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.photos-insta .fa {
  font-size: 20px;
}

.photos-insta:hover,
.photos-insta:focus-visible {
  border-color: #f4ac2a;
  background: #f4ac2a;
  color: #222;
}

/* ---------- lightbox ---------- */

.photo-lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

/* o tema força display em <dialog>; fechado ele não pode ocupar espaço */
.photo-lightbox:not([open]) {
  display: none;
}

.photo-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-lightbox::backdrop {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(4px);
}

.photo-lightbox figure {
  margin: 0;
  max-width: min(1100px, 86vw);
  text-align: center;
}

.photo-lightbox img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: lb-in 0.35s ease;
}

.photo-lightbox figcaption {
  margin-top: 14px;
  font-size: 18px;
  font-weight: 600;
}

.photo-lightbox button {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  line-height: 1;
  transition: background 0.3s ease;
}

.photo-lightbox button:hover,
.photo-lightbox button:focus-visible {
  background: #f4ac2a;
  color: #222;
}

.lb-close {
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 28px;
}

.lb-prev,
.lb-next {
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border-radius: 50%;
  font-size: 34px;
}

.lb-prev {
  left: 18px;
}

.lb-next {
  right: 18px;
}

@keyframes lb-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: none; }
}

/* ---------- telas menores ---------- */

@media (max-width: 991px) {
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 200px;
  }
}

@media (max-width: 575px) {
  .photos-area {
    padding: 80px 0 70px;
  }

  .photos-grid {
    grid-auto-rows: 150px;
    gap: 10px;
  }

  .photo-tile {
    border-radius: 12px;
  }

  .photo-caption,
  .photo-big .photo-caption {
    left: 12px;
    right: 12px;
    bottom: 10px;
    font-size: 14px;
  }

  .photo-big .photo-caption {
    font-size: 18px;
  }

  .lb-prev,
  .lb-next {
    top: auto;
    bottom: 24px;
    margin-top: 0;
  }

  .lb-prev {
    left: calc(50% - 64px);
  }

  .lb-next {
    right: calc(50% - 64px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-tile img,
  .photos-reveal .photo-tile {
    transition: none;
  }
}
