/* =========================================================
   EVERGREEN SLATE — CONTRACTOR GALLERY
   File: css/gallery.css
   ========================================================= */


/* ---------------------------------------------------------
   Main gallery grid
   --------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}


/* ---------------------------------------------------------
   Gallery cards
   --------------------------------------------------------- */

.gallery-card {
  overflow: hidden;
  border: 1px solid #c9ced3;
  border-radius: 0.35rem;
  background: #ffffff;
  box-shadow: 0 0.2rem 0.7rem rgba(0, 0, 0, 0.08);
}

.gallery-card figure {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 18rem;
  object-fit: cover;
  background: #eef0f2;
}

.gallery-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.1rem;
  border-top: 1px solid #d8dde1;
  background: #f8f9fa;
  color: #26313a;
  text-align: center;
}

.gallery-card figcaption strong {
  color: #123a2c;
  font-size: 1rem;
  line-height: 1.35;
}

.gallery-card figcaption span {
  color: #4d5962;
  font-size: 0.92rem;
  line-height: 1.45;
}


/* ---------------------------------------------------------
   Cards containing two photographs
   --------------------------------------------------------- */

.gallery-image-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  background: #d8dde1;
}

.gallery-image-pair img {
  height: 18rem;
}


/* ---------------------------------------------------------
   Portrait-oriented photograph
   --------------------------------------------------------- */

.gallery-card--portrait img {
  height: 28rem;
  object-fit: contain;
  padding: 0.75rem;
  box-sizing: border-box;
  background: #eef0f2;
}


/* ---------------------------------------------------------
   Optional hover treatment
   --------------------------------------------------------- */

.gallery-card {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.12);
}


/* ---------------------------------------------------------
   Prevent unusually wide content from overflowing
   --------------------------------------------------------- */

.gallery-grid,
.gallery-card,
.gallery-card figure,
.gallery-image-pair {
  min-width: 0;
}


/* ---------------------------------------------------------
   Tablet layout
   --------------------------------------------------------- */

@media (max-width: 900px) {

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card img,
  .gallery-image-pair img {
    height: auto;
    max-height: 32rem;
    object-fit: contain;
  }

  .gallery-card--portrait img {
    height: auto;
    max-height: 38rem;
  }

}


/* ---------------------------------------------------------
   Mobile layout
   --------------------------------------------------------- */

@media (max-width: 600px) {

  .gallery-grid {
    gap: 1rem;
    margin-top: 1rem;
  }

  .gallery-image-pair {
    grid-template-columns: 1fr;
  }

  .gallery-card img,
  .gallery-image-pair img {
    width: 100%;
    height: auto;
    max-height: none;
    padding: 0;
    object-fit: contain;
  }

  .gallery-card figcaption {
    padding: 0.85rem;
  }

  .gallery-card:hover {
    transform: none;
  }

}