/*
Theme Name: BODY UPDATE
Theme URI: https://karada-update.jp
Author: カラダアップデート編集部
Author URI: https://karada-update.jp/profile/
Description: 判定メディア「カラダアップデート」専用テーマ。プラグインゼロ運用・BODY UPDATE判定ブロック・E-E-A-T構造化データ自動出力。白×ニアブラック＋朱オレンジ(#FF3D00)のトレンドデザイン。
Version: 0.9.2
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: body-update
*/

/* ==========================================================
   BODY UPDATE — Design system (Figma準拠)
   白×ニアブラックのハイコントラスト + 朱オレンジ#FF3D00。
   ========================================================== */

:root {
  --bg: #FFFFFF;
  --surface: #F6F5F3;
  --ink: #0A0A0A;
  --text: #44423F;
  --muted: #8A8784;
  --faint: #B5B1AB;
  --line: #E7E4DF;
  --line-strong: #DAD6CF;
  --accent: #FF3D00;
  --accent-ink: #CC3100;
  --accent-soft: #FFE7E0;
  --green: #06C755;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 16px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { transition: color .2s ease, border-color .2s ease, background-color .2s ease; }
img { height: auto; max-width: 100%; }
section { scroll-margin-top: 72px; }

/* ---------- Type utilities ---------- */
.bu-eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.6rem;
}
.bu-section-title { font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.bu-lede, .bu-body { color: var(--text); line-height: 1.9; }
.bu-caption { font-size: 0.8rem; color: var(--muted); }

/* numbers in Inter tabular */
.bu-num { font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.wp-element-button, .wp-block-button__link { border-radius: var(--r-md) !important; font-weight: 600; letter-spacing: 0.02em; }
.bu-btn-text {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Inter','Noto Sans JP',sans-serif; font-weight: 600; font-size: 0.85rem;
  color: var(--accent-ink);
}
.bu-btn-text:hover { color: var(--accent); }
.bu-btn-text::after { content: "→"; }

/* ---------- Header ---------- */
.wp-block-template-part header, header.wp-block-group {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.bu-logo { font-family:'Inter',sans-serif; font-weight:700; letter-spacing:-0.01em; line-height:1.05; }
.bu-logo small {
  display:block; font-size:0.5rem; letter-spacing:0.3em; text-transform:uppercase; color:var(--muted); font-weight:700;
}
header .wp-block-navigation .wp-block-navigation-item__content {
  font-size: 0.86rem; color: var(--text); font-weight: 500;
}
header .wp-block-navigation a:hover .wp-block-navigation-item__content,
header .wp-block-navigation .current-menu-item .wp-block-navigation-item__content { color: var(--accent); }
.bu-header-cta a {
  background: var(--accent) !important; color: #fff !important; border-radius: var(--r-md) !important;
  min-height: 38px; padding: 8px 18px !important; font-size: 0.8rem !important; font-weight: 600;
}
.bu-header-cta a:hover { background: var(--accent-ink) !important; }

/* ---------- Footer ---------- */
.wp-block-template-part footer, footer.wp-block-group {
  background: var(--ink) !important; color: #EDEAE6 !important; text-align: center;
}
.bu-footer-nav a { text-decoration: none; }
.bu-footer-nav a:hover { text-decoration: underline; color:#fff; }

/* ---------- Cards (article / verdict list) ---------- */
.bu-card { background: var(--bg); border: 0; transition: transform .2s ease; }
.bu-card .wp-block-post-featured-image { border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.bu-card .wp-block-post-featured-image img { transition: transform .5s ease; }
.bu-card:hover .wp-block-post-featured-image img { transform: scale(1.05); }
.bu-card .wp-block-post-title { font-weight: 700; line-height: 1.5; }
.bu-card .wp-block-post-title a { border-bottom: 2px solid transparent; }
.bu-card:hover .wp-block-post-title a { border-bottom-color: var(--accent); }
.bu-card .wp-block-post-terms { font-family:'Inter','Noto Sans JP',sans-serif; font-weight:700; font-size:0.66rem; letter-spacing:0.16em; text-transform:uppercase; color:var(--accent-ink); }
/* 判定タグ（カテゴリの隣に手動で置く想定） */
.bu-tag-verdict {
  display:inline-block; border:1px solid var(--accent); color:var(--accent-ink);
  font-size:0.62rem; font-weight:700; padding:1px 6px; border-radius:4px; letter-spacing:.06em;
}
/* 署名行 */
.bu-byline { display:flex; align-items:center; gap:8px; }
.bu-byline__avatar { width:24px; height:24px; border-radius:50%; background:var(--surface); border:1px solid var(--line); display:inline-flex; align-items:center; justify-content:center; font-size:0.66rem; font-weight:700; color:var(--ink); flex:0 0 auto; }
.bu-byline__name { font-size:0.72rem; color:var(--muted); }
.bu-score { font-family:'Inter',sans-serif; font-weight:700; font-variant-numeric:tabular-nums; color:var(--accent); font-size:0.82rem; }
.bu-score::before { content:"★ "; }

/* section helpers */
.bu-section-surface { background: var(--surface); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.bu-section-deep { background: var(--ink); color: #EDEAE6; }
.bu-section-accent { background: var(--accent); color: #fff; }

/* tables */
.wp-block-table { overflow-x:auto; }
.wp-block-table table { min-width:480px; border-collapse:collapse; }
.wp-block-table th,.wp-block-table td { border:1px solid var(--line); padding:0.6rem 0.8rem; }
.wp-block-table thead th { background:var(--surface); }

/* ---------- Ranking ---------- */
.bu-rank { list-style:none; margin:0; padding:0; }
.bu-rank__item { display:grid; grid-template-columns:auto 96px 1fr auto; gap:16px; align-items:center; padding:16px 0; border-top:1px solid var(--line); }
.bu-rank__item:last-child { border-bottom:1px solid var(--line); }
.bu-rank__no { font-family:'Inter',sans-serif; font-weight:700; font-size:1.5rem; color:var(--accent); width:1.4em; text-align:center; }
.bu-rank__thumb { width:96px; height:62px; object-fit:cover; border-radius:var(--r-sm); background:var(--surface); }
.bu-rank__title { font-weight:700; line-height:1.5; font-size:0.95rem; color:var(--ink); }
@media (max-width:600px){ .bu-rank__item{ grid-template-columns:auto 72px 1fr; } .bu-rank__thumb{width:72px;height:48px;} .bu-rank__score{display:none;} }

/* ---------- Keywords (tag cloud) ---------- */
.bu-keywords { display:flex; flex-wrap:wrap; gap:10px; }
.bu-keywords a {
  display:inline-block; padding:8px 16px; border:1px solid var(--line); border-radius:999px;
  font-size:0.85rem; color:var(--text); background:var(--bg);
}
.bu-keywords a:hover { border-color:var(--accent); color:var(--accent); }

/* ==========================================================
   カスタムブロック（Figmaの判定カード準拠に再スタイル）
   ========================================================== */

/* --- BODY UPDATE判定 --- */
.bu-verdict { background:var(--bg); border:1px solid var(--line); border-radius:var(--r-xl); padding:1.5rem; margin:2.5rem 0; }
.bu-verdict__head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.25rem; }
.bu-verdict__brand {
  display:inline-block; background:var(--accent); color:#fff; font-family:'Inter',sans-serif;
  font-size:0.6rem; font-weight:700; letter-spacing:0.18em; text-transform:uppercase; padding:3px 8px; border-radius:4px; margin-bottom:0.5rem;
}
.bu-verdict__topic { font-weight:700; font-size:0.9rem; color:var(--ink); margin:0; }
.bu-verdict__topic-label { font-size:0.72rem; color:var(--muted); margin:0 0 2px; }
.bu-verdict__total { text-align:right; flex:0 0 auto; }
.bu-verdict__total-label { font-family:'Inter',sans-serif; font-size:0.6rem; letter-spacing:0.18em; text-transform:uppercase; color:var(--muted); margin:0 0 2px; }
.bu-verdict__total-score { font-family:'Inter',sans-serif; font-weight:700; font-size:2.2rem; line-height:1; color:var(--accent); font-variant-numeric:tabular-nums; }
.bu-verdict__total-score small { font-size:0.85rem; color:var(--muted); font-weight:400; }
.bu-verdict__list { list-style:none; margin:0 0 1.25rem; padding:0; }
.bu-verdict__row { display:flex; align-items:center; gap:1rem; padding:0.55rem 0; }
.bu-verdict__label { flex:0 0 7.5em; font-size:0.86rem; color:var(--text); }
.bu-verdict__meter { flex:1; height:6px; background:var(--surface); border-radius:999px; overflow:hidden; }
.bu-verdict__meter span { display:block; height:100%; background:var(--accent); border-radius:999px; }
.bu-verdict__value { font-family:'Inter',sans-serif; font-weight:700; font-variant-numeric:tabular-nums; color:var(--ink); font-size:0.85rem; width:2.2em; text-align:right; }
.bu-verdict__row--overall { border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:0.9rem 0; }
.bu-verdict__row--overall .bu-verdict__label { font-weight:700; color:var(--ink); }
.bu-verdict__row--overall .bu-verdict__value { color:var(--accent); }
.bu-verdict__oneliner { background:var(--accent-soft); border-radius:var(--r-md); padding:1rem; margin-top:1.25rem; }
.bu-verdict__oneliner-label { font-family:'Inter',sans-serif; font-size:0.6rem; font-weight:700; letter-spacing:0.18em; text-transform:uppercase; color:var(--accent-ink); display:block; margin-bottom:0.4rem; }
.bu-verdict__oneliner p { margin:0; font-weight:500; color:var(--ink); }

/* スター系の旧マークアップ互換 */
.bu-verdict__stars { color:var(--accent); letter-spacing:0.12em; }

/* --- 向いている人 / メリデメ --- */
.bu-suited { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); border:1px solid var(--line); border-radius:var(--r-lg); overflow:hidden; margin:2.5rem 0; }
@media (max-width:600px){ .bu-suited{ grid-template-columns:1fr; } }
.bu-suited__col { background:var(--bg); padding:1.25rem 1.4rem; }
.bu-suited__col--no { background:var(--surface); }
.bu-suited__title { font-weight:700; font-size:0.92rem; margin:0 0 0.7rem; padding-bottom:0.5rem; border-bottom:1px solid var(--line); }
.bu-suited__col--yes .bu-suited__title { color:var(--ink); }
.bu-suited__col--no .bu-suited__title { color:var(--accent-ink); }
.bu-suited__col ul { margin:0; padding-left:1.1em; }
.bu-suited__col li { margin:0.4rem 0; color:var(--text); }

/* --- 専門家コメント --- */
.bu-expert { border-left:3px solid var(--accent); padding:0.3rem 0 0.3rem 1.4rem; margin:2.5rem 0; }
.bu-expert__label { font-family:'Inter',sans-serif; font-weight:700; font-size:0.6rem; letter-spacing:0.18em; text-transform:uppercase; color:var(--accent-ink); margin:0 0 0.5rem; }
.bu-expert__comment { font-size:1.05rem; line-height:1.7; color:var(--ink); margin:0 0 0.7rem; font-weight:500; }
.bu-expert__meta { margin:0; font-size:0.8rem; color:var(--muted); }
.bu-expert__name { font-weight:700; color:var(--ink); margin-right:0.6em; }

/* --- FAQ --- */
.bu-faq { margin:3rem 0; }
.bu-faq__heading { font-size:var(--wp--preset--font-size--x-large); font-weight:700; margin-bottom:1rem; }
.bu-faq-item { border:0; border-top:1px solid var(--line); background:transparent; }
.bu-faq-item:last-child { border-bottom:1px solid var(--line); }
.bu-faq-item__q { display:flex; align-items:baseline; gap:0.6rem; padding:1.1rem 0; font-weight:700; color:var(--ink); cursor:pointer; list-style:none; }
.bu-faq-item__q::-webkit-details-marker { display:none; }
.bu-faq-item__q::after { content:"+"; margin-left:auto; color:var(--accent); font-weight:400; font-size:1.3rem; line-height:1; transition:transform .2s ease; }
.bu-faq-item[open] .bu-faq-item__q::after { transform:rotate(45deg); }
.bu-faq-item__a { display:flex; align-items:baseline; gap:0.6rem; padding:0 0 1.1rem; color:var(--text); }
.bu-faq-item__a p { margin:0; line-height:1.9; }
.bu-faq-item__marker { flex:0 0 auto; font-weight:700; color:var(--muted); }
.bu-faq-item__marker--a { color:var(--accent); }
.bu-faq-item--editor { padding-bottom:0.5rem; }
.bu-faq-item--editor .bu-faq-item__q::after { content:none; }

/* --- 3ステップ --- */
.bu-step { margin:2.5rem 0; }
.bu-step__heading { font-family:'Inter',sans-serif; font-weight:700; font-size:0.66rem; letter-spacing:0.2em; text-transform:uppercase; color:var(--accent-ink); margin:0 0 1rem; }
.bu-step__heading::before { content:none; }
.bu-step__list { list-style:none; counter-reset:bu-step; margin:0; padding:0; border-top:1px solid var(--line); }
.bu-step__list li { counter-increment:bu-step; display:grid; grid-template-columns:48px 1fr; gap:1rem; align-items:baseline; padding:1rem 0; border-bottom:1px solid var(--line); }
.bu-step__list li::before { content:counter(bu-step,decimal-leading-zero); font-family:'Inter',sans-serif; font-weight:700; color:var(--accent); }

/* --- CTA --- */
.bu-cta { background:var(--ink); color:#fff; padding:3rem 1.75rem; margin:3rem 0; text-align:center; border-radius:var(--r-xl); }
.bu-cta__heading { font-weight:700; font-size:clamp(1.4rem,3vw,2rem); margin:0 0 0.6rem; color:#fff; }
.bu-cta__text { font-size:0.9rem; margin:0 0 1.5rem; color:rgba(255,255,255,.72); }
.bu-cta__buttons { display:flex; flex-wrap:wrap; gap:0.8rem; justify-content:center; }
.bu-cta__btn { display:inline-flex; align-items:center; justify-content:center; min-height:48px; padding:0.85em 1.9em; font-family:'Inter','Noto Sans JP',sans-serif; font-weight:600; font-size:0.9rem; text-decoration:none; border-radius:var(--r-md); }
.bu-cta__btn--shindan { background:var(--accent); color:#fff !important; }
.bu-cta__btn--shindan:hover { background:var(--accent-ink); }
.bu-cta__btn--line { background:var(--green); color:#fff !important; }
.bu-cta__btn--line:hover { opacity:.9; }

/* --- スコアバッジ --- */
.bu-badge { display:inline-flex; align-items:center; gap:0.6em; background:var(--accent-soft); color:var(--accent-ink); border-radius:999px; padding:0.35em 1em; font-size:0.85rem; margin:0.5rem 0; }
.bu-badge__label { font-family:'Inter',sans-serif; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; font-size:0.66rem; }
.bu-badge__stars { color:var(--accent); }
.bu-badge__score { font-family:'Inter',sans-serif; font-weight:700; font-variant-numeric:tabular-nums; }

/* --- PR・免責 --- */
.bu-disclosure { border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:0.85rem 0; margin:1.5rem 0; }
.bu-disclosure p { margin:0; font-size:0.76rem; color:var(--muted); line-height:1.8; }
.bu-disclosure--pr p::before { content:"PR"; display:inline-block; font-family:'Inter',sans-serif; color:var(--accent-ink); border:1px solid var(--accent); font-weight:700; font-size:0.6rem; padding:0 0.4em; margin-right:0.6em; border-radius:3px; }

/* ==========================================================
   カラダタイプ診断（/shindan/）
   ========================================================== */
.bu-shindan__card { border:1px solid var(--line); border-radius:var(--r-xl); padding:2rem 1.5rem; margin:1.75rem 0; background:var(--bg); }
.bu-shindan__lead { color:var(--muted); font-size:0.92rem; }
.bu-shindan__progress { height:4px; background:var(--surface); border-radius:999px; overflow:hidden; margin-bottom:1rem; }
.bu-shindan__progress-fill { height:100%; background:var(--accent); transition:width .25s ease; }
.bu-shindan__count { font-family:'Inter',sans-serif; font-size:0.7rem; letter-spacing:0.16em; text-transform:uppercase; color:var(--muted); margin:0 0 0.5rem; }
.bu-shindan__q { font-size:1.2rem; font-weight:700; color:var(--ink); margin:0 0 1.25rem; line-height:1.5; }
.bu-shindan__choice { display:block; width:100%; text-align:left; background:var(--bg); border:1px solid var(--line); border-radius:var(--r-md); padding:1rem 1.1rem; margin:0.6rem 0; font-size:0.98rem; color:var(--text); cursor:pointer; transition:border-color .2s ease, background .2s ease, color .2s ease; }
.bu-shindan__choice:hover { border-color:var(--accent); background:var(--accent-soft); color:var(--ink); }
.bu-shindan__btn { display:block; width:100%; text-align:center; background:var(--accent); color:#fff !important; border:none; border-radius:var(--r-md); padding:1em 1.5em; font-family:'Inter','Noto Sans JP',sans-serif; font-size:0.95rem; font-weight:700; cursor:pointer; text-decoration:none; margin-top:0.6rem; }
.bu-shindan__btn:hover { background:var(--accent-ink); }
.bu-shindan__btn--line { background:var(--green); }
.bu-shindan__btn--line:hover { opacity:.9; background:var(--green); }
.bu-shindan__result-label { font-family:'Inter',sans-serif; font-size:0.7rem; letter-spacing:0.16em; text-transform:uppercase; color:var(--muted); margin:0; }
.bu-shindan__result-name { font-size:1.6rem; font-weight:700; color:var(--ink); margin:0.3rem 0; }
.bu-shindan__result-catch { font-weight:700; color:var(--accent); margin:0 0 1rem; }
.bu-shindan__caution { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md); padding:1rem 1.1rem; font-size:0.86rem; color:var(--text); }
.bu-shindan__sub { font-family:'Inter',sans-serif; font-weight:700; font-size:0.7rem; letter-spacing:0.16em; text-transform:uppercase; color:var(--muted); margin:1.5rem 0 0.5rem; }
.bu-shindan__steps { margin:0; padding-left:1.3em; }
.bu-shindan__steps li { margin:0.4rem 0; }
.bu-shindan__links { margin:0; padding-left:0; list-style:none; }
.bu-shindan__links li { margin:0; border-bottom:1px solid var(--line); }
.bu-shindan__links li:first-child { border-top:1px solid var(--line); }
.bu-shindan__links a { display:block; padding:0.85rem 0; }
.bu-shindan__again { display:block; margin:1.1rem auto 0; background:none; border:none; color:var(--muted); font-size:0.82rem; text-decoration:underline; cursor:pointer; }

/* ---------- 小数スター（0.1刻み表示） ---------- */
.bu-stars { position: relative; display: inline-block; line-height: 1; white-space: nowrap; font-size: 1em; letter-spacing: 0.05em; }
.bu-stars__bg { color: var(--line-strong); }
.bu-stars__fg { position: absolute; top: 0; left: 0; overflow: hidden; color: var(--accent); white-space: nowrap; letter-spacing: 0.05em; }
.bu-badge .bu-stars { font-size: 0.95rem; }
.bu-verdict__stars .bu-stars, .bu-verdict__value + .bu-stars { font-size: 1rem; }

/* ---------- ヘッダーロゴ（カスタムロゴ画像） ---------- */
.wp-block-site-logo a { display: inline-flex; }
.wp-block-site-logo img { max-height: 30px; width: auto; height: auto; display: block; }
