@charset "utf-8";

/* ================================
  共通ユーティリティ（Work全体）
================================ */

.work-section,
.work-header {
    padding-left: clamp(20px, 3.4vw, 49px);
    padding-right: clamp(20px, 3.4vw, 49px);
}

/* ===================
  work-header（見出し）
=================== */

.work-header {
    margin-top: 127px;
}

@media (max-width: 800px) {
    .work-header {
        margin-top: 150px;
    }
}

/* ====================
  work-section（一覧本体）
==================== */

.work-section {
    margin-top: 73px;
}

/* ===================
  work-item（各作品ブロック）
=================== */

.work-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    grid-template-areas: "text image";
}

/* 奇数番目（右画像、左テキスト） */
.work-item:nth-of-type(odd) {
    align-items: flex-end;
}

.work-item:nth-of-type(odd) .work-image {
    order: 2;
}

.work-item:nth-of-type(odd) .work-text {
    order: 1;
    margin-bottom: 85px;
    align-items: flex-end;
}

/* 偶数番目（左画像、右テキスト） */
.work-item:nth-of-type(even) .text-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    height: 100%;
}

.work-item:nth-of-type(even) .work-text {
    margin-bottom: 85px;
    margin-left: 30px;
}


/* ===================
  work-image（画像）
=================== */


.work-image-sp {
    display: none;
}

.work-image {
  position: relative;
  overflow: hidden;
}

.work-image img {
  width: 100%;
  height: auto;
}



/* ===================
  work-text（テキスト）
=================== */

.work-title {
  color: var(--primary-white);
  font-family: "DM Sans";
  font-size: 2.8rem;
  font-weight: 500;
  line-height: 1;
  position: relative;
  display: flex;
  align-items: center;
}

/* beforeの初期状態 */
.work-title::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  background-color: transparent;
  border-radius: 50%;
  margin-right: 0;           
  transition: 
    width 0.3s ease,
    height 0.3s ease,
    margin-right 0.3s ease,
    background-color 0.3s ease;
}

/* work-itemにホバーしたときに丸が出現 */
.work-item:hover .work-title::before {
  width: 8px;
  height: 8px;
  margin-right: 17px;
  background-color: var(--primary-yellow); 
}

.work-type {
    color: var(--primary-gray);
    font-family: "DM Sans";
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.15px;
    margin-top: 18px;
}


@media screen and (max-width: 768px) {
    .work-container {
      display: flex;
      flex-direction: column;
      gap: 46px;
    }

    .work-item {
      display: flex;
    }

    .work-item:nth-of-type(odd) {
      flex-direction: column-reverse; 
    }

    .work-item:nth-of-type(even) {
      flex-direction: column; 
    }

    .work-title {
      font-size: 2.3rem;
      margin-top: 16px;
    }

    .work-type {
      margin-top: 7px;
    }
    
    .work-item:nth-of-type(odd) .work-text {
      margin-bottom: 0;
    }
    .work-item:nth-of-type(even) .work-text {
      margin-bottom: 0;
      margin-left: 0;
    }

    .work-item:nth-of-type(odd) {
      align-items: stretch;
    }

    .work-item:nth-of-type(even) {
      align-items: stretch;
    }
      
    .work-title::before {
      content: none;
      display: none;
  }

}

body.page-work .footer {
  margin-top: 250px;
}


@media screen and (max-width: 768px) {
    body.page-work .footer {
        margin-top: 200px;
    }

}


/* ==============
hover-video-wrap
=============== */

.work-image {
  position: relative;
  overflow: hidden;
}

/* 元の固定値を削除して可変に */
.hover-video-wrap {
  position: absolute;
  top: 50%;
  left: 50%;

  /* ▼画面幅に対する割合で指定 */
  width: min(40vw, 583px);   /* 最大583px、画面幅の40%を上限 */
  aspect-ratio: 583 / 364.611;

  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
  background: black;

  clip-path: inset(100% 0 0 0);
  opacity: 0;
  transition:
    clip-path 0.5s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.3s ease;
}


/* PCのみでホバー効果を適用 */
@media (min-width: 769px) {
  .work-image:hover .hover-video-wrap {
    clip-path: inset(0 0 0 0); /* 全体が見える */
    opacity: 1;
  }
}

/* 動画の設定 */
.hover-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* フィルター用オーバーレイ（初期状態では非表示） */
.hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

/* PCのみでホバー時にフィルターを表示 */
@media (min-width: 769px) {
  .work-image:hover .hover-overlay {
    opacity: 1;
  }
}

.hover-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;      
  object-position: center;
}

/* ==============
hover-image-wrap
=============== */

.hover-image-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(35vw, 500px);
  transform: translate(-50%, -50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
  clip-path: inset(100% 0 0 0); 
  opacity: 0;
  transition:
    clip-path 0.5s cubic-bezier(0.23, 1, 0.32, 1),
    opacity 0.5s ease;
}


@media (min-width: 769px) {
  .work-image:hover .hover-image-wrap {
    clip-path: inset(0 0 0 0); 
    opacity: 1;
  }
}

.work-item:nth-of-type(7) .hover-image-wrap {
  width: min(20vw, 300px);
}

.hover-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 768px) {
  .hover-video-wrap,
  .hover-image-wrap,
  .hover-overlay {
    display: none !important;
  }
}