/* ========================================
   6. ITEM MEMORY PARK
======================================== */

.memory-park {
  max-width: 1100px;
  margin: 70px auto 0;
  padding: 0 10px;
}

.memory-park__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 40px;
}

@media (max-width: 1024px) {
  .memory-park__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .memory-park__grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 0 1rem;
  }
}

@media (max-width: 480px) {
  .memory-park__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .memory-card__info {
    display: none;
  }
}

/* 메모리 헤드 */
.memory-park__header {
  margin: 30px auto;
  padding-top: 30px;
}

.memory-park__header .memory-park__label {
  font-size: 16px;
  letter-spacing: 0.25rem;
  color: #888;
  font-style: italic;
}

.memory-park__des-box {
  padding: 1rem 0.5rem;
  border: 1px solid #333;
  margin-top: 15px;
}

.memory-park__des {
  font-size: 15px;
  color: #333;
  text-align: center;
}

.memory-park__count {
  text-align: right;
  margin-bottom: 1rem;
  color: #888;
}
.memory-count {
}

/* 메모리 카드 */

.memory-card {
  min-width: 0;
  height: auto;
  box-sizing: border-box;

  border: 1px solid #111;
}

/* 이미지 */

.memory-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;

  background-color: #739b73;
}

.memory-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;

  transition: transform 0.5s ease;
  opacity: 0.8;
}

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

/* 카드 정보 */

.memory-card__info {
  padding: 1rem;
  background-color: #fff;
}

.memory-card__info > span {
  display: block;
  margin-bottom: 6px;

  color: #739b73;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.memory-card__info h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.memory-card__info p {
  margin: 0 0 8px;

  color: #333;
  font-size: 1rem;
  line-height: 1.8;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;

  line-height: 1.6;
  min-height: calc(1em * 1.6 * 3);
}

.memory-card__info small {
  /* opacity: 0.5; */
}

/* ========================================
   MEMORY MODAL
======================================== */

.memory-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 24px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.memory-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 배경 */

.memory-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(115 155 115 / 35%);
  backdrop-filter: blur(5px);
}

/* 모달 본체 */

.memory-modal__content {
  position: relative;
  z-index: 1;

  display: grid;
  grid-template-columns: 1fr 1fr;

  width: 100%;
  max-width: 850px;
  max-height: 85vh;

  overflow: auto;

  transform: translateY(20px);
  transition: transform 0.3s ease;

  border: 1px solid #000;
}

.memory-modal.is-open .memory-modal__content {
  transform: translateY(0);
  overflow-x: hidden;
}

@media screen and (max-width: 480px) {
  .memory-modal__content.hiude-scrollbar {
    overflow-y: scroll; /* 또는 scroll */

    /* Firefox */
    scrollbar-width: none;

    /* IE 및 구버전 Edge */
  }
  .memory-modal__content::-webkit-scrollbar {
    display: none;
  }
  .memory-modal__info span {
    font-size: 0.8rem;
  }
  .memory-modal__info .modal_wrap {
    display: flex;
    align-items: baseline;
    column-gap: 10px;
    margin: 0 0 5px !important;
  }
  .memory-modal__info small {
    margin: 0;
  }
  .memory-modal__info h2 {
    font-size: 1.5rem;
  }
}

/* 닫기 버튼 */

.memory-modal__close {
  z-index: 1;
  position: absolute;
  top: 0px;
  right: 0px;
  border: none;
  font-size: 1.35rem;
  cursor: pointer;
  border-left: 1px solid #000;
  border-bottom: 1px solid #000;
  aspect-ratio: 1 / 1;
  text-align: center;
  background: #ffffa3;
}

/* 이미지 */

.memory-modal__image {
  background: #739b73;
}

.memory-modal__image img {
  width: 100%;
  height: 100%;
  opacity: 0.8;

  display: block;
  min-height: auto;
  max-height: none;
  object-fit: cover;
}

/* 정보 */

.memory-modal__info {
  display: flex;
  flex-direction: column;
  justify-content: center;

  padding: 50px 35px;
  background: url(https://images.unsplash.com/photo-1601662528567-526cd06f6582?q=80&w=715&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=NHwxMjA3fDA%3D);
}

.memory-modal__info span {
  color: #739b73;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.memory-modal__info .modal_wrap {
  margin: 15px 0 25px;
  font-size: 1.8rem;
}

.memory-modal__info p {
  font-size: 1rem;
  line-height: 2;
  color: #555;
  white-space: pre-wrap;
}
.memory-modal__info small {
  display: block;
  margin-top: 1rem;
  color: #666;
  font-size: 0.9rem;
}

/* 모바일 */

@media (max-width: 768px) {
  .memory-park__header {
    margin: 30px 1rem;
  }
  .memory-park__count {
    padding-right: 1rem;
  }
  .memory-modal {
    padding: 15px;
  }

  .memory-modal__content {
    grid-template-columns: 1fr;
    max-width: 85%;
    max-height: 70vh;
  }

  .memory-modal.is-open {
    /* position: relative; */
  }
  .memory-modal.is-open::before {
    content: "닫아요";
    display: block;
    position: absolute;
    top: 0;
    right: 0;
  }
  .memory-modal__info {
    padding: 30px 25px;
  }
  .memory-modal__image img {
    object-fit: cover;
  }
}
.memory-card {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.memory-card:focus-visible {
  outline: 2px solid #739b73;
  outline-offset: 4px;
}

/* ========================================
   MEMORY LOADING
======================================== */

.memory-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  justify-content: center;
  align-items: center;

  /* background: rgba(255, 255, 255, 0.92); */
  background: url(https://images.unsplash.com/photo-1601662528567-526cd06f6582?q=80&w=715&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=NHwxMjA3fDA%3D);
  backdrop-filter: blur(10px);

  opacity: 1;
  visibility: visible;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

/* 로딩 완료 */

.memory-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 로딩 박스 */

.memory-loading__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;

  text-align: center;

  max-width: 250px;
}

/* 안내 문구 */

.memory-loading__box p {
  margin: 5px 0 0;

  font-size: 17px;
  font-weight: 500;
  color: #333;
}

.memory-loading__box span {
  font-size: 13px;
  color: #999;
}

@media (max-width: 480px) {
  .memory-loading__box p {
    font-size: 15px;
  }
}
