:root {
      /* 必要に応じて共通CSS変数をここで上書き・追加できます */
      /* 例: --title-font: 'Noto Serif JP', serif; */
    }
        /* 横スクロールコンテナのスタイル */
        #horizontal-scroll-container {
            display: flex; /* 子要素を横に並べる */
            width: fit-content; /* 子要素の幅に合わせて自動調整 */
            /* 必要であれば特定の大きな固定幅を設定しても良いですが、fit-contentが柔軟です */
        }
/* main.works-detail が横スクロールのビューポートとなる */
        main.works-detail {
            display: flex; /* 子要素を横に並べる */
            width: 100%;
            height: 100vh; /* 画面いっぱいの高さにするか、コンテンツに合わせて調整 */
            overflow-x: scroll; /* 横スクロールを有効にする */
            overflow-y: hidden; /* 縦スクロールは隠す */
            white-space: nowrap; /* 子要素が折り返さないように */
            -webkit-overflow-scrolling: touch; /* iOSでの慣性スクロールを有効に */
            scroll-behavior: smooth; /* JSでのscrollLeft変更を滑らかに */
        }

    .works-detail-hero {
      width: 60vw;
      height: 100vh;
      min-height: 320px;
      background: url('assets/img/flannelsofa_hero.jpg') center/cover no-repeat;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      position: relative;
    }
    .works-detail-hero-title {
      color: var(--text-color);
      font-size: 1.5rem;
      padding: 1.5rem 2.5rem;
      margin: 2rem;
      font-family: var(--title-font, 'Noto Serif JP', serif);
      letter-spacing: 0.08em;
    }
    .works-detail-hero-title h4{
        font-size: 5rem;
        margin: 0;
        font-weight: 400;
        color: #bfa76f;        
        opacity: 1;
        transform: translateX(30px);
        transition: opacity 0.8s cubic-bezier(.77,0,.18,1), transform 0.8s cubic-bezier(.77,0,.18,1);
    }
    .works-detail-hero-title p{
        transform: translateX(-30px);
        transition: opacity 0.8s cubic-bezier(.77,0,.18,1), transform 0.8s cubic-bezier(.77,0,.18,1);

        }
    .works-detail-hero-title h4.is-fade, .works-detail-hero-title p.is-fade {
      opacity: 1;
      transform: translateX(0);
    }
    .works-detail-hero-title p{
        font-size: 1.8rem;
    }
    .works-detail-hero-title ul{
        display:flex;
        gap:10px;
        flex-wrap: wrap;
        flex-direction: column;;
        list-style: none;
        padding: 0;
        margin: 8rem 0 0;
    }
    .works-detail-hero-image {
      display:flex;
      flex-direction: column;
      /*justify-content: flex-end;*/
      height: 100vh;
      object-fit: cover;
      overflow:hidden;
    }
    .works-detail-hero-image img{
        margin-top:50px;
    }
    .works-detail-lead {
      position: relative;
      overflow: hidden;
      z-index: 1;
      width: 40vw;
      height: 100vh;
      display:flex;
      justify-content: center;
      flex-direction: column;
      padding:0 20px;
      color: var(--text-color, #333);
      font-family: var(--title-font, 'Noto Serif JP', serif);
      font-size: 1.5rem;
      line-height: 1.8;
      background: linear-gradient(120deg, #e4c8d1 40%, #f1deb7 100%);
      background-size: 200% 200%;
      animation: worksLeadGradientMove 6s ease-in-out infinite;
    }
    .works-detail-lead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--lead-grad, linear-gradient(120deg, #ffb347 0%, #ffcc33 25%, #6dd5ed 50%, #2193b0 75%, #ee9ca7 100%));
  background-size: 300% 300%;
  animation: gradientMove 16s ease-in-out infinite;
  opacity: 0.6;
  pointer-events: none;
  transition: background 0.8s;
}
@keyframes gradientMove {
  0% { background-position: 0% 70%; }
  50% { background-position: 100% 30%; }
  100% { background-position: 0% 70%; }
}
.works-detail-lead > * {
  position: relative;
  z-index: 1;
}
    .works-detail-lead h4{
        padding-bottom:30px;
    }
@keyframes worksLeadGradientMove {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

    article.works-detail-content {
      width: 40vw;
      height: 100vh;
      overflow:hidden;
      display:flex;
      justify-content: center;
      flex-direction: column;
      padding:0 20px;
      color: var(--text-color, #333);
      font-family: var(--title-font, 'Noto Serif JP', serif);
      font-size: 1.3rem;
      line-height: 1.8;
      background: linear-gradient(120deg, #fff8fa 40%, #fffbf3 100%);
      background-size: 200% 200%;
      animation: worksLeadGradientMove 6s ease-in-out infinite;
    }
    .works-detail-meta {
      color: var(--accent-color, #a88a43);
      font-size: 1.1rem;
      margin-bottom: 1.2rem;
      letter-spacing: 0.1em;
    }
    .works-detail-img {
      width: 100%;
      border-radius: 1rem;
      margin: 2rem 0;
      box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    }
    .works-detail-section {
      margin-bottom: 2.5rem;
    }
    .works-detail-section h3 {
      font-size: 1.2rem;
      color: var(--accent-color, #bfa76f);
      margin-bottom: 0.7rem;
      letter-spacing: 0.08em;
    }
    .works-detail-section p {
      font-size: 1.2rem;
      color: 3c3c3c;
      line-height: 1.7;
      white-space: normal;
    }
    .works-detail-back {
      display: inline-block;
      margin-top: 2.5rem;
      color: var(--accent-color, #bfa76f);
      text-decoration: none;
      font-size: 1rem;
      border-bottom: 1px solid var(--accent-color, #bfa76f);
      transition: color 0.2s, border-bottom 0.2s;
    }
    .works-detail-back:hover {
      color: var(--text-color, #222);
      border-bottom: 1px solid var(--text-color, #222);
    }
    @media (max-width: 600px) {
      .works-detail-hero-title {
        font-size: 1.3rem;
        padding: 1rem 1.2rem;
        margin: 1rem;
      }
      .works-detail-content {
        padding: 1.5rem 0.5rem 2rem 0.5rem;
        top: -30px;
      }
    }
    main {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    width: 100vw;
    min-height: 100vh;
    box-sizing: border-box;
    scrollbar-width: none;         /* Firefox */
    -ms-overflow-style: none;      /* IE, Edge */
}

main > section, main > article {
    flex: 0 0 auto;
    min-width: 320px; /* 各ブロックの最小幅（お好みで調整） */
    max-width: 90vw;  /* お好みで調整 */
}

main::-webkit-scrollbar {
    display: none;                 /* Chrome, Safari */
}

#particles-js {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.works-detail-content {
  position: relative;
  z-index: 1;
}
.works-detail-content > *:not(#particles-js) {
  position: relative;
  z-index: 1;
}
.works-detail-hero-image-2 {
  display:flex;
  flex-direction: column;
  /*justify-content: flex-end;*/
  aspect-ratio: 3 / 2;
  object-fit: cover;
  overflow:hidden;
  margin:auto 20px;
  height: 60vh;
}
.works-detail > .works-detail-hero-image-2 {
  margin-left: 100px;
}
.works-detail > .works-detail-hero-image-2 ~ .works-detail-hero-image-2 {
  margin-left: 20px;
}
.fade-in-x {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, visibility 0s linear 0.8s; /* ★変更: visibilityのtransitionを追加 */    will-change: opacity, transform;
}
.fade-in-x.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible; /* ★追加: is-visibleクラスが付与されたら表示状態にする */
}
.works-detail-hero-image-2.portrait {
  aspect-ratio: 2 / 3;
}

/* --- レスポンシブ対応 --- */
@media (max-width: 700px) {
    main {
        flex-direction: column;
        align-items: center;
    }
    .works-detail-hero, .works-detail-lead, .works-detail-content {
        width: 100%;
        height: auto;
        padding: 1rem;
    }
    .works-detail-hero-title h4 {
        font-size: 2.5rem;
    }
    .works-detail-hero-title p, .works-detail-meta {
        font-size: 1rem;
    }
    .about-main .about-intro {
        margin-bottom: 0 5vw 5rem;
        width: 100%;
}}
@media (max-width: 480px) {
    .header-title { font-size: 1.5rem; }
    .works-detail-hero{
      padding:2rem 0 0;
    }
    .works-detail-hero-title {
      padding:0;
      margin:0;
    }
    .works-detail-section p {
    font-size:1.3rem;
    }
      .works-detail-hero-title h4{
      margin-top:3rem;
    }
    .works-detail-hero-title ul{
      margin-top:2rem;
    }
    main.works-detail {
        flex-direction: column;
        align-items: center;
        width:100%;
        height:auto;
        overflow-x:hidden;
    }
    .works-detail-hero-image {
        height: 50vh;
        min-height: 200px;
    }
    main.works-detail section.fade-in-x.is-visible{
      margin-bottom:6vw;
    }
    .works-detail-hero-image img {
      margin:0;
    }
    .works-detail-hero-image {
    height: auto;
    }
    .works-detail-lead{
      padding:10vw 5vw;
    }
    .works-detail-lead p{
      width:100%;
      white-space: normal;
    }
    #video-photo-wrapper{
      width:100%;
      aspect-ratio: 16 / 9;
      margin-bottom:10vw;
    }
    #video01{
      width:100%;
      height:auto;
    }
    article.works-detail-content {
      white-space: normal;
      width:100vw;
      height:auto;
      padding:6vw 5vw;
    }
    .works-detail > .works-detail-hero-image-2,
    .works-detail > .works-detail-hero-image-2 ~ .works-detail-hero-image-2{
      height:auto;
      margin:0 auto 7vw;
    }
    .main-visual { height: 40vh; min-height: 200px; }
    /* フェードインの初期状態 (共通) */
.fade-in-x {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, visibility 0s linear 0.8s; /* ★変更: visibilityのtransitionを追加 */    will-change: opacity, transform;
}
.fade-in-x.is-visible {
    opacity: 1;
    transform: translateX(0);
    visibility: visible; /* ★追加: is-visibleクラスが付与されたら表示状態にする */
}

/* 奇数番目のsectionの初期位置 (左から) */
/* :nth-of-type(odd) は1, 3, 5...番目のsectionを選択 */
main.works-detail section.fade-in-x:nth-of-type(odd) {
    transform: translateX(-60px); /* 左に60pxずらして配置 */
}
/* 偶数番目のsectionの初期位置 (右から) */
/* :nth-of-type(even) は2, 4, 6...番目のsectionを選択 */
main.works-detail section.fade-in-x:nth-of-type(even) {
    transform: translateX(60px); /* 右に60pxずらして配置 */
}
main.works-detail section.fade-in-x.is-visible {
    opacity: 1;
    transform: translateX(0);
    visibility: visible; /* ★追加: is-visibleクラスが付与されたら表示状態にする */
}


/* アニメーション後の状態 (共通) */
/* is-visible クラスが付与されたら、元の位置に戻る */
main.works-detail section.fade-in-x.is-visible {
    opacity: 1;
    transform: translateX(0); /* 元の位置に戻る */
}
}
body {
  overflow-x: hidden;
}
