/* ============================================================
   WORKS — LAYOUT
   ============================================================ */

.works-main {
  padding: 48px 40px 60px;
}


/* ============================================================
   FILTER BUTTONS
   ============================================================ */

.works-filter {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.filter-btn {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text-sub);
  background: transparent;
  border: 0.5px solid var(--color-border);
  border-radius: 20px;
  padding: 4px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.filter-btn:hover {
  color: var(--color-text);
  border-color: var(--color-accent-lt);
}

.filter-btn.is-active {
  color: var(--color-accent);
  border-color: var(--color-accent-lt);
  background: var(--color-surface);
}

/* ============================================================
   GALLERY GRID
   ============================================================ */

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ============================================================
   WORK ITEM
   ============================================================ */

.work-item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 4px;
  background: var(--color-surface);
  cursor: pointer;
}

.work-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.work-item:hover .work-thumb {
  transform: scale(1.04);
}

/* ---- Hover overlay ---- */

.work-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 26, 28, 0.52);
  display: flex;
  align-items: flex-end;
  padding: 14px 12px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.work-item:hover .work-overlay {
  opacity: 1;
}

.work-title {
  font-size: 11px;
  font-weight: 500;
  color: #F6F3F2;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #FFFFFF 0%, var(--color-border) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Close button ---- */

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.15s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.6;
  stroke-linecap: round;
}

/* ---- Prev / Next buttons ---- */

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  transition: opacity 0.15s;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-prev svg,
.lightbox-next svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lightbox-prev[aria-hidden="true"],
.lightbox-next[aria-hidden="true"] {
  visibility: hidden;
}

/* ---- Content ---- */

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 80vw;
  padding: 60px 80px;
}

.lightbox-img {
  max-height: 75vh;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  font-size: 11px;
  color: var(--color-text-sub);
  text-align: center;
  letter-spacing: 0.04em;
  line-height: 1.7;
  min-height: 1em;
}

/* ============================================================
   RESPONSIVE — Tablet (769px–1024px)
   ============================================================ */

@media (min-width: 769px) and (max-width: 1024px) {
  .works-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — Mobile (≤768px)
   ============================================================ */

@media (max-width: 768px) {
  .works-main {
    padding: 36px 16px 48px;
  }

  .works-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}
