/*
レシピmv
------------------------------ */
.recipe-hero {
    width: 100%;
    height: 400px;
    position: relative;
    overflow: hidden !important;
    background-color: #fff; /* 背景を白で固定 */
}

.recipe-hero-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    
    /* 【修正】待機中の画像はすべて z-index: 1 */
    z-index: 1; 

    will-change: opacity;
    transform: translateZ(0); 
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.recipe-hero-img:not(.active) {
    z-index: 5; 
}

/* 表示されている画像 */
.recipe-hero-img.active {
    opacity: 1;
    z-index: 10;
}


.recipe-steam {
  z-index: 10 !important;
  position: absolute;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 90%);
  filter: blur(10px);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999;
  /* 8sかけて、最後にかけてゆっくり減速する動きにする */
  animation: steam-float 8s ease-out forwards;
  will-change: transform, opacity;
} 

@keyframes steam-float {
    0% { 
        transform: translateY(0) scale(0.5); 
        opacity: 0; 
    }
    /* 出現時：早めにふわっと見せる */
    15% { 
        opacity: 0.8; 
    }
    /* 中間：このあたりから徐々に消え始める準備 */
    50% {
        opacity: 0.6;
    }
    /* 【重要】ここから最後にかけて「ふわ〜っ」と透明にする */
    100% { 
        transform: translateY(-400px) translateX(50px) scale(5); 
        opacity: 0; /* 最後は完全に透明 */
    }
}



/* 堤防の常連セクション ------------------------------ */
.fish-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 50px 30px;
}

/* 魚のリンクアイテム：aタグ自体にポインタを設定 */
.fish-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--dark-blue);
  transition: transform 0.3s ease, opacity 0.3s ease;
  cursor: pointer !important; /* !importantを追加して強制適用 */
}

.fish-item:hover {
  transform: translateY(-5px);
  opacity: 0.7;
}

/* 画像エリア */
.fish-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: flex; /* 中央寄せ */
  justify-content: center;
  align-items: center;
}

.fish-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: auto; /* pointer-events: none; から変更 */
  cursor: pointer;
}

/* 魚のアイコン画像を優しく動かす */
.fish-name {
  font-weight: bold;
  margin-top: 10px;
}

.fish-image img {
    /* 3秒かけて上下にふわふわ動き続ける */
    animation: puka-puka 3s ease-in-out infinite;
    display: block;
    margin: 0 auto;
}

/* 隣り合う魚が同じ動きだと不自然なので、1つおきにタイミングをずらす */
.fish-item:nth-child(even) .fish-image img {
    animation-delay: 1.5s; /* 偶数番目の魚は1.5秒遅れて動く */
}

/* 上下に浮き沈みする動きの定義 */
@keyframes puka-puka {
    0%, 100% {
        transform: translateY(0); /* 元の位置 */
    }
    50% {
        transform: translateY(-8px); /* 8pxだけ上に浮く */
    }
}

/* ホバーした（マウスを乗せた）時は動きを止めて、少し大きくする演出 */
.fish-item:hover .fish-image img {
    animation-play-state: paused; /* アニメーション一時停止 */
    transform: scale(1.1);       /* 1.1倍に大きく */
    transition: transform 0.3s ease;
}



/*
オススメセクション
------------------------------ */
.osusume-recipe-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(../images/bg/recipe-bg.webp);
  background-size: 100%;
  background-position: 50% 50%;
  background-repeat: no-repeat;
  opacity: 0.05;
  z-index: 0;
  pointer-events: none;
}

/* カードのテキストエリアに鱗模様を敷く */
.card-blog-content-recipe {
  position: relative;
  background-color: var(--white);
  overflow: hidden;
  z-index: 0;
}

.card-blog-content-recipe::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/bg/uroko-small-bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
}

/* 中のコンテンツが模様に埋もれないように前面に出す */
.card-blog-content-recipe > * {
  position: relative;
  z-index: 1;
}



/*
レシピ詳細ページ
------------------------------ */
/* 日付と時間の横並び調整 */
.post-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 10px 0;
}

.post-date-wrapper, .post-update-wrapper {
  display: flex;
  align-items: center;
  gap: 5px;
}

.meta-icon {
  width: 20px;
  height: auto;
}

.ingredients-box {
  background-color: color-mix(in srgb, var(--red), var(--white) 80%);
  border: 2px solid var(--red);
  padding: 25px;
  margin-bottom: 40px;
  border-radius: 8px;
}

.ingredients-title {
  font-size: 16px;
  font-weight: bold;
  border-bottom: 2px solid var(--white);
  margin-bottom: 15px;
  padding-bottom: 5px;
}

.ingredients-content {
  line-height: 1.8;
}



/*
サイドバー
------------------------------ */
.sidebar-recipe {
  background-image: url(../images/bg/sidebar_recipe.jpg);
  background-size: cover; 
  background-position: top;
  background-repeat: no-repeat;
  padding: 24px;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box; 
}






/* タブレット (1024px以下) : 3列 */
@media screen and (max-width: 1024px) {
  /*
  堤防の常連セクション
  ------------------------------ */
  .fish-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px 20px;
  }
}


/* 767px以下 */
@media screen and (max-width: 767px) {
  /*
  MVのスライド 5枚目が一瞬表示される現象を制御
  ------------------------------ */
  .recipe-hero {
    height: 250px;
  }
  .recipe-hero-img {
    object-position: center 70%;
    /* スマホ専用の z-index 指定は削除し、共通設定に任せるのが一番安定します */
  }

  .recipe-hero-img:not(.active) {
    z-index: 2;
  }

  .recipe-hero-img.active {
    opacity: 1;
    z-index: 10;
  }

  /* 5枚目がチラつくのを防ぐには、
     「背景色」をしっかり設定するのが最も確実です 
  */
  .recipe-hero {
    background-color: #fff; /* 背景を白で塗りつぶし、後ろの画像が見えないようにする */
  }

  /*
  堤防の常連セクション
  ------------------------------ */
  .fish-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px 15px;
  }
  .fish-name {
    font-size: 12px;
  }

  /*
オススメセクション
------------------------------ */
  .osusume-recipe-section::before {
    background-size: 450%;
  }

}