/* ===========================
 * ギャラリー / アルバム
 * =========================== */

/* ------- アーカイブ: アルバム一覧 ------- */
.album-archive {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 24px;
}

.album-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.35s ease,
              border-color 0.25s ease;
  box-shadow: var(--shadow-card);
}

.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.album-card__cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f2f5, #e5e8ec);
}

.album-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.album-card:hover .album-card__cover img {
  transform: scale(1.06);
}

.album-card__cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: rgba(13, 33, 55, 0.25);
}

.album-card__cover-placeholder svg {
  width: 56px;
  height: 56px;
}

.album-card__count {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(13, 33, 55, 0.82);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 100px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.album-card__body {
  padding: 18px 20px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.album-card__date {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.album-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.5;
  margin: 0 0 8px;
  transition: color 0.2s ease;
}

.album-card:hover .album-card__title {
  color: var(--color-secondary);
}

.album-card__excerpt {
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin: 0;
}

/* 空状態 */
.album-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--color-text-light);
}

.album-empty svg {
  color: rgba(13, 33, 55, 0.15);
  margin-bottom: 16px;
}

.album-empty p {
  font-size: 0.95rem;
  margin: 8px 0;
}

/* ------- シングル: アルバム詳細 ------- */
.album-single {
  padding: 60px 0 80px;
}

.album-single__date {
  display: block;
  margin-top: 12px;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.08em;
}

.album-single__description {
  max-width: 760px;
  margin: 0 auto 48px;
  padding: 0 12px;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--color-text);
}

.album-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 56px;
}

.album-photos__item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: none;
  padding: 0;
  background: #f0f2f5;
  cursor: zoom-in;
  border-radius: 4px;
}

.album-photos__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              filter 0.3s ease;
}

.album-photos__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.35) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.album-photos__item:hover img {
  transform: scale(1.08);
}

.album-photos__item:hover::after {
  opacity: 1;
}

.album-photos__item:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.album-single__back {
  text-align: center;
  margin-top: 40px;
}

/* ------- ライトボックス ------- */
.album-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.96);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.album-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.album-lightbox__stage {
  position: relative;
  max-width: min(1200px, calc(100vw - 120px));
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  display: block;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.album-lightbox__img.is-loaded {
  opacity: 1;
  transform: scale(1);
}

/* ナビボタン */
.album-lightbox__nav,
.album-lightbox__close {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.album-lightbox__nav svg,
.album-lightbox__close svg {
  width: 24px;
  height: 24px;
}

.album-lightbox__nav:hover,
.album-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.album-lightbox__nav:active {
  transform: scale(0.92);
}

.album-lightbox__nav--prev { left: 24px; top: 50%; transform: translateY(-50%); }
.album-lightbox__nav--next { right: 24px; top: 50%; transform: translateY(-50%); }
.album-lightbox__nav--prev:active { transform: translateY(-50%) scale(0.92); }
.album-lightbox__nav--next:active { transform: translateY(-50%) scale(0.92); }

.album-lightbox__close { top: 24px; right: 24px; }

.album-lightbox__meta {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  border-radius: 100px;
  font-size: 0.82rem;
  max-width: calc(100vw - 48px);
  pointer-events: none;
}

.album-lightbox__counter {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.album-lightbox__caption {
  color: rgba(255, 255, 255, 0.85);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-lightbox__caption:empty {
  display: none;
}

body.album-lightbox-open {
  overflow: hidden;
}

/* ------- レスポンシブ ------- */
@media (max-width: 900px) {
  .album-archive {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .album-photos {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .album-lightbox__nav { width: 42px; height: 42px; }
  .album-lightbox__nav--prev { left: 12px; }
  .album-lightbox__nav--next { right: 12px; }
  .album-lightbox__close { top: 12px; right: 12px; width: 42px; height: 42px; }
  .album-lightbox__stage {
    max-width: calc(100vw - 24px);
  }
}

@media (max-width: 560px) {
  .album-archive {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .album-card__body {
    padding: 14px 16px 18px;
  }

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

  .album-single {
    padding: 40px 0 60px;
  }

  .album-lightbox__meta {
    bottom: 12px;
    font-size: 0.75rem;
    padding: 8px 14px;
  }
}
