@charset "UTF-8";

.p-gallery-archive {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.p-gallery-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: inherit;
  font: inherit;
  background: #000;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition:
    border-color 0.3s ease,
    filter 0.3s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    aspect-ratio: 16 / 9;
}

.p-gallery-card:hover {
  border-color: rgba(255, 255, 255, 0.42);
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.12));
  transform: translateY(-5px);
}

.p-gallery-card__image {
  position: relative;
  overflow: hidden;
}

.p-gallery-card__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.p-gallery-card:hover .p-gallery-card__image img {
  transform: scale(1.04);
}

.p-gallery-card__body {
  padding: 18px 20px 20px;
}

.p-gallery-card__title {
  margin: 0 0 14px;
  color: #fff;
  font-family: serif;
  font-size: 1.8rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.p-gallery-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 1.2rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
}

.p-gallery-card__meta span,
.p-gallery-card__meta time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.p-gallery-card__meta span::before,
.p-gallery-card__meta time::before {
  content: "";
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.62);
  transform: rotate(45deg);
}

.p-gallery-modal {
  width: min(100% - 40px, 1040px);
  max-height: min(90vh, 900px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.92)),
    url("../img/bg-pattern.webp") center / 800px repeat,
    #000;
  overflow: hidden;
  opacity: 0;
  transform: translate3d(0, 24px, 0) scale(0.965);
  transform-origin: center center;
}

.p-gallery-modal::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(7px);
  opacity: 0;
}

.p-gallery-modal[open] {
  animation: galleryModalIn 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.p-gallery-modal[open]::backdrop {
  animation: galleryModalBackdropIn 0.72s ease forwards;
}

.p-gallery-modal[open].is-closing {
  animation: galleryModalOut 0.34s ease forwards;
}

.p-gallery-modal[open].is-closing::backdrop {
  animation: galleryModalBackdropOut 0.34s ease forwards;
}

.p-gallery-modal__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  max-height: min(90vh, 900px);
}

.p-gallery-modal__image {
  display: grid;
  place-items: center;
  min-height: 420px;
  background: #020202;
}

.p-gallery-modal__image img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.985);
}

.p-gallery-modal[open]:not(.is-closing) .p-gallery-modal__image img {
  animation: galleryModalImageIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.12s forwards;
}

.p-gallery-modal__body {
  padding: 34px 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.p-gallery-modal__body > * {
  opacity: 0;
  transform: translate3d(-26px, 0, 0);
}

.p-gallery-modal[open]:not(.is-closing) .p-gallery-modal__body > * {
  animation: galleryModalDetailIn 0.68s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.p-gallery-modal[open]:not(.is-closing) .p-gallery-modal__meta {
  animation-delay: 0.62s;
}

.p-gallery-modal__title {
  margin: 0 0 22px;
  color: #fff;
  font-family: serif;
  font-size: 2.4rem;
  line-height: 1.45;
  letter-spacing: 0.08em;
}

.p-gallery-modal__meta {
  display: grid;
  gap: 14px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 1.3rem;
  line-height: 1.7;
  letter-spacing: 0.08em;
}

.p-gallery-modal__meta dt {
  color: rgba(255, 255, 255, 0.42);
  font-family: "Giflika", serif;
  font-size: 1.1rem;
  letter-spacing: 0.16em;
}

.p-gallery-modal__meta dd {
  margin: 2px 0 0;
}

.p-gallery-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.p-gallery-modal__close::before,
.p-gallery-modal__close::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 1px;
  background: currentColor;
}

.p-gallery-modal__close::before {
  transform: rotate(45deg);
}

.p-gallery-modal__close::after {
  transform: rotate(-45deg);
}

@keyframes galleryModalIn {
  0% {
    opacity: 0;
    transform: translate3d(0, 24px, 0) scale(0.965);
    filter: blur(10px);
  }

  56% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.006);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes galleryModalOut {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.975);
  }
}

@keyframes galleryModalBackdropIn {
  0% {
    opacity: 0;
    backdrop-filter: blur(0);
  }

  100% {
    opacity: 1;
    backdrop-filter: blur(7px);
  }
}

@keyframes galleryModalBackdropOut {
  0% {
    opacity: 1;
    backdrop-filter: blur(7px);
  }

  100% {
    opacity: 0;
    backdrop-filter: blur(0);
  }
}

@keyframes galleryModalImageIn {
  0% {
    opacity: 0;
    transform: scale(0.985);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes galleryModalDetailIn {
  0% {
    opacity: 0;
    transform: translate3d(-26px, 0, 0);
    filter: blur(6px);
  }

  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .p-gallery-modal[open],
  .p-gallery-modal[open]::backdrop,
  .p-gallery-modal[open].is-closing,
  .p-gallery-modal[open].is-closing::backdrop,
  .p-gallery-modal[open]:not(.is-closing) .p-gallery-modal__image img,
  .p-gallery-modal[open]:not(.is-closing) .p-gallery-modal__body > * {
    animation-duration: 1ms;
    animation-delay: 1ms;
  }
}

@media screen and (max-width: 1024px) {
  .p-gallery-archive {
    grid-template-columns: repeat(2, 1fr);
  }

  .p-gallery-modal__inner {
    grid-template-columns: 1fr;
  }

  .p-gallery-modal__body {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 0;
  }
}

@media screen and (max-width: 767px) {
  .p-gallery-archive {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .p-gallery-card__body {
    padding: 16px 18px 18px;
  }

  .p-gallery-modal {
    width: calc(100% - 24px);
  }

  .p-gallery-modal__image {
    min-height: 260px;
  }

  .p-gallery-modal__body {
    padding: 24px 20px;
  }
}
