/* ==========================================================================
   photo-grid — small rectangles that expand into squares on hover, revealing
   the photo. Shared by the animals, destinations and fish grids.
   ========================================================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 28px;
  max-width: 820px;
}
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
}
.photo-tile::before {
  content: '';
  position: absolute;
  inset: 4px;
  pointer-events: none;
  z-index: 3;
  background-image:
    linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold)),
    linear-gradient(var(--gold), var(--gold)), linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-size: 14px 1.5px, 1.5px 14px, 14px 1.5px, 1.5px 14px, 14px 1.5px, 1.5px 14px, 14px 1.5px, 1.5px 14px;
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.photo-tile:hover::before {
  opacity: 1;
}
.photo-tile:focus-visible .photo-tile-box {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}
.photo-tile-box {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 42%;
  transform: translateY(-50%);
  overflow: hidden;
  border-radius: 0;
  background: rgba(230, 223, 200, 0.05);
  border: 1px solid var(--line);
  transition: height 0.45s cubic-bezier(0.4, 0, 0.2, 1), top 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.45s ease;
}
.photo-tile:hover .photo-tile-box {
  top: 0;
  height: 100%;
  transform: translateY(0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.photo-tile-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px);
  transform: scale(1.12);
  transition: filter 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.photo-tile-box::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 42%);
  opacity: 0.9;
  pointer-events: none;
  transition: opacity 0.5s ease, background 0.5s ease;
}
.photo-tile:hover .photo-tile-box img {
  filter: blur(0);
  transform: scale(1);
}
.photo-tile:hover .photo-tile-box::after {
  opacity: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0) 60%);
}
.photo-tile-caption {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 14px;
}
.photo-tile-name {
  font-family: 'Fraunces', serif;
  font-size: 16px;
}
.photo-tile-desc {
  font-family: 'Archivo', sans-serif;
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(230, 223, 200, 0.8);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}
.photo-tile:hover .photo-tile-desc {
  max-height: 60px;
  opacity: 1;
  margin-top: 4px;
}

@media (max-width: 720px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
