/* ========================================
   Story Page
======================================== */

.story-page {
  width: 100%;
  overflow-x: clip;
}


/* ========================================
   Story Hero
======================================== */

.story-hero {
  position: relative;
  isolation: isolate;

  width: 100%;
  height: 43.75rem;

  overflow: hidden;

  background-color: #111;
}


/* ========================================
   Background Image
======================================== */

.story-hero-image {
  position: absolute;
  z-index: 0;
  inset: 0;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  opacity: 0;

  transform: scale(1.08);
  transform-origin: center center;

  will-change:
    opacity,
    transform;
}


/* ========================================
   Overlay
======================================== */

.story-hero-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;

  display: block;

  background:
    linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.05) 0%,
      rgba(0, 0, 0, 0.15) 45%,
      rgba(0, 0, 0, 0.52) 100%
    );

  pointer-events: none;
}


/* ========================================
   Inner
======================================== */

.story-hero-inner {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: flex-end;

  width: min(
    calc(100% - 2.5rem),
    91.25rem
  );

  height: 100%;

  margin: 0 auto;
}


/* ========================================
   Content
======================================== */

.story-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2.75rem;

  width: 100%;
  max-width: 31.25rem;

  color: #fff;

  text-align: right;
}


/* ========================================
   Text
======================================== */

.story-hero-text {
  margin: 0;

  color: rgba(255, 255, 255, 0.95);

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.8;

  letter-spacing: -0.02em;
  word-break: keep-all;

  opacity: 0;

  transform:
    translate3d(0, 1.5rem, 0);

  will-change:
    opacity,
    transform,
    filter;
}



/* section02 */
.story-gallery {
  position: relative;

  width: 100%;

  padding-top: 7.5rem;
  padding-bottom: 7.5rem;

  overflow: hidden;

  background-color: #fff;
}

.story-gallery-inner {
  width: min(
    calc(100% - 2.5rem),
    91.25rem
  );

  margin: 0 auto;
}


/* ========================================
   Intro
======================================== */

.story-gallery-intro {
  display: grid;

  grid-template-columns:
    minmax(20rem, 0.8fr)
    auto
    minmax(30rem, 1.2fr);

  align-items: center;
  gap: 3rem;

  margin-bottom: 3.75rem;
}


/* ========================================
   Heading
======================================== */

.story-gallery-heading {
  text-align: center;
}

.story-gallery-title {
  margin: 0;

  color: #111;

  font-family:
    var(
      --font-yuji-syuku,
      "Yuji Syuku"
    ),
    serif;

  font-size: 5.625rem;
  font-weight: 400;
  line-height: 1;
}

.story-gallery-subtitle {
  margin: 1.25rem 0 0;

  color: #111;

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
}


/* ========================================
   Intro Divider
======================================== */

.story-gallery-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;

  height: 11.25rem;
}

.story-gallery-divider-line {
  display: block;
  flex: 1;

  width: 0.0625rem;

  background-color:
    rgba(51, 51, 51, 0.5);
}

.story-gallery-divider-symbol {
  display: block;

  width: 0.75rem;
  height: 0.75rem;

  object-fit: contain;
}


/* ========================================
   Introduction
======================================== */

.story-gallery-introduction {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;

  color: #333;

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 1rem;
  font-weight: 400;
  line-height: 1.8;

  word-break: keep-all;
}

.story-gallery-introduction p {
  margin: 0;
}


/* ========================================
   Tabs
======================================== */

.story-gallery-tabs {
  display: grid;

  grid-template-columns:
    repeat(7, minmax(0, 1fr));

  width: 100%;

  margin-bottom: 1.25rem;
}

.story-gallery-tab {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 3.125rem;

  padding:
    0.75rem
    0.625rem;

  color: #737373;

  background-color: transparent;

  border: 0;

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 0.9375rem;
  font-weight: 400;

  white-space: nowrap;

  cursor: pointer;

  transition:
    color 0.3s ease,
    background-color 0.3s ease;
}

.story-gallery-tab:hover {
  color: #333;

  background-color: transparent;
}

.story-gallery-tab.is-active {
  color: #e4e4e4;

  background-color: #333;
}


/* ========================================
   Panels
======================================== */

.story-gallery-panels {
  position: relative;

  width: 100%;
}

.story-gallery-panel {
  display: none;

  width: 100%;
}

.story-gallery-panel.is-active {
  display: block;
}


/* ========================================
   Artwork Image
======================================== */

.story-gallery-image {
  display: block;

  width: 100%;
  height: 26.25rem;

  object-fit: cover;
  object-position: center;
}


/* ========================================
   Description
======================================== */

.story-gallery-description {
  padding:
    1.875rem
    1.25rem
    0;

  color: #333;

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 1rem;
  font-weight: 400;
  line-height: 1.8;

  word-break: keep-all;
}

.story-gallery-description p {
  margin: 0;
}

.story-gallery-description p + p {
  margin-top: 0.5rem;
}


/* section03 */
.story-quote {
  position: relative;
  isolation: isolate;

  width: 100%;
  height: 43.75rem;

  overflow: hidden;

  background-color: #222;
}


/* ========================================
   Background Image
======================================== */

.story-quote-image {
  position: absolute;
  z-index: 0;
  inset: 0;

  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  transform: scale(1.02);

  will-change: transform;
}


/* ========================================
   Overlay
======================================== */

.story-quote-overlay {
  position: absolute;
  z-index: 1;
  inset: 0;

  display: block;

  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.32) 0%,
      rgba(0, 0, 0, 0.44) 55%,
      rgba(0, 0, 0, 0.58) 100%
    );

  pointer-events: none;
}


/* ========================================
   Inner
======================================== */

.story-quote-inner {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: center;

  width: min(
    calc(100% - 2.5rem),
    91.25rem
  );

  height: 100%;

  margin: 0 auto;
}


/* ========================================
   Quote Content
======================================== */

.story-quote-content {
  width: 100%;

  margin: 0;

  text-align: center;
}


/* ========================================
   Quote Text
======================================== */

.story-quote-text {
  margin: 0;

  color: #fff;

  font-family:
    var(
      --font-shilla-culture,
      var(--font-shilla, "Shilla")
    ),
    serif;

  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.6;

  letter-spacing: -0.02em;

  text-align: center;

  word-break: keep-all;

  will-change:
    opacity,
    transform,
    filter;
}


/* section04  */
.story-space {
  position: relative;

  width: 100%;

  padding-top: 7.5rem;
  padding-bottom: 7.5rem;

  overflow: hidden;

  background-color: #f7f6f3;

  background-image:
    url("../../images/story/space/space-background.webp");

  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}


.story-space-inner {
  width: min(
    calc(100% - 2.5rem),
    91.25rem
  );

  margin: 0 auto;
}


/* ========================================
   Heading
======================================== */

.story-space-heading {
  margin-bottom: 4rem;

  text-align: center;
}


.story-space-title {
  margin: 0;

  color: #111;

  font-family:
    var(
      --font-shilla-culture,
      var(--font-shilla, "Shilla")
    ),
    serif;

  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.45;

  letter-spacing: -0.02em;

  word-break: keep-all;

  will-change:
    opacity,
    transform,
    filter;
}

/* 한자만 별도 폰트 적용 */
.story-space-title-hanja {
  font-family:
    var(--font-yuji-syuku),
    serif;

  font-weight: 400;
}


.story-space-description {
  margin: 1.5rem 0 0;

  color: #737373;

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.65;

  word-break: keep-all;

  will-change:
    opacity,
    transform,
    filter;
}


/* ========================================
   Swiper
======================================== */

.story-space-carousel.swiper {
  width: 100%;

  overflow: hidden;
}


.story-space-list.swiper-wrapper {
  display: flex;

  width: 100%;
}


.story-space-slide.swiper-slide {
  flex-shrink: 0;

  height: auto;

  overflow: hidden;

  background-color: #eee;
}


/* ========================================
   Image
======================================== */

.story-space-image {
  display: block;

  width: 100%;
  height: 23.75rem;

  object-fit: cover;
  object-position: center;

  transform: scale(1);

  transition:
    transform 1.2s ease;

  will-change: transform;
}


/*
 * 현재 활성 영역의 이미지를
 * 아주 미세하게 확대하여
 * 정적인 느낌을 줄입니다.
 */
.story-space-slide.swiper-slide-active
.story-space-image {
  transform: scale(1.025);
}


/* ========================================
   Progress
======================================== */

.story-space-progress {
  display: flex;
  align-items: center;
  gap: 1rem;

  width: 70%;

  margin:
    2.5rem
    auto
    0;

  color: #333;

  font-family:
    var(
      --font-noto-serif-kr,
      "Noto Serif KR"
    ),
    serif;

  font-size: 0.875rem;
  line-height: 1;
}


.story-space-current,
.story-space-total {
  flex: 0 0 auto;

  min-width: 2rem;
}


.story-space-total {
  text-align: right;
}


/* ========================================
   Progress Track
======================================== */

.story-space-progress-track {
  position: relative;

  flex: 1;

  height: 1.75rem;
}


.story-space-progress-line {
  position: absolute;

  top: 50%;
  right: 0;
  left: 0;

  display: block;

  height: 0.0625rem;

  background-color:
    rgba(51, 51, 51, 0.45);

  transform:
    translateY(-50%);
}


/* ========================================
   Progress Thumb
======================================== */

.story-space-progress-thumb {
  position: absolute;

  top: 50%;
  left: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 1.75rem;
  height: 1.75rem;

  background-color: #f7f6f3;

  transform:
    translate3d(0, -50%, 0);

  will-change: transform;
}


.story-space-progress-symbol {
  display: block;

  width: 0.875rem;
  height: 0.875rem;

  object-fit: contain;
}



/* ========================================
   Tablet
======================================== */

@media (
  min-width: 48rem
) and (
  max-width: 64rem
) {

  .story-hero {
    height: 37.5rem;
  }

  .story-hero-inner {
    width:
      calc(100% - 2.5rem);
  }

  .story-hero-content {
    max-width: 25rem;
    gap: 2rem;
  }

  .story-hero-text {
    font-size: 1.125rem;
    line-height: 1.75;
  }

  /* section02 */
  .story-gallery {
    padding-top: 6.25rem;
    padding-bottom: 6.25rem;
  }

  .story-gallery-inner {
    width:
      calc(100% - 2.5rem);
  }

  .story-gallery-intro {
    grid-template-columns:
      minmax(15rem, 0.7fr)
      auto
      minmax(24rem, 1.3fr);

    gap: 2rem;

    margin-bottom: 3rem;
  }

  .story-gallery-title {
    font-size: 4.5rem;
  }

  .story-gallery-subtitle {
    margin-top: 1rem;

    font-size: 1.25rem;
  }

  .story-gallery-divider {
    height: 9.375rem;
  }

  .story-gallery-introduction {
    gap: 1.5rem;

    font-size: 0.875rem;
  }

  .story-gallery-tabs {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
  }

  .story-gallery-tab {
    font-size: 0.875rem;
  }

  .story-gallery-image {
    height: 23.75rem;
  }

  .story-gallery-description {
    font-size: 0.875rem;
  }


  /* section03 */
  .story-quote {
    height: 37.5rem;
  }

  .story-quote-inner {
    width:
      calc(100% - 2.5rem);
  }

  .story-quote-text {
    font-size: 2rem;
  }


  /* section04 */
  .story-space {
    padding-top: 6.25rem;
    padding-bottom: 6.25rem;
  }


  .story-space-inner {
    width:
      calc(100% - 2.5rem);
  }


  .story-space-heading {
    margin-bottom: 3rem;
  }


  .story-space-title {
    font-size: 2rem;
  }


  .story-space-description {
    margin-top: 1.25rem;

    font-size: 1rem;
  }


  .story-space-image {
    height: 22.5rem;
  }


  .story-space-progress {
    width: 80%;

    margin-top: 2rem;
  }
}


/* ========================================
   Mobile
======================================== */

@media (max-width: 47.9375rem) {

  .story-hero {
    /*
     * 기존 100svh 삭제
     * 모바일에서 너무 긴 이미지 방지
     */
    height: 31.25rem;
    min-height: 0;
  }

  .story-hero-image {
    /*
     * PC와 같은 구도를 유지하되
     * 모바일 화면에서 달항아리가 너무 잘리지 않도록 조절
     */
    object-position: 45% center;
  }

  .story-hero-overlay {
    /*
     * PC와 동일하게 오른쪽 텍스트 가독성 확보
     */
    background:
      linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.08) 0%,
        rgba(0, 0, 0, 0.22) 45%,
        rgba(0, 0, 0, 0.62) 100%
      );
  }

  .story-hero-inner {
    /*
     * PC와 동일:
     * 세로 중앙 / 우측 정렬
     */
    align-items: center;
    justify-content: flex-end;

    width:
      calc(100% - 2.5rem);

    height: 100%;

    padding: 0;
  }

  .story-hero-content {
    /*
     * PC와 동일하게 오른쪽 정렬
     */
    align-items: flex-end;

    width: 65%;
    max-width: 18.75rem;

    gap: 1.5rem;

    text-align: right;
  }

  .story-hero-text {
    font-size: 0.875rem;
    line-height: 1.7;
  }

  /* section02 */
  .story-gallery {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }

  .story-gallery-inner {
    width:
      calc(100% - 2.5rem);
  }


  /* Intro */

  .story-gallery-intro {
    display: block;

    margin-bottom: 2.5rem;

    text-align: center;
  }

  .story-gallery-heading {
    text-align: center;
  }

  .story-gallery-title {
    font-size: 3rem;
  }

  .story-gallery-subtitle {
    margin-top: 0.5rem;

    font-size: 0.75rem;
  }


  /*
   * 모바일에서는 세로 구분선을 숨깁니다.
   */
  .story-gallery-divider {
    display: none;
  }


  .story-gallery-introduction {
    gap: 0.875rem;

    margin-top: 1.5rem;

    font-size: 0.6875rem;
    line-height: 1.6;

    text-align: center;
  }


  /* Tabs */

  .story-gallery-tabs {
    display: grid;

    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    gap: 0.25rem;

    margin-bottom: 1rem;
  }

  .story-gallery-tab {
    justify-content: flex-start;

    min-height: 1.875rem;

    padding:
      0.375rem
      0.5rem;

    font-size: 0.625rem;

    text-align: left;
  }

  .story-gallery-tab:last-child {
    grid-column: 1 / 2;
  }


  /* Artwork */

  .story-gallery-image {
    width: 100%;
    height: 13.75rem;

    object-fit: cover;
  }


  /* Description */

  .story-gallery-description {
    padding:
      1rem
      0
      0;

    font-size: 0.6875rem;
    line-height: 1.65;
  }

  .story-gallery-description p + p {
    margin-top: 0.5rem;
  }

  /* section03 */
  .story-quote {
    height: 31.25rem;
  }

  .story-quote-image {
    object-position: center;
  }

  .story-quote-inner {
    width:
      calc(100% - 2.5rem);
  }

  .story-quote-content {
    max-width: 20rem;
  }

  .story-quote-text {
    font-size: 1.5rem;
    line-height: 1.55;
  }

  /* section04 */
  .story-space {
    padding-top: 5rem;
    padding-bottom: 5rem;
  }


  .story-space-inner {
    width:
      calc(100% - 2.5rem);
  }


  .story-space-heading {
    margin-bottom: 2.5rem;
  }


  .story-space-title {
    font-size: 1.5rem;
    line-height: 1.45;
  }


  .story-space-description {
    margin-top: 1rem;

    font-size: 0.875rem;
    line-height: 1.6;
  }


  .story-space-image {
    height: 22.5rem;
  }


  .story-space-progress {
    width: 100%;

    gap: 0.75rem;

    margin-top: 1.75rem;

    font-size: 0.75rem;
  }


  .story-space-progress-track {
    height: 1.5rem;
  }


  .story-space-progress-thumb {
    width: 1.5rem;
    height: 1.5rem;
  }


  .story-space-progress-symbol {
    width: 0.75rem;
    height: 0.75rem;
  }
  
}


/* ========================================
   Small Mobile
======================================== */

@media (max-width: 30rem) {

  .story-hero {
    height: 28.125rem;
  }

  .story-hero-content {
    width: 68%;
    max-width: 16.25rem;

    gap: 1.25rem;
  }

  .story-hero-text {
    font-size: 0.8125rem;
    line-height: 1.65;
  }

  /* section02 */
  .story-gallery-title {
    font-size: 2.75rem;
  }

  .story-gallery-image {
    height: 12.5rem;
  }

  /* section03 */
  .story-quote {
    height: 28.125rem;
  }

  .story-quote-content {
    max-width: 18rem;
  }

  .story-quote-text {
    font-size: 1.375rem;
  }

  /* section04 */
  .story-space-image {
    height: 20rem;
  }
}


/* ========================================
   Reduced Motion
======================================== */

@media (prefers-reduced-motion: reduce) {

  .story-hero-image,
  .story-hero-text {
    opacity: 1 !important;

    filter: none !important;
    transform: none !important;

    animation: none !important;
    transition: none !important;
  }

  /* section02 */
  .story-gallery-intro,
  .story-gallery-panel {
    opacity: 1 !important;

    transform: none !important;
    filter: none !important;

    animation: none !important;
    transition: none !important;
  }

  /* section03 */
  .story-quote-text,
  .story-quote-image {
    opacity: 1 !important;

    filter: none !important;
    transform: none !important;

    animation: none !important;
    transition: none !important;
  }

  /* section04 */
  
}