/* ==========================================================================
   Brainstorm Africa — gallery.css
   Styles for the "gallery wall" page only (gallery.html)
   ========================================================================== */

/* ---------------------------------------------------------------------- */
/* Opening white space                                                    */
/* Title reuses the homepage hero word-stagger (.hero-headline / .word),  */
/* so it animates in exactly like the main site.                          */
/* ---------------------------------------------------------------------- */
.gallery-open {
  min-height: 55vh;
  background: var(--offwhite);
  display: flex;
  align-items: flex-end;
  padding-top: var(--nav-height);
}

.gallery-open-inner {
  width: 100%;
  padding: 0 var(--section-pad-x) clamp(32px, 6vw, 64px) var(--section-pad-x);
}

.gallery-open-title {
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--body-on-light);
  margin: 0;
  max-width: 20ch;
}

/* ---------------------------------------------------------------------- */
/* Image wall                                                             */
/* Full-bleed mosaic grid. Every cell is always filled (wide tiles take
   2 columns), so the wall never shows ragged gaps at any screen width.
   Images crop to their cell with object-fit: cover.                      */
/* ---------------------------------------------------------------------- */
.wall {
  display: grid;
  gap: 3px;
  width: 100%;
  background: var(--offwhite);
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(240px, 26vw, 400px);
  grid-template-areas:
    "koffee     koffee  codetrain"
    "baig       payup   drivisa"
    "plano      plano   bluecheese";
}

.wall-tile--koffee     { grid-area: koffee; }
.wall-tile--codetrain  { grid-area: codetrain; }
.wall-tile--baig       { grid-area: baig; }
.wall-tile--payup      { grid-area: payup; }
.wall-tile--drivisa    { grid-area: drivisa; }
.wall-tile--plano      { grid-area: plano; }
.wall-tile--bluecheese { grid-area: bluecheese; }

@media (max-width: 1023px) {
  .wall {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: clamp(220px, 34vw, 360px);
    grid-template-areas:
      "koffee     koffee"
      "codetrain  baig"
      "payup      drivisa"
      "plano      plano"
      "bluecheese bluecheese";
  }
}

@media (max-width: 639px) {
  .wall {
    grid-template-columns: 1fr;
    grid-auto-rows: clamp(200px, 62vw, 300px);
    grid-template-areas:
      "koffee"
      "codetrain"
      "baig"
      "payup"
      "drivisa"
      "plano"
      "bluecheese";
  }
}

/* ---------------------------------------------------------------------- */
/* Tiles                                                                  */
/* ---------------------------------------------------------------------- */
.wall-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0;
}

.wall-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}

/* soft bottom scrim so the label always reads */
.wall-tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.wall-tile:hover img,
.wall-tile:focus-visible img {
  transform: scale(1.06);
  filter: brightness(0.92);
}

.wall-tile:hover::after,
.wall-tile:focus-visible::after {
  opacity: 1;
}

.wall-tile-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
  transform: translateY(101%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.wall-tile-label::after {
  content: "\2192"; /* → */
  color: var(--lime);
  font-size: 14px;
  transition: transform 0.3s ease;
}

.wall-tile:hover .wall-tile-label,
.wall-tile:focus-visible .wall-tile-label {
  transform: translateY(0);
}

.wall-tile:hover .wall-tile-label::after {
  transform: translateX(4px);
}

.wall-tile:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
}

/* dark tile background for transparent PNG case images (Pay Up) */
.wall-tile--payup {
  background: var(--charcoal);
}

/* ---------------------------------------------------------------------- */
/* Reduced motion                                                         */
/* ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .wall-tile img,
  .wall-tile::after,
  .wall-tile-label,
  .wall-tile-label::after {
    transition: none !important;
  }
  .wall-tile:hover img,
  .wall-tile:focus-visible img {
    transform: none;
  }
  .wall-tile-label {
    transform: translateY(0);
    opacity: 1;
  }
  .wall-tile::after {
    opacity: 1;
  }
}
