/* ── Gallery grid layout ───────────────────────────────── */

.gallery-intro {
  max-width: 48rem;
  margin: 0 auto 3rem;
  text-align: center;
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
  font-style: italic;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2rem;
  padding: 0 1rem 4rem;
  max-width: 72rem;
  margin: 0 auto;
}

/* ── Individual card ──────────────────────────────────── */

.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.gallery-card:hover { text-decoration: none; }

/* Portrait container — square, cropped */
.gallery-portrait {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-card:hover .gallery-portrait {
  border-color: var(--ua-yellow, #ffd700);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.12);
}

.gallery-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.7) brightness(0.9);
  transition: filter 0.3s ease;
}

.gallery-card:hover .gallery-portrait img {
  filter: saturate(0.85) brightness(1);
}

/* Name label beneath image */
.gallery-name {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e0e0e0;
  text-align: center;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.gallery-card:hover .gallery-name {
  color: var(--ua-yellow, #ffd700);
}

/* ── Hover tooltip ────────────────────────────────────── */

.gallery-tooltip {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: max(200px, 100%);
  max-width: 280px;
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.75);
  text-align: center;
  z-index: 100;
  pointer-events: none;

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;

  /* Subtle shadow */
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

/* Arrow */
.gallery-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #333;
}

.gallery-card:hover .gallery-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
  .gallery-tooltip {
    display: none; /* touch devices — no hover */
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
