/*##############################################################################
# Script:        gallery.css         (stylesheet, loaded by frontend/pages/gallery.html at /gallery)
# Created by:    Matthew Boucher
# Start date:    2026-10-09
# Location:      <project root>/frontend/css/gallery.css   (main script: <project root>/aiacolyte.py; subscripts: <project root>/subscripts/aiacolyte/)
# Description:   The Gallery page's look: a responsive grid of square picture thumbnails (object-fit: cover)
#                that brighten and lift a little on hover, each clickable to its Instagram post; a small gold
#                rune badge marks a picture that is live on Instagram; the admin upload form's image preview.
#                Loads after styles.css and admin.css (it uses their colour tokens), so it only adds the
#                gallery-specific rules. Works with the main script, which serves it as /static/css/gallery.css.
# Reads:         the colour tokens defined in styles.css (--gold, --gold-bright, --text, --ink-*, --ease)
# Writes:        nothing
# Sensitive:     none needed
# Arguments:     none (a stylesheet cannot take flags); aiacolyte.py --checkup confirms it is in place
##############################################################################*/

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: clamp(10px, 1.6vw, 18px);
  margin: 10px 0 32px;
}

.gallery-tile {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-tile__link {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(227, 176, 75, 0.22);
  background: var(--ink-2, #1a1511);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s var(--ease, ease), border-color 0.3s, box-shadow 0.3s;
}

.gallery-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.96) brightness(0.96);
  transition: transform 0.4s var(--ease, ease), filter 0.3s;
}

.gallery-tile__link:hover,
.gallery-tile__link:focus-visible {
  transform: translateY(-3px);
  border-color: var(--gold-bright, #e3b04b);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  outline: none;
}

.gallery-tile__link:hover .gallery-tile__img,
.gallery-tile__link:focus-visible .gallery-tile__img {
  transform: scale(1.05);
  filter: saturate(1.05) brightness(1.04);
}

.gallery-tile__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 0.8rem;
  color: var(--gold-bright, #e3b04b);
  background: rgba(17, 14, 11, 0.72);
  box-shadow: 0 0 10px rgba(227, 176, 75, 0.4);
}

.gallery-tile__cap {
  font-family: var(--font-display, Cinzel, Georgia, serif);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  color: var(--text, #efe6d6);
  text-align: center;
}

.gallery-tile__admin {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.gallery-tile .gallery-del {
  align-self: center;
}

.gallery-preview {
  margin: 4px 0 6px;
}

.gallery-preview img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 10px;
  border: 1px solid rgba(227, 176, 75, 0.3);
  object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-tile__link,
  .gallery-tile__img {
    transition: none;
  }
  .gallery-tile__link:hover,
  .gallery-tile__link:focus-visible {
    transform: none;
  }
  .gallery-tile__link:hover .gallery-tile__img,
  .gallery-tile__link:focus-visible .gallery-tile__img {
    transform: none;
  }
}

/*##############################################################################
# End of gallery.css
##############################################################################*/
