/* ============ Homepage Portfolio Section ============ */
/* Scoped styles for the new "Our Work" gallery section on index.html.
   Namespaced with .hp- prefix so nothing here touches existing site styles. */

.hp-section {
  padding-top: 0;
}

.hp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.hp-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface-2);
  aspect-ratio: 4 / 3;
  transition: box-shadow var(--transition-interactive);
}

.hp-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: 1 / 1;
}

.hp-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hp-item:hover {
  box-shadow: var(--shadow-lg);
}

.hp-item:hover img {
  transform: scale(1.06);
}

.hp-item-tag {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  background: oklch(0.16 0.05 255 / 0.72);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

.hp-cta-row {
  display: flex;
  justify-content: center;
  margin-top: var(--space-10);
}

@media (max-width: 900px) {
  .hp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hp-item:first-child {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 560px) {
  .hp-grid {
    grid-template-columns: 1fr;
  }
  .hp-item:first-child {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }
}

/* ---- Lightbox (namespaced, independent of any other lightbox on the site) ---- */
.hp-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(0.1 0.03 255 / 0.92);
  padding: var(--space-8);
}

.hp-lightbox[hidden] {
  display: none;
}

.hp-lightbox-image {
  max-width: min(90vw, 1200px);
  max-height: 85vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  object-fit: contain;
}

.hp-lightbox-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: oklch(1 0 0 / 0.08);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-interactive);
}

.hp-lightbox-close:hover {
  background: oklch(1 0 0 / 0.18);
}

.hp-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: oklch(1 0 0 / 0.08);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-interactive);
}

.hp-lightbox-nav:hover {
  background: oklch(1 0 0 / 0.18);
}

.hp-lightbox-prev {
  left: var(--space-6);
}

.hp-lightbox-next {
  right: var(--space-6);
}

@media (max-width: 640px) {
  .hp-lightbox-nav {
    width: 42px;
    height: 42px;
  }
  .hp-lightbox-close {
    top: var(--space-4);
    right: var(--space-4);
  }
  .hp-lightbox-prev {
    left: var(--space-2);
  }
  .hp-lightbox-next {
    right: var(--space-2);
  }
}
