/* =========================================================
   ぬかオジレシピ 共通スタイル
   既存の css/style.css の変数(--color-* / --font-*)を前提にしています。
   必ず style.css の後に読み込んでください。
   ========================================================= */

/* =========================================================
   レシピのページタイトル(2段組み)
   1段目に素材名、2段目に一言を少し小さく置きます。
   HTMLは次の形にしてください(「｜」は使わず、2つの span に分けます)。

     <h1 class="page-title">
       <span class="title-main">ゴーヤのぬか漬け</span>
       <span class="title-sub">〜苦みは下ごしらえで決まります〜</span>
       <small>goya</small>
     </h1>

   ※ <title>タグのほうは「｜」のままにしてあります。
      検索結果に出る文字なので、そちらは変えないでください。
   ========================================================= */
.page-title .title-main {
  display: block;
  /* 画面が狭いときは自動で少し小さくなり、素材名が1行に収まります。
     (「アーリーレッドのぬか漬け」のような長い名前でも途中で切れません。
      12文字がスマホ320px幅で収まるように 6.1vw にしています) */
  font-size: clamp(18px, 6.1vw, 1em);
}
.page-title .title-sub {
  display: block;
  /* 画面が狭いときは自動で少し小さくなります。 */
  font-size: clamp(14px, 4.7vw, 0.6em);
  letter-spacing: 0.06em;
  line-height: 1.8;
  margin-top: 12px;
  color: var(--color-text-soft);
  /* 2行になるときは、単語の途中ではなく
     「、」などの区切りのよい位置で折り返します。 */
  word-break: keep-all;
  overflow-wrap: anywhere;
}
@media (min-width: 720px) {
  .page-title .title-sub { font-size: 0.55em; }
}

/* ===== パンくずリスト ===== */
.recipe-breadcrumb {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-text-soft);
}

.recipe-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.recipe-breadcrumb li::after {
  content: "›";
  margin-left: 6px;
  color: var(--color-line-light);
}

.recipe-breadcrumb li:last-child::after { content: ""; }

.recipe-breadcrumb a {
  color: var(--color-text-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.recipe-breadcrumb a:hover { border-bottom-color: var(--color-line-light); }

/* ===== 一覧ページのリード文 ===== */
.recipe-lead {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  text-align: center;
}

.recipe-lead p {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 2.2;
  color: var(--color-text-soft);
}

/* ===== レシピカード一覧 =====
   新しいレシピを足すときは <article class="recipe-card"> を1つ複製するだけ。
   1件でも複数件でも崩れないよう auto-fit で組んでいます。 */
.recipe-list {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  display: grid;
  /* 1列あたり最大320pxに抑え、件数が少ないときは中央に寄せる。
     レシピが増えれば自動で2列・3列に並びます。 */
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  gap: 24px;
  align-items: start;
}

.recipe-card {
  background: #fff;
  border: 1px solid var(--color-line-light);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--color-shadow);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.recipe-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px var(--color-shadow);
}

.recipe-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 画像が未配置でもカードの高さが崩れないよう、比率で場所を確保しておく。
   正方形にしているのは、スマホで撮った縦長写真でも上下が切れすぎないため。 */
.recipe-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--color-bg-alt);
}

/* 写真がまだ無いレシピ用の、静かな待ち枠 */
.recipe-card-thumb--empty {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-line-light);
}

.recipe-card-body { padding: 18px 20px 22px; }

.recipe-card-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--color-text);
}

.recipe-card-note {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
  color: var(--color-text-soft);
}

/* ===== レシピ本文 ===== */
.recipe-body {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.recipe-body h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.7;
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-line-light);
  color: var(--color-text);
}

.recipe-body h2:first-child { margin-top: 0; }

.recipe-body p {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 2.1;
  margin: 0 0 20px;
  color: var(--color-text);
}

.recipe-body ul { margin: 0 0 20px; padding-left: 1.3em; }

.recipe-body ul li {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 2.1;
  margin-bottom: 6px;
}

/* 手順(番号つき) */
.recipe-steps {
  counter-reset: step;
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.recipe-steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 18px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 2.1;
}

.recipe-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 材料 */
.recipe-ingredients {
  background: var(--color-bg-alt);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 0 0 24px;
}

.recipe-ingredients p {
  margin: 0;
  font-size: 15px;
  line-height: 2;
}

/* よくある質問の「Q.」行 */
.recipe-q {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.9;
  color: var(--color-text);
  margin: 28px 0 8px;
  padding-left: 14px;
  border-left: 3px solid var(--color-accent);
}

/* 補足の注意書き */
.recipe-note {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.9;
  color: var(--color-text-soft);
  border-left: 3px solid var(--color-line-light);
  padding: 4px 0 4px 14px;
  margin: 0 0 24px;
}

/* ===== 漬け時間の表 ===== */
.recipe-table-wrap { overflow-x: auto; margin: 0 0 24px; }

.recipe-table {
  width: 100%;
  min-width: 300px;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 14px;
}

.recipe-table th,
.recipe-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-line-light);
  text-align: left;
}

.recipe-table thead th {
  background: var(--color-bg-alt);
  font-weight: 500;
  color: var(--color-text);
}

.recipe-table tbody th { font-weight: 400; color: var(--color-text); }
.recipe-table td { color: var(--color-text-soft); }

/* ===== 写真 ===== */
.recipe-figure { margin: 0 0 28px; }

/* 画像が未配置でも枠の高さが確保され、レイアウトが崩れないようにしている */
.recipe-figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--color-bg-alt);
  display: block;
}

/* 正方形の写真用。figure に recipe-figure--square を足すと、
   切り取らずに正方形のまま程よい大きさで表示します。 */
.recipe-figure--square img {
  aspect-ratio: 1 / 1;
  max-width: 460px;
  margin: 0 auto;
}

/* スマホで撮った縦長写真用。 */
.recipe-figure--portrait img {
  aspect-ratio: 3 / 4;
  max-width: 420px;
  margin: 0 auto;
}

.recipe-figure figcaption {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--color-text-soft);
  margin-top: 10px;
  text-align: center;
}

/* ===== 「巡」への導線 ===== */
.recipe-cta {
  max-width: var(--content-max);
  margin: 64px auto 0;
  padding: 0 var(--content-pad);
}

/* はじめての方向けの静かなリンク */
.recipe-cta-guide {
  display: block;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.9;
  color: var(--color-text-soft);
  text-decoration: none;
  padding: 16px 20px;
  border-top: 1px solid var(--color-line-light);
  border-bottom: 1px solid var(--color-line-light);
  transition: color 0.3s var(--ease-out);
}

.recipe-cta-guide:hover { color: var(--color-text); }

/* 商品ブロック(価格は表示しない) */
.recipe-product {
  margin-top: 36px;
  background: var(--color-bg-alt);
  border-radius: 12px;
  padding: 28px 24px 30px;
  text-align: center;
}

.recipe-product h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--color-text-soft);
  margin: 0 0 14px;
  border: none;
  padding: 0;
}

.recipe-product-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text);
}

.recipe-product-desc {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 2;
  color: var(--color-text-soft);
  margin: 0 0 22px;
}

/* ===== 関連レシピ ===== */
.recipe-related {
  max-width: var(--content-max);
  margin: 56px auto 0;
  padding: 0 var(--content-pad);
  text-align: center;
}

.recipe-related h2 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
  margin: 0 0 18px;
}

.recipe-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
}

.recipe-related a {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.9;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-line-light);
  padding-bottom: 2px;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.recipe-related a:hover {
  color: var(--color-accent-2);
  border-bottom-color: var(--color-accent-2);
}

/* ===== スマホ幅(〜480px) ===== */
@media (max-width: 480px) {
  .recipe-list { grid-template-columns: 1fr; gap: 20px; }
  .recipe-body h2 { font-size: 18px; margin-top: 44px; }
  .recipe-body p,
  .recipe-body ul li,
  .recipe-steps li { font-size: 14.5px; line-height: 2; }
  .recipe-steps li { padding-left: 38px; }
  .recipe-steps li::before { width: 24px; height: 24px; font-size: 12px; }
  .recipe-ingredients { padding: 16px 18px; }
  .recipe-product { padding: 24px 18px 26px; }
  .recipe-product-name { font-size: 21px; }
  .recipe-q { font-size: 14.5px; margin-top: 24px; }
  .recipe-related { margin-top: 44px; }
  .recipe-related ul { flex-direction: column; gap: 10px; }
}

/* ===== 動きを控えめにする設定を尊重 ===== */
@media (prefers-reduced-motion: reduce) {
  .recipe-card,
  .recipe-cta-guide,
  .recipe-related a { transition: none; }
  .recipe-card:hover { transform: none; }
}
