/* ========================================
   Project — ストーリー詳細（episode/01.html / 02.html / 03.html）
======================================== */

.p-storyDetail {
  position: relative;
  color: var(--works-color-text);
  font-family: var(--works-font);
  overflow: hidden;
}

/* .p-storyDetail__inner {
  max-width: 1280px;
} */

.p-storyDetail [aria-hidden="true"] {
  display: block;
}

/* ---- Hero: SP first ---- */
.p-storyDetail__hero {
  position: relative;
  /* Main padding-top(118px) 内で p-worksHeader__actions と同じ高さに揃える */
  margin-top: calc(var(--works-site-header-top) + 8px - 118px);
  padding: 0;
}

/* SP: 負の margin で引き上げた heroHead が overflow で欠けないようにする */
@media (max-width: 767px) {
  .p-storyDetail {
    overflow: visible;
  }

  .p-storyDetail__body {
    overflow: hidden;
  }

  .p-storyDetail__heroHead {
    position: relative;
    z-index: 2;
    /* 固定ヘッダー（ENTRY）左に見えるよう確保 */
    min-height: 40px;
  }
}

.p-storyDetail__heroInner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p-storyDetail__heroHead {
  position: relative;
  z-index: 2;
}

.p-storyDetail__heroMain {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 0;
}

.p-storyDetail__episode {
  margin: 0 0 4px;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.58;
  color: var(--works-color-orange);
}

.p-storyDetail__series {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.58;
  color: var(--works-color-brown);
}

.p-storyDetail__heroMedia {
  position: relative;
  z-index: 1;
  order: 1;
  width: 100%;
  aspect-ratio: 350 / 197;
  border-radius: 20px;
  overflow: hidden;
  background-color: #d9d9d9;
}

.p-storyDetail__heroMedia img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.p-storyDetail__heroText {
  position: relative;
  z-index: 2;
  order: 2;
  margin-top: 15px;
}

.p-storyDetail__storyMeta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 12px;
}

.p-storyDetail__storyLabel {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.58;
  color: var(--works-color-brown);
}

.p-storyDetail__storyNum {
  margin: 0;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--works-color-brown);
}

.p-storyDetail__title {
  position: relative;
  z-index: 2;
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  line-height: 32px;
  color: var(--works-color-orange);
}

.p-storyDetail__titleLine {
  display: inline;
  padding: 2px 6px;
  background-color: var(--works-color-white);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.p-storyDetail__lead {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  color: var(--works-color-text);
}

/* ---- Page nav ---- */
.p-storyDetail__nav {
  margin: 40px 0 0;
  padding: 0;
}

.p-storyDetail__navList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 12px;
}

.p-storyDetail__navItem:nth-child(4),
.p-storyDetail__navItem:nth-child(5) {
  grid-column: span 1;
}

.p-storyDetail__navLink {
  display: block;
  padding-left: 12px;
  border-left: 2px solid #5A3A3A;
  color: inherit;
  text-decoration: none;
  scroll-margin-top: 120px;
}

.p-storyDetail__navEn {
  display: block;
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.58;
  color: var(--works-color-brown);
}

.p-storyDetail__navJa {
  display: block;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  color: var(--works-color-orange);
}

.p-storyDetail__navLink:hover .p-storyDetail__navJa {
  text-decoration: underline;
}

/* ---- Intro ---- */
.p-storyDetail__intro {
  position: relative;
  margin-top: 48px;
  scroll-margin-top: 120px;
}

.p-storyDetail__intro > *:not(.p-storyDetail__deco) {
  position: relative;
  z-index: 1;
}

.p-storyDetail__introEn {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.58;
  color: var(--works-color-brown);
}

.p-storyDetail__introTitle {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--works-color-orange);
}

.p-storyDetail__introBody {
  margin: 0 0 32px;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  color: var(--works-color-text);
}

.p-storyDetail__introGrid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.p-storyDetail__introMedia--products,
.p-storyDetail__introMedia--team {
  margin-bottom: 24px;
}

.p-storyDetail__introMedia--team {
  margin-bottom: 0;
}

.p-storyDetail__introMedia {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
}

.p-storyDetail__introMedia img,
.p-storyDetail__wideMedia img,
.p-storyDetail__sideMedia img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  vertical-align: bottom;
  border-radius: 19px;
}

.p-storyDetail__introMedia--products {
  aspect-ratio: 350 / 232;
}

.p-storyDetail__introMedia--team {
  aspect-ratio: 350 / 320;
}

.p-storyDetail__wideMedia {
  width: 100%;
  margin: 24px 0 0;
  aspect-ratio: 350 / 175;
  border-radius: 16px;
  overflow: hidden;
}

/* ---- Chapter ---- */
.p-storyDetail__chapter {
  position: relative;
  margin-top: 64px;
  scroll-margin-top: 120px;
}

.p-storyDetail__chapterHead {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.p-storyDetail__badge {
  position: relative;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: var(--works-color-brown);
  color: var(--works-color-white);
  text-align: center;
}

.p-storyDetail__badgeLabel {
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.58;
}

.p-storyDetail__badgeNum {
  position: absolute;
  left: 0;
  right: 0;
  top: 26px;
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
}

.p-storyDetail__chapterTitles {
  padding-top: 4px;
  min-width: 0;
}

.p-storyDetail__chapterLabel {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--works-color-orange);
}

.p-storyDetail__chapterTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 32px;
  color: var(--works-color-text);
}

.p-storyDetail__quote {
  margin: 24px 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 36px;
  color: var(--works-color-text);
}

.p-storyDetail__deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

.p-storyDetail__deco--lg {
  width: 266px;
  height: 266px;
  right: -40px;
  top: 80px;
}

.p-storyDetail__deco--sm {
  width: 229px;
  height: 229px;
  left: -60px;
  top: 55%;
}

.p-storyDetail__deco--intro {
  width: 266px;
  height: 266px;
  left: -60px;
  top: -24px;
}

.p-storyDetail__chapter > *:not(.p-storyDetail__deco) {
  position: relative;
  z-index: 1;
}

/* ---- Interview component ---- */
.c-interview {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 24px;
}

.c-interview__speaker {
  flex-shrink: 0;
  width: 48px;
}

.c-interview__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 50%;
  background-color: var(--works-color-white);
  border: 1px solid var(--works-color-orange-sub);
  box-sizing: border-box;
}

.c-interview__name {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.48;
  color: var(--works-color-orange);
  text-align: center;
}

/* SP用の名前画像。data-sp-src のファイルを共有後、img.c-interview__nameImg を入れて src をそのパスにする */
.c-interview__nameImg {
  display: none;
  width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  .c-interview__avatar:has(.c-interview__nameImg) .c-interview__name {
    font-size: 0;
  }

  .c-interview__nameImg {
    display: block;
  }
}

.c-interview__text {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 24px;
  color: var(--works-color-text);
}

.c-interview__text a {
  color: inherit;
  text-decoration: underline;
}

.c-interview__note {
  margin: 0 0 8px;
  padding-left: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  color: var(--works-color-text);
}

.c-interviewBlock {
  margin: 0 0 32px;
}

/* ---- Members (episode/03.html intro) ---- */
.p-storyDetail__members {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 32px;
}

.p-storyDetail__member {
  width: 100%;
  aspect-ratio: 350 / 304;
  border-radius: 12px;
  overflow: hidden;
  background-color: #c9c9c9;
}

.p-storyDetail__member img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  vertical-align: bottom;
}

.p-storyDetail__quote--sub {
  margin-top: 40px;
}

.c-interviewBlock__media {
  width: 100%;
  margin: 0 0 24px;
  aspect-ratio: 350 / 175;
  border-radius: 16px;
  overflow: hidden;
  background-color: #d9d9d9;
}

.c-interviewBlock__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  vertical-align: bottom;
}

.c-interviewBlock__media--inset {
  width: calc(100% - 60px);
  margin-left: auto;
  aspect-ratio: 290 / 193;
  border-radius: 20px;
}

/* ---- Recommend ---- */
.p-storyDetail__recommend {
  margin-top: 80px;
  padding-bottom: 40px;
}

.p-storyDetail__recommendTitle {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: var(--works-color-text);
}

.p-storyDetail__recommendList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.p-storyDetail__recommendItem {
  width: 100%;
  min-width: 0;
}

.p-works .p-storyDetail__recommendLink {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 512 / 240;
  border-radius: 16px;
  overflow: hidden;
  background-color: #c9c9c9;
  text-decoration: none;
  color: var(--works-color-white);
}

.p-storyDetail__recommendLink img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-storyDetail__recommendNum {
  position: absolute;
  left: 16px;
  top: 0;
  margin: 0;
  font-size: 64px;
  font-weight: 700;
  line-height: 86.4px;
  color: var(--works-color-white);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.18);
}

.p-storyDetail__recommendCaption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--works-color-white);
}

/* ---- CTA ---- */
.p-storyDetail__cta {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
}

.p-storyDetail__ctaCol {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 100%;
  min-height: 160px;
  padding: 32px 20px;
  box-sizing: border-box;
}

.p-storyDetail__ctaCol--27 {
  background-color: var(--works-color-orange);
}

.p-storyDetail__ctaCol--28 {
  background-color: var(--works-color-orange-sub);
}

.p-storyDetail__ctaYear {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--works-color-white);
  text-align: center;
}

.p-storyDetail__ctaBtns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 512px;
}

.p-works .p-storyDetail__ctaBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 140px;
  max-width: 240px;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 32px;
  background-color: var(--works-color-white);
  color: var(--works-color-orange);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
}

.p-works .p-storyDetail__ctaBtn:hover {
  opacity: 0.9;
  color: var(--works-color-orange);
}

/* ---- Body spacing wrapper ---- */
.p-storyDetail__body {
  padding: 0;
}

/* ========================================
   PC
======================================== */
@media (min-width: 768px) {
  .p-storyDetail__hero {
    /* ENTRY（高さ40）がメニュー（56）と中央揃えされる位置に合わせる */
    margin-top: calc(var(--works-site-header-top) + 13px + ((56px - 40px) / 2) - 118px);
    padding: 0;
  }

  .p-storyDetail__heroInner {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .p-storyDetail__heroMain {
    position: relative;
    display: block;
    min-height: 473px;
  }

  .p-storyDetail__episode {
    font-size: 12px;
  }

  .p-storyDetail__series {
    margin-bottom: 0;
    font-size: 20px;
    line-height: 1.38;
  }

  .p-storyDetail__heroMedia {
    position: absolute;
    top: 0;
    right: 0;
    order: unset;
    width: 840px;
    max-width: calc(100% - 360px);
    margin-left: auto;
    aspect-ratio: 840 / 473;
    border-radius: 40px;
  }

  .p-storyDetail__heroText {
    position: relative;
    z-index: 2;
    order: unset;
    width: 360px;
    max-width: 100%;
    margin-top: 0;
    padding-top: 40px;
  }

  .p-storyDetail__storyMeta {
    position: relative;
    margin-bottom: 14px;
    min-height: 86px;
  }

  .p-storyDetail__storyLabel {
    position: absolute;
    left: 0;
    bottom: 8px;
    font-size: 20px;
  }

  .p-storyDetail__storyNum {
    position: absolute;
    left: 80px;
    top: 0;
    font-size: 72px;
    line-height: 86.4px;
  }

  .p-storyDetail__title {
    width: 593px;
    max-width: calc(100vw - 80px);
    margin-bottom: 24px;
    font-size: 32px;
    line-height: 56px;
  }

  .p-storyDetail__titleLine {
    padding: 8px 8px;
    border-radius: 4px;
  }

  .p-storyDetail__lead {
    max-width: 323px;
    font-size: 16px;
    line-height: 32px;
  }

  .p-storyDetail__nav {
    max-width: 1012px;
    margin: 56px auto 0;
  }

  .p-storyDetail__navList {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 16px;
  }

  .p-storyDetail__navItem {
    flex: 1 1 0;
    min-width: 0;
  }

  .p-storyDetail__navLink {
    padding-left: 16px;
  }

  .p-storyDetail__navEn {
    font-size: 12px;
  }

  .p-storyDetail__navJa {
    font-size: 18px;
    line-height: 26.6px;
    white-space: nowrap;
  }

  .p-storyDetail__intro {
    margin-top: 102px;
  }

  .p-storyDetail__introEn {
    font-size: 16px;
  }

  .p-storyDetail__introTitle {
    grid-area: title;
    margin-bottom: 0;
    font-size: 20px;
    line-height: 33.1px;
  }

  .p-storyDetail__introGrid {
    display: grid;
    grid-template-columns: minmax(0, 640px) minmax(0, 514px);
    grid-template-areas:
      "title products"
      "body products";
    column-gap: 48px;
    row-gap: 0;
    align-items: start;
  }

  .p-storyDetail__introBody {
    grid-area: body;
    margin: 0;
    font-size: 16px;
    line-height: 32px;
  }

  .p-storyDetail__introMedia--products {
    grid-area: products;
    margin-bottom: 0;
    aspect-ratio: 514 / 341;
    border-radius: 0;
  }

  .p-storyDetail__introMedia--team {
    display: none;
  }

  .p-storyDetail__wideMedia {
    margin-top: 48px;
    aspect-ratio: 1200 / 363;
    border-radius: 28px;
  }

  .p-storyDetail__chapter {
    margin-top: 96px;
  }

  .p-storyDetail__chapterHead {
    gap: 30px;
    margin-bottom: 40px;
  }

  .p-storyDetail__badge {
    width: 112px;
    height: 112px;
  }

  .p-storyDetail__badgeLabel {
    top: 22px;
    font-size: 12px;
  }

  .p-storyDetail__badgeNum {
    top: 36px;
    font-size: 50px;
    line-height: 60px;
  }

  .p-storyDetail__chapterLabel {
    font-size: 20px;
    line-height: 48px;
  }

  .p-storyDetail__chapterTitle {
    font-size: 40px;
    line-height: 1.2;
  }

  .p-storyDetail__wideMedia--chapter {
    margin: 0 0 40px;
    aspect-ratio: 1200 / 355;
    border-radius: 20px;
  }

  .p-storyDetail__quote {
    margin: 40px 0;
    font-size: 30px;
    line-height: 36px;
  }

  .p-storyDetail__deco--lg {
    width: 446px;
    height: 446px;
    right: -80px;
    top: 400px;
  }

  .p-storyDetail__deco--sm {
    width: 264px;
    height: 264px;
    left: -80px;
    top: 72%;
  }

  .p-storyDetail__deco--intro {
    width: 446px;
    height: 446px;
    left: -68px;
    top: -50px;
  }

  .c-interview {
    gap: 32px;
    margin-bottom: 32px;
  }

  .c-interview__speaker {
    width: 68px;
  }

  .c-interview__avatar {
    width: 68px;
    height: 68px;
  }

  .c-interview__name {
    font-size: 15px;
    line-height: 22.2px;
  }

  .c-interview__text {
    font-size: 16px;
    line-height: 32px;
  }

  .c-interview__note {
    margin-top: 8px;
    font-size: 13px;
    line-height: 24px;
  }

  .p-storyDetail__members {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 48px;
    max-width: 1200px;
  }

  .p-storyDetail__member {
    border-radius: 0;
  }

  .c-interviewBlock {
    display: grid;
    grid-template-columns: minmax(0, 512px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    margin-bottom: 48px;
  }

  .c-interviewBlock--reverse {
    grid-template-columns: minmax(0, 1fr) minmax(0, 512px);
  }

  .c-interviewBlock--reverse .c-interviewBlock__media {
    order: 2;
  }

  .c-interviewBlock--reverse .c-interviewBlock__body {
    order: 1;
  }

  .c-interviewBlock__media {
    margin: 0;
    aspect-ratio: 512 / 341;
    border-radius: 20px;
  }

  .c-interviewBlock__media--inset {
    width: 100%;
    margin: 0;
    aspect-ratio: 512 / 341;
  }

  .c-interviewBlock .c-interview {
    margin-bottom: 24px;
  }

  .c-interviewBlock .c-interview:last-child {
    margin-bottom: 0;
  }

  .p-storyDetail__recommend {
    margin-top: 120px;
    padding-bottom: 48px;
  }

  .p-storyDetail__recommendTitle {
    margin-bottom: 40px;
    font-size: 26px;
    line-height: 40px;
  }

  .p-storyDetail__recommendList {
    flex-direction: row;
    justify-content: center;
    gap: 56px;
  }

  .p-storyDetail__recommendItem {
    flex: 0 1 512px;
    width: 512px;
    max-width: calc(50% - 28px);
  }

  .p-works .p-storyDetail__recommendLink {
    width: 100%;
    aspect-ratio: 512 / 240;
    border-radius: 20px;
  }

  .p-storyDetail__recommendNum {
    left: 15px;
    font-size: 72px;
  }

  .p-storyDetail__cta {
    flex-direction: row;
  }

  .p-storyDetail__ctaCol {
    flex: 1 1 50%;
    gap: 35px;
    min-height: 240px;
    padding: 46px 40px 48px;
  }

  .p-storyDetail__ctaYear {
    font-size: 20px;
    line-height: 18px;
  }

  .p-storyDetail__ctaBtns {
    gap: 15px;
    max-width: none;
    width: auto;
  }

  .p-works .p-storyDetail__ctaBtn {
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    height: 64px;
    font-size: 16px;
    line-height: 14px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .p-storyDetail__heroMedia {
    max-width: calc(100% - 42%);
  }

  .p-storyDetail__heroText {
    width: 42%;
  }

  .p-storyDetail__title {
    width: auto;
    max-width: calc(100% + 40%);
    font-size: 24px;
    line-height: 40px;
  }

  .p-storyDetail__navJa {
    font-size: 14px;
    white-space: normal;
  }

  .p-storyDetail__introGrid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
    column-gap: 28px;
    row-gap: 0;
  }

  .p-storyDetail__chapterTitle {
    font-size: 28px;
    line-height: 1.3;
  }

  .c-interviewBlock,
  .c-interviewBlock--reverse {
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 28px;
  }

  .c-interviewBlock--reverse {
    grid-template-columns: minmax(0, 1fr) minmax(0, 42%);
  }

  .p-storyDetail__recommendItem {
    max-width: calc(50% - 16px);
  }

  .p-storyDetail__recommendList {
    gap: 32px;
  }
}
