/* ============================================================
   CLEANING 喜久屋 — ストーリー詳細ページ専用 CSS (story.css)
   ============================================================ */

/* ── 下層共通・ストーリー全体レイアウト ────────────────── */
.story-detail-page {
  padding-bottom: var(--space-2xl);
}

/* イントロダクションエリア */
.story-intro-section {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-2xl);

  & .story-intro__lead {
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.04em;
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--color-line-strong);
  }
}

/* 大見出しとインタビューボタンのエリア */
.story-heading-section {
  position: relative;
  margin-bottom: var(--space-2xl);

  & .story-heading-section__title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    line-height: 1.8;
    letter-spacing: 0.04em;
    flex-grow: 1;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-line-strong);
  }

  /* 利用店舗表示（逆三角形） */
  & .story-heading-section__store {
    position: absolute;
    bottom: -10px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    aspect-ratio: 200 / 90;
    color: var(--color-text);
    flex-shrink: 0;

    & .story-heading-section__store-shape {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;

      & polygon {
        fill: transparent;
        stroke: var(--color-border-strong);
        stroke-width: 1px;
      }
    }

    & .story-heading-section__store-label {
      position: relative;
      font-size: var(--font-size-xs);
      font-weight: 700;
      line-height: 1.2;
      text-align: center;
      padding-bottom: 12px;
      /* 下向き三角形の上部に文字を寄せるための調整 */
      letter-spacing: 0.02em;
    }
  }
}

/* ── メインビジュアル ────────────────────────────── */
.story-main-visual {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  margin-bottom: var(--space-2xl);

  & img,
  video {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }
}

.story-intro {
  width: var(--container-width);
  max-width: 720px;
  margin: 0 auto var(--space-2xl) auto;
}

p.question {
  font-size: var(--font-size-sm);
  font-weight: 700;
  line-height: 2;
  margin-bottom: 0.8em;
}

p.question::before {
  content: '';
  display: inline-block;
  width: 1.8em;
  height: 1px;
  background-color: currentColor;
  vertical-align: 0.28em;
  margin-right: 0.5em;
}

p.answer {
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 2;
  margin-bottom: 1.5em;

  & span {
    font-weight: 700;
  }
}

/* ── インタビューコンテンツ（ジグザグ） ──────────────── */
.story-content-section {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  width: 100%;
  max-width: 1920px;
  margin-inline: auto;
  padding-inline: 0;
  padding-bottom: var(--space-xl);
}

.story-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;

  &.story-block--reverse {
    flex-direction: row-reverse;

    & .story-block__media {
      padding: 0 0 0 5%;
    }
  }

  & .story-block__media {
    padding: 0 5% 0 0;
    width: 50%;
    flex-shrink: 0;
    position: relative;

    & img {
      width: 100%;
      height: auto;
      object-fit: cover;
      display: block;
    }

    & video {
      width: 100%;
      height: auto;
      object-fit: cover;
      display: block;
    }
  }
}

/* テキストエリア */
& .story-block__text-content {
  width: 30%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;

  & h2 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    line-height: 1.6;
    padding-bottom: 1.5em;
  }
}

/* ── ギャラリー ────────────────────────────────── */
.story-gallery {
  width: 80%;
  max-width: 960px;
  margin: 0 auto var(--space-2xl) auto;
  padding-top: var(--space-lg);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);

  & .story-gallery__item {
    overflow: hidden;

    & img {
      width: 100%;
      height: auto;
      object-fit: cover;
      display: block;
      transition: transform 0.3s ease;
    }

    &:hover img {
      transform: scale(1.05);
    }
  }
}

.story-line {
  width: 100%;
  height: 16px;
  background-image: url(../images/story/story_line.png);
  background-size: contain;
  background-repeat: repeat-x;
  background-position: center;
  padding-inline: var(--space-md);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

/* ── プロフィール ────────────────────────────────── */
.story-profile {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--space-xl);
  text-align: center;

  & .story-profile__avatar {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: var(--space-lg);

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }


  & .story-profile__bio {
    width: 45%;
    max-width: 400px;
    min-width: 320px;
    padding-inline: var(--space-lg);
    border-left: 1px solid var(--color-border-strong);
    border-right: 1px solid var(--color-border-strong);
    font-size: var(--font-size-md);
    line-height: 1.8;
    text-align: left;

    & .story-profile__name {
      font-weight: 600;
      font-size: var(--font-size-lg);
      color: var(--color-text);
      margin-bottom: var(--space-xs);
    }

    & p {
      line-height: 1.5;
      padding-bottom: var(--space-xs);
    }
  }
}

/* ── レスポンシブ対応 (モバイル: 640px以下) ──────────────── */
@media (max-width: 640px) {
  .story-heading-section {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);

    & .story-heading-section__title {
      max-width: 100%;
      font-size: var(--font-size-base);
    }

    & .story-heading-section__btn {
      align-self: center;
    }

    & .story-heading-section__store {
      position: absolute;
      bottom: -3.5em;
      right: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 140px;
      aspect-ratio: 200 / 90;
      color: var(--color-text);
      flex-shrink: 0;
    }
  }

  .story-main-visual {
    margin-bottom: var(--space-lg);
  }

  .story-intro {
    max-width: var(--container-max);
    margin-inline: auto;
    margin-bottom: var(--space-xl);
    padding-inline: var(--container-pad);
  }

  .story-content-section {
    gap: 0;
    margin-bottom: 0;
  }

  .story-block,
  .story-block.story-block--reverse {
    max-width: var(--container-max);
    margin-inline: auto;
    margin-bottom: var(--space-xl);
    padding-inline: var(--container-pad);
    flex-direction: column;
    gap: 0;

    & .story-block__media {
      padding: 0;
      width: 100%;
      order: 1;
    }

    & .story-block__text-content {
      width: 100%;
      padding-inline: 0;
      order: 2;

      & h2 {
        font-size: var(--font-size-md);
        padding: 1.5em 0 1em 0;
      }
    }
  }

  .story-gallery {
    gap: var(--space-xs);
  }

  .story-profile {
    & .story-profile__bio {
      padding-inline: var(--space-md);
    }
  }
}

/* ── レスポンシブ対応 (モバイル: 600px以下) ──────────────── */
@media (max-width: 640px) {
  .story-gallery {
    grid-template-columns: 1fr;
    gap: var(--space-sm);

    & .story-gallery__item {
      aspect-ratio: 16 / 9;
    }
  }

  .story-line {
    margin-top: var(--space-lg);
    margin-bottom: var(--space-xl);
  }

  .story-profile {
    & .story-profile__avatar {
      width: 60%;
      height: 60%;
      margin-bottom: var(--space-lg);
    }

    & .story-profile__bio {
      width: 100%;
      padding-inline: var(--space-md);
      text-align: left;

    }
  }
}