/*
Theme Name: MYREPTILES.JP
Author: Mr. Nano
Description: MYREPTILES.JP（爬虫類・両生類飼育メディア）専用ブロックテーマ。dawless テーマ v1.3.2 から派生。色は theme.json が正本。
Version: 0.1.1
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: myreptiles
*/

/* =========================================================
 * 原則: 色・パレット・タイポは theme.json に書く。
 * レイアウトの余白・罫線はテンプレートに JSON スタイルを書かず、
 * ここに className 経由で書く（ブロック検証エラーを避けるため。
 * 手書きテンプレートに style 属性系の JSON を入れると、
 * エディタの想定シリアライズと一致せず「無効なコンテンツ」になる）。
 * ========================================================= */

/* ---- ヘッダー ---- */
.site-header {
  padding: 1.1rem 0;
}

/* タップターゲット確保（WCAG 2.5.8）: padding で高さ約40px */
.site-nav a {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  padding: 0.625rem 0.5rem;
  margin-left: 0.5rem;
}

.site-nav a:first-child {
  margin-left: 0;
}

/* #e08a4a は暗地専用アクセント（白地では 1.84:1 で使用禁止）。ヘッダーは暗地なので可 */
.site-nav a:hover {
  color: var(--wp--preset--color--accent, #e08a4a);
}

/* ---- メイン ---- */
.site-main {
  padding: 2.5rem 0 4.5rem;
}

/* 記事一覧の1件分（罫線 #f7f3ec は白地で1.04:1=不可視のため #d4d8d6 に） */
.post-list-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid #d4d8d6;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--wp--preset--color--muted, #6b625a);
}

/* 更新日（公開日と同日なら目立たせない。ラベルはCSSで付与） */
.post-meta .post-modified::before {
  content: "更新: ";
}

.post-byline {
  font-size: 0.875rem;
  color: var(--wp--preset--color--muted, #6b625a);
}

.post-byline a {
  color: inherit;
  text-decoration: underline;
}

.post-nav {
  margin-top: 3rem;
}

/* ---- フッター ---- */
.site-footer {
  padding: 2.5rem 0;
}

.site-footer-nav,
.site-footer-copy {
  font-size: 0.875rem;
}

/* フッターナビ: タップ領域48px・モバイルは2列グリッド */
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.5rem;
}

.site-footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.75rem;
}

.site-footer a {
  color: var(--wp--preset--color--base, #ffffff);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--wp--preset--color--accent, #e08a4a);
}

@media (max-width: 600px) {
  .site-footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: start;
  }
}

/* =========================================================
 * 広告表記（functions.php が全記事冒頭に自動挿入する）
 *
 * 目立たせすぎず、しかし読み飛ばされない濃度にする。
 * 薄いグレーの小さい字にすると「隠している」と判断されうるため、
 * 本文と同等の可読性を確保する。
 * ========================================================= */
/* v1.0.7: 開示文は記事末尾の注意書きへ移動（functions.php参照）。控えめな脚注スタイル */
.gn-disclosure {
  margin: 2.5em 0 0;
  padding: 0.8em 1em;
  border-left: 3px solid var(--wp--preset--color--muted, #6b625a);
  background: var(--wp--preset--color--surface, #f7f3ec);
  color: var(--wp--preset--color--muted, #6b625a);
  font-size: 0.8rem;
  line-height: 1.7;
}

.gn-disclosure strong {
  color: var(--wp--preset--color--ink, #23201c);
}

/* =========================================================
 * 日本語の可読性
 * ========================================================= */
.entry-content p,
.wp-block-post-content p {
  letter-spacing: 0.02em;
}

.wp-block-post-content h2,
.wp-block-post-content h3 {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* 機材のパラメータ表は横スクロールで逃がす（表を崩さない） */
.wp-block-table {
  overflow-x: auto;
}

/* =========================================================
 * 評議会3反映（v1.0.5）
 * ========================================================= */

/* ---- モバイルの左右余白（390px実査で余白0だった対策） ---- */
@media (max-width: 781px) {
  .site-main > *,
  .site-header-inner,
  .site-footer > * {
    padding-inline: 20px;
  }
}

/* ---- リンクの非色手がかり＋フォーカスリング ---- */
.wp-block-post-content a:where(:not(.wp-element-button)) {
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.wp-block-post-content a:where(:not(.wp-element-button)):hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent-dark, #9a4b1e);
  outline-offset: 2px;
}

/* ---- 見出しの階層強化 ---- */
.wp-block-post-content h2 {
  padding-bottom: 0.4em;
  border-bottom: 1px solid #d4d8d6;
  margin-top: 3rem;
}

/* ---- 検証状態バッジ（二値状態システム） ---- */
.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.badge--verified {
  color: #005c41;
  background: #e6f5ef;
  border: 1px solid #9fd6c2;
}

.badge--unverified {
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f3d38a;
}

/* 未検証の説明ボックス（広告開示とは分離。琥珀=分類表示であって警告ではない） */
.verify-note {
  margin: 1em 0 0;
  padding: 0.8em 1em;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #f3d38a;
  color: #6b6455;
  font-size: 0.8rem;
  line-height: 1.7;
}

.verify-note p {
  margin: 0.5em 0 0;
}

.verify-line {
  margin: 0 0 1.5em;
}

/* ---- 所有者の結論ボックス（星評価の代替・定性3軸） ---- */
.owner-verdict {
  border: 2px solid var(--wp--preset--color--ink, #23201c);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0;
}

.owner-verdict__axes dt {
  font-weight: 700;
  margin-top: 0.75em;
}

.owner-verdict__axes dd {
  margin: 0.25em 0 0;
}

/* ---- 購入導線ボックス（PR表記を内包・店舗併記・黒ボタン） ---- */
.buy-box {
  border: 1px solid #d4d8d6;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 2.5rem 0;
}

.buy-box__pr {
  font-size: 0.8125rem;
  color: var(--wp--preset--color--muted, #6b625a);
  margin: 0 0 0.75em;
}

.buy-box__name {
  font-weight: 700;
  font-size: 1.0625rem;
  margin: 0 0 0.75em;
}

.buy-box__shops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.buy-box__shops a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 2px solid var(--wp--preset--color--ink, #23201c);
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  color: var(--wp--preset--color--ink, #23201c);
  min-height: 48px;
}

.buy-box__shops a:hover {
  background: var(--wp--preset--color--ink, #23201c);
  color: #ffffff;
}

.buy-box__shops .num {
  font-family: var(--wp--preset--font-family--mono);
  font-variant-numeric: tabular-nums;
}

/* ---- 橋渡しCTA ---- */
.bridge-cta {
  border-left: 3px solid var(--wp--preset--color--accent, #e08a4a);
  background: var(--wp--preset--color--surface, #f7f3ec);
  padding: 1rem 1.25rem;
  margin: 2.5rem 0;
}

.bridge-cta__label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--wp--preset--color--muted, #6b625a);
  margin: 0 0 0.25em;
  letter-spacing: 0.05em;
}

/* ---- 目次（プラグインなし・手動運用） ---- */
.toc {
  background: var(--wp--preset--color--surface, #f7f3ec);
  border: 1px solid #d4d8d6;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.25em;
}

.toc a {
  text-decoration: none;
}

/* ---- スペック表（出典caption・等幅数字・固定レイアウト打ち消し） ---- */
.spec-table table {
  table-layout: auto;
}

.spec-table .num {
  font-family: var(--wp--preset--font-family--mono);
  font-variant-numeric: tabular-nums;
}

.spec-table th[scope="row"] {
  width: 34%;
  font-weight: 500;
  color: var(--wp--preset--color--muted, #6b625a);
  text-align: left;
}

.spec-table caption {
  caption-side: bottom;
  font-size: 0.8125rem;
  color: var(--wp--preset--color--muted, #6b625a);
  text-align: left;
  padding-top: 0.5em;
}

/* ---- ハブページの導線カード ---- */
.hub-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.hub-path {
  display: block;
  padding: 1.25rem;
  border: 2px solid var(--wp--preset--color--ink, #23201c);
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  color: var(--wp--preset--color--ink, #23201c);
}

.hub-path:hover {
  background: var(--wp--preset--color--ink, #23201c);
  color: #ffffff;
}

/* ---- トップのヒーロー ---- */
.home-hero {
  padding: 3rem 0 2rem;
}

.home-hero__title {
  font-size: clamp(1.5rem, 1.5rem + 1.5vw, 2.25rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0 0 0.75em;
}

.home-hero__lead {
  font-size: 1rem;
  color: var(--wp--preset--color--muted, #6b625a);
  max-width: 36em;
}

/* ---- 接続図 ---- */
.wiring-diagram img {
  max-width: 100%;
  height: auto;
}


/* =========================================================
 * v1.0.8: 記事一覧のカードグリッド化（アイキャッチをトップから見せる）
 * ========================================================= */
.post-grid ul.wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 22px;
  list-style: none;
  padding: 0;
  margin: 0 0 2.5em;
}

@media (max-width: 620px) {
  .post-grid ul.wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

.post-grid li.wp-block-post {
  margin: 0;
}

.post-grid .post-card {
  background: #fff;
  border: 1px solid #e3e6e4;
  border-radius: 14px;
  overflow: hidden;
  height: 100%;
  box-shadow: 0 1px 3px rgba(26, 26, 26, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-grid .post-card:hover {
  box-shadow: 0 6px 18px rgba(26, 26, 26, 0.12);
  transform: translateY(-2px);
}

.post-grid .wp-block-post-featured-image {
  margin: 0;
}

.post-grid .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-grid .wp-block-post-title {
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0.9em 1.1em 0.3em;
}

.post-grid .wp-block-post-title a {
  text-decoration: none;
  color: var(--wp--preset--color--ink, #23201c);
}

.post-grid .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent-dark, #9a4b1e);
}

.post-grid .post-meta {
  margin: 0 1.2em;
  font-size: 0.75rem;
  color: var(--wp--preset--color--muted, #6b625a);
  gap: 0.8em;
}

.post-grid .post-meta a {
  color: inherit;
}

.post-grid .wp-block-post-excerpt {
  margin: 0.5em 1.2em 1.2em;
  font-size: 0.84rem;
  line-height: 1.7;
  color: var(--wp--preset--color--muted, #6b625a);
}

/* =========================================================
 * v1.1.0: トップページの複数セクション化
 * （新着 / 編集部ピックアップ帯 / カテゴリ別3列）
 * ========================================================= */
.home-sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  margin: 2.4em 0 1em;
  border-left: 4px solid var(--wp--preset--color--accent, #e08a4a);
  padding-left: 0.65em;
}

.home-sec__head h2 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.4;
}

.home-sec__more {
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--wp--preset--color--accent-dark, #9a4b1e);
  text-decoration: none;
}

.home-sec__more:hover {
  text-decoration: underline;
}

.home-band {
  background: #f0f6f3;
  border-radius: 18px;
  padding: 0.4em 1.3em 1.3em;
  margin: 2.6em 0;
}

.home-band .home-sec__head--band {
  margin-top: 1.2em;
}

.home-band .post-card {
  border-color: #d8e4de;
}

.post-grid--compact ul.wp-block-post-template {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 16px;
  margin-bottom: 1.6em;
}

@media (max-width: 820px) {
  .post-grid--compact ul.wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .post-grid--compact ul.wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

.post-grid--compact .wp-block-post-title {
  font-size: 0.92rem;
  margin: 0.75em 1em 0.4em;
}

.post-grid--compact .post-meta {
  margin: 0 1.1em 1em;
}


/* =========================================================
 * v1.2.1: buy-box 画像＋テキスト型（楽天発行画像）
 * ========================================================= */
.buy-box__body {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.buy-box__img {
  flex: 0 0 132px;
  display: block;
  border: 1px solid #e3e6e4;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.buy-box__img img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.buy-box__main {
  flex: 1 1 auto;
  min-width: 0;
}

.buy-box--with-image .buy-box__name {
  margin-top: 0.1em;
}

@media (max-width: 480px) {
  .buy-box__body {
    flex-direction: column;
  }

  .buy-box__img {
    flex-basis: auto;
    width: 160px;
  }
}
