/* =============================================================
   JT Designs — Portfolio Gallery Section
   ============================================================= */

.gallery {
  padding: 0 0 120px;
}

@media (max-width: 768px) {
  .gallery { padding: 0 0 80px; }
}

/* 3-column masonry-style grid */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Each gallery item: image + caption below */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

/* Staggered heights — masonry feel, all use object-fit: cover so any image crops cleanly */
.gallery-item:nth-child(1) img { height: 440px; }
.gallery-item:nth-child(2) img { height: 380px; margin-top: 60px; }
.gallery-item:nth-child(3) img { height: 420px; margin-top: 20px; }
.gallery-item:nth-child(4) img { height: 400px; margin-top: 40px; }
.gallery-item:nth-child(5) img { height: 360px; margin-top: 72px; }
.gallery-item:nth-child(6) img { height: 430px; margin-top: 10px; }
.gallery-item:nth-child(7) img { height: 410px; margin-top: 30px; }
.gallery-item:nth-child(8) img { height: 370px; margin-top: 52px; }
.gallery-item:nth-child(9) img { height: 440px; margin-top: 16px; }

/* Flatten on mobile — equal height, no offset */
@media (max-width: 768px) {
  .gallery-item:nth-child(n) img {
    height: 260px;
    margin-top: 0;
  }
}

.gallery-item img {
  width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  transition: transform 0.6s var(--ease-out);
}

.gallery-item:hover img { transform: scale(1.03); }

/* Placeholder slot — shown when no real image is provided */
.gallery-placeholder {
  background: var(--cream-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  border: 1px dashed rgba(26, 21, 18, 0.2);
  min-height: 300px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.gallery-placeholder:hover {
  border-color: var(--oxblood);
  background: var(--cream-light);
}

.gallery-placeholder .ph-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding: 0 20px;
}

.gallery-placeholder .ph-icon {
  color: var(--oxblood);
  opacity: 0.5;
}

/* Caption row below the grid */
.gallery-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

.gallery-caption .label { color: var(--ink-soft); }

.gallery-caption a {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}
.gallery-caption a:hover { color: var(--oxblood); }
