.work-detail {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-bottom: 6rem;
}

.work-header-img {
  aspect-ratio: 16 / 9;
  background: var(--color-border);
  margin-bottom: 3rem;
  overflow: hidden;
}

.work-header-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-gallery {
  padding: 3rem 2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.work-gallery img {
  height: 320px;
  flex-grow: 1;
  flex-shrink: 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
  /* flex-basis is set by JS based on natural aspect ratio */
}

.work-gallery img:hover {
  opacity: 0.7;
}

.work-body {
  padding: 0 2rem;
  max-width: 720px;
}

.work-category {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--color-muted);
  margin-bottom: 0.75rem;
}

.work-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.work-meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
}

.work-description p {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--color-text);
}

.work-description p + p {
  margin-top: 1.5em;
}

/* header内のサイトタイトルをリンク化 */
.site-title a {
  text-decoration: none;
  color: inherit;
}

/* ── Lightbox ── */
#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

#lb-overlay.active {
  display: flex;
}

#lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

#lb-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#lb-close:hover { opacity: 1; }

#lb-prev,
#lb-next {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

#lb-prev:hover,
#lb-next:hover { opacity: 1; }

#lb-prev:focus,
#lb-next:focus { outline: none; }

@media (max-width: 768px) {
  .work-body {
    padding: 0 1.25rem;
  }

  .work-title {
    font-size: 1.375rem;
  }
}
