.photo-gallery-page {
  background: #ffffff;
}

.photo-gallery-page.is-lightbox-open {
  overflow: hidden;
}

.photo-gallery-main {
  min-height: 100vh;
}

.photo-gallery-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(96px, 10vw, 138px) 24px clamp(62px, 7vw, 88px);
  background:
    linear-gradient(115deg, rgba(245, 246, 248, 0.96), rgba(255, 255, 255, 0.98) 62%),
    #ffffff;
}

.photo-gallery-hero::before {
  position: absolute;
  top: clamp(64px, 8vw, 102px);
  left: max(24px, calc((100vw - 1120px) / 2));
  width: 58px;
  height: 3px;
  content: "";
  background: var(--color-red-muted);
}

.photo-gallery-hero-deco {
  position: absolute;
  right: -72px;
  bottom: -76px;
  width: min(42vw, 520px);
  height: 220px;
  opacity: 0.065;
  background: repeating-linear-gradient(-45deg, var(--color-blue-dark) 0 8px, transparent 8px 20px);
  pointer-events: none;
}

.photo-gallery-hero .section-label {
  margin-top: 22px;
}

.photo-gallery-hero h1 {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Noto Sans JP", sans-serif;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.2;
}

.photo-gallery-content {
  position: relative;
  padding: 0 0 clamp(84px, 9vw, 128px);
  background: #ffffff;
}

.photo-gallery-content::before {
  display: none;
}

.photo-gallery-toolbar {
  position: sticky;
  top: 66px;
  z-index: 8;
  padding: 16px max(24px, calc((100vw - 1320px) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(230, 232, 240, 0.78);
  border-bottom: 1px solid var(--color-line);
  backdrop-filter: blur(14px);
}

.photo-gallery-filters {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 0 7px;
  scrollbar-color: rgba(24, 32, 96, 0.26) transparent;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.photo-gallery-filter {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 17px;
  color: var(--color-gray-deep);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid #d9dce5;
  border-radius: 0;
  cursor: pointer;
  scroll-snap-align: start;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-gallery-filter:hover,
.photo-gallery-filter:focus-visible {
  color: var(--color-blue-dark);
  border-color: rgba(24, 32, 96, 0.5);
  box-shadow: inset 0 -3px 0 var(--color-red-muted);
}

.photo-gallery-filter.is-active {
  color: #ffffff;
  background: var(--color-blue-dark);
  border-color: var(--color-blue-dark);
  box-shadow: inset 0 -3px 0 var(--color-red-muted);
}

.photo-gallery-inner {
  width: min(1320px, calc(100% - 48px));
  margin: clamp(30px, 4vw, 54px) auto 0;
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.photo-gallery-main.is-filtering .photo-gallery-grid {
  opacity: 0;
  transform: translateY(6px);
}

.photo-gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  background: var(--color-gray-soft);
  border: 0;
  border-radius: 0;
  cursor: zoom-in;
}

.photo-gallery-item::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 -54px 50px -48px rgba(17, 19, 28, 0.48);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.24s ease, transform 0.55s cubic-bezier(.22, .61, .36, 1), filter 0.35s ease;
}

.photo-gallery-item img.is-loaded {
  opacity: 1;
}

.photo-gallery-item-label {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 9px;
  left: 12px;
  overflow: hidden;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.photo-gallery-item:hover img,
.photo-gallery-item:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.04) contrast(1.02);
}

.photo-gallery-item:hover::after,
.photo-gallery-item:focus-visible::after,
.photo-gallery-item:hover .photo-gallery-item-label,
.photo-gallery-item:focus-visible .photo-gallery-item-label {
  opacity: 1;
}

.photo-gallery-item:hover .photo-gallery-item-label,
.photo-gallery-item:focus-visible .photo-gallery-item-label {
  transform: translateY(0);
}

.photo-gallery-item:focus-visible {
  outline: 3px solid var(--color-red-muted);
  outline-offset: 3px;
}

.photo-gallery-status,
.photo-gallery-error {
  margin: 34px 0 0;
  color: var(--color-subtext);
  text-align: center;
}

.photo-gallery-status:empty {
  display: none;
}

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

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.photo-lightbox.is-open {
  opacity: 1;
}

.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 19, 0.91);
  backdrop-filter: blur(7px);
}

.photo-lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1500px, 100%);
  height: min(90vh, 960px);
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  transform: scale(0.985);
  transition: transform 0.28s cubic-bezier(.22, .61, .36, 1);
}

.photo-lightbox.is-open .photo-lightbox-dialog {
  transform: scale(1);
}

.photo-lightbox-figure {
  display: grid;
  min-width: 0;
  max-height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  justify-items: center;
  margin: 0;
}

.photo-lightbox-figure img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(90vh - 64px);
  object-fit: contain;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.photo-lightbox-figure figcaption {
  min-height: 24px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.photo-lightbox-close,
.photo-lightbox-arrow {
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.photo-lightbox-close:hover,
.photo-lightbox-close:focus-visible,
.photo-lightbox-arrow:hover,
.photo-lightbox-arrow:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

.photo-lightbox-close {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 2;
  width: 48px;
  height: 48px;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.photo-lightbox-arrow {
  width: 58px;
  height: 72px;
  justify-self: center;
  font-size: 54px;
  font-weight: 300;
  line-height: 1;
}

.photo-lightbox-arrow--prev:hover,
.photo-lightbox-arrow--prev:focus-visible {
  transform: translateX(-3px);
}

.photo-lightbox-arrow--next:hover,
.photo-lightbox-arrow--next:focus-visible {
  transform: translateX(3px);
}

.photo-lightbox-arrow:disabled {
  visibility: hidden;
}

@media (max-width: 1040px) {
  .photo-gallery-toolbar {
    top: 62px;
  }

  .photo-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .photo-gallery-hero {
    padding: 78px 20px 54px;
  }

  .photo-gallery-hero::before {
    top: 63px;
    left: 20px;
    width: 44px;
  }

  .photo-gallery-hero .section-label {
    margin-top: 15px;
  }

  .photo-gallery-toolbar {
    padding: 12px 0 10px;
  }

  .photo-gallery-filters {
    gap: 7px;
    padding: 2px 20px 7px;
    scroll-padding-inline: 20px;
  }

  .photo-gallery-filter {
    min-height: 40px;
    padding: 0 14px;
    font-size: 12px;
  }

  .photo-gallery-inner {
    width: calc(100% - 24px);
    margin-top: 24px;
  }

  .photo-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .photo-gallery-item-label {
    display: none;
  }

  .photo-lightbox {
    padding: 12px;
  }

  .photo-lightbox-dialog {
    width: 100%;
    height: 100%;
    grid-template-columns: 1fr;
  }

  .photo-lightbox-figure img {
    max-height: calc(100vh - 110px);
  }

  .photo-lightbox-arrow {
    position: fixed;
    top: 50%;
    z-index: 2;
    width: 46px;
    height: 68px;
    font-size: 44px;
    background: rgba(10, 12, 19, 0.36);
    transform: translateY(-50%);
  }

  .photo-lightbox-arrow--prev {
    left: 4px;
  }

  .photo-lightbox-arrow--next {
    right: 4px;
  }

  .photo-lightbox-arrow--prev:hover,
  .photo-lightbox-arrow--prev:focus-visible,
  .photo-lightbox-arrow--next:hover,
  .photo-lightbox-arrow--next:focus-visible {
    transform: translateY(-50%);
  }

  .photo-lightbox-close {
    top: 8px;
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-gallery-grid,
  .photo-gallery-item,
  .photo-gallery-item img,
  .photo-lightbox,
  .photo-lightbox-dialog {
    animation: none;
    transition: none;
  }
}
