/*
Theme Name: BROCON5 Lab
Template: twentytwentyfive
Description: BROCON5 の子テーマ。実物ロボット（赤いブリキと計器盤）に合わせた「計測ログ」の見た目。Twenty Twenty-Five の上に載る。
Version: 1.1.1
Text Domain: brocon5-lab
*/

/* ---------- 色と書体（theme.json と同じ値・ここが正） ---------- */
:root {
  --b5-paper: #FFFFFF;
  --b5-surface: #F7F6F3;
  --b5-ink: #1E1B18;
  --b5-muted: #6B635A;
  --b5-rule: #E6E3DE;
  --b5-red: #B5261E;
  --b5-red-dark: #8E1D17;
  --b5-dial: #EDE3C8;
  --b5-crt: #8BE39B;
  --b5-brass: #9A7A3A;
  --b5-sans: "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --b5-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --b5-wide: 1120px;
  --b5-text: 720px;
}

body {
  background: var(--b5-paper);
  color: var(--b5-ink);
  font-family: var(--b5-sans);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 共通の部品 ---------- */
.b5-wrap { max-width: var(--b5-wide); margin-inline: auto; padding-inline: 20px; box-sizing: border-box; }
.b5-label {
  font-family: var(--b5-mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--b5-muted);
  margin: 0 0 12px;
}
.b5-label::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--b5-red); margin-right: 10px; vertical-align: 1px; }

.b5-section { padding-block: 72px; border-top: 1px solid var(--b5-rule); }
.b5-section__title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 28px;
  letter-spacing: .02em;
}

/* ボタン（WordPress のボタンブロックにも効く） */
.b5-btn .wp-block-button__link,
.b5-btn > a,
.wp-block-button.b5-btn-primary .wp-block-button__link {
  display: inline-block;
  background: var(--b5-red);
  color: #fff;
  border: 2px solid var(--b5-red);
  border-radius: 4px;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.b5-btn .wp-block-button__link:hover,
.b5-btn > a:hover,
.wp-block-button.b5-btn-primary .wp-block-button__link:hover { background: var(--b5-red-dark); border-color: var(--b5-red-dark); }
.wp-block-button.b5-btn-ghost .wp-block-button__link,
.b5-btn-ghost > a {
  display: inline-block;
  background: transparent;
  color: var(--b5-ink);
  border: 2px solid var(--b5-ink);
  border-radius: 4px;
  padding: 14px 26px;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
}
@media (hover: hover) {
  .wp-block-button.b5-btn-ghost .wp-block-button__link:hover,
  .b5-btn-ghost > a:hover { background: var(--b5-ink); color: var(--b5-paper); }
}
.b5-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ---------- ヘッダー ---------- */
.b5-header { border-bottom: 1px solid var(--b5-rule); background: var(--b5-paper); }
.b5-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.b5-logo { font-family: var(--b5-mono); font-weight: 600; font-size: 20px; letter-spacing: .08em; color: var(--b5-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.b5-logo a { color: inherit; text-decoration: none; }
.b5-logo::before { content: ""; width: 14px; height: 14px; background: var(--b5-red); border-radius: 2px; }
.b5-nav { display: flex; gap: 22px; font-size: 14px; }
.b5-nav a { color: var(--b5-ink); text-decoration: none; }
.b5-nav a:hover { color: var(--b5-red); }

/* ---------- 1. 冒頭（X のプロフィールと同じ型＝横長の絵＋丸いアイコン） ---------- */
.b5-hero { padding-block: 24px 56px; }
.b5-hero__banner { margin: 0; }
.b5-hero__banner img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 10px; background: #1b1715; }
.b5-hero__body { display: grid; grid-template-columns: auto 1fr; gap: 0 28px; align-items: end; padding-inline: 24px; }
.b5-hero__avatar { margin: -72px 0 0; }
.b5-hero__avatar img { display: block; width: 168px; height: 168px; border-radius: 50%; object-fit: cover; background: #fff; border: 5px solid #fff; box-shadow: 0 1px 0 var(--b5-rule); }
.b5-hero__name { font-family: var(--b5-mono); font-weight: 600; font-size: 22px; letter-spacing: .08em; margin: 0 0 6px; }
.b5-hero__text { padding-inline: 24px; margin-top: 28px; }
.b5-hero__title {
  font-size: clamp(22px, 7.6vw, 54px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .01em;
  margin: 0 0 16px;
}
.b5-hero__title em { font-style: normal; color: var(--b5-red); }
/* 文は区切りの位置でだけ折り返す（幅があれば1行のまま・11/16 本人「変なところで改行」） */
.b5-hero__title i, .b5-hero__lead i, .b5-rule__text i, .b5-about__text i { font-style: normal; display: inline-block; }   /* 読点の位置でだけ折り返す */
.b5-hero__lead { font-size: 17px; color: var(--b5-muted); margin: 0; }

/* 日本語を単語の途中で折らない（「ロ／ボット」「チェック／リスト」の割れを防ぐ・11/16 本人指摘） */
body { word-break: auto-phrase; }

/* ---------- 2. 計器盤（最新の実測の数字） ---------- */
.b5-meter { background: var(--b5-ink); color: var(--b5-paper); border-radius: 8px; padding: 28px 28px 24px; }
.b5-meter__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid #3a352f; padding-bottom: 16px; margin-bottom: 20px; }
.b5-meter__no { font-family: var(--b5-mono); font-size: 12px; letter-spacing: .14em; color: var(--b5-dial); margin: 0; }
.b5-meter__title { font-size: 18px; font-weight: 700; margin: 4px 0 0; line-height: 1.5; }
.b5-meter__title a { color: var(--b5-paper); text-decoration: none; }
.b5-meter__title a:hover { text-decoration: underline; }
.b5-meter__date { font-family: var(--b5-mono); font-size: 13px; color: #a79f93; margin: 0; }
.b5-readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.b5-readout { background: #141a15; border: 1px solid #2c362e; border-radius: 6px; padding: 16px 18px; }
.b5-readout__value { font-family: var(--b5-mono); font-weight: 600; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.1; color: var(--b5-crt); text-shadow: 0 0 12px rgba(139,227,155,.35); margin: 0; }
.b5-readout__value small { font-size: .5em; margin-left: 4px; color: #a79f93; font-weight: 500; }
.b5-readout__label { font-size: 13px; color: #a79f93; margin: 8px 0 0; }
.b5-meter__note { font-size: 13px; color: #a79f93; margin: 16px 0 0; }
.b5-meter__more { margin: 20px 0 0; }
.b5-meter__more a { color: var(--b5-dial); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--b5-dial); padding-bottom: 2px; }

/* ---------- 3. 測り方の決まり ---------- */
.b5-rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--b5-rule); border-radius: 6px; background: var(--b5-surface); }
.b5-rule { padding: 26px 24px; border-left: 1px solid var(--b5-rule); }
.b5-rule:first-child { border-left: 0; }
.b5-rule__no { font-family: var(--b5-mono); color: var(--b5-red); font-size: 13px; letter-spacing: .1em; margin: 0 0 10px; }
.b5-rule__title { font-size: 18px; font-weight: 700; margin: 0 0 8px; line-height: 1.5; }
.b5-rule__text { font-size: 15px; color: var(--b5-muted); margin: 0; line-height: 1.8; }

/* ---------- 4. 記録の一覧（クエリループ） ---------- */
.b5-log > ul, ul.b5-log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--b5-ink); }
.b5-log .wp-block-post,
.b5-log > li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--b5-rule); margin: 0; }
.b5-log .wp-block-post-date,
.b5-log__date { font-family: var(--b5-mono); font-size: 14px; color: var(--b5-muted); margin: 0; padding-top: 3px; }
.b5-log .wp-block-post-title,
.b5-log__title { font-size: 18px; font-weight: 700; margin: 0; line-height: 1.6; }
.b5-log .wp-block-post-title a,
.b5-log__title a { color: var(--b5-ink); text-decoration: none; }
.b5-log .wp-block-post-title a:hover,
.b5-log__title a:hover { color: var(--b5-red); }

/* ---------- 5. 特典 ---------- */
.b5-gift { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; background: var(--b5-dial); border: 1px solid #d8cba6; border-radius: 8px; padding: 36px; }
.b5-gift__title { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; margin: 0 0 10px; line-height: 1.5; }
.b5-gift__text { margin: 0; color: #4a443d; }
.b5-keyword { font-family: var(--b5-mono); font-weight: 600; background: var(--b5-ink); color: var(--b5-dial); padding: 2px 10px; border-radius: 3px; white-space: nowrap; }

/* ---------- 6. 書き手 ---------- */
.b5-about { display: grid; grid-template-columns: 160px 1fr; gap: 32px; align-items: start; }
.b5-about__photo { margin: 0; }
.b5-about__photo img { display: block; width: 160px; height: 160px; object-fit: cover; border-radius: 50%; border: 1px solid var(--b5-rule); background: #fff; }
.b5-about__name { font-family: var(--b5-mono); font-weight: 600; font-size: 20px; letter-spacing: .08em; margin: 0 0 8px; }
.b5-about__text { margin: 0 0 12px; }
.b5-about__link a { color: var(--b5-red); font-weight: 700; }

/* ---------- フッター ---------- */
.b5-footer { background: var(--b5-ink); color: #a79f93; padding-block: 40px; font-size: 13px; }
.b5-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.b5-footer a { color: var(--b5-paper); text-decoration: none; margin-right: 18px; }
.b5-footer a:hover { text-decoration: underline; }
.b5-footer__note { margin: 12px 0 0; max-width: 46em; line-height: 1.7; }
.b5-footer p { margin: 0; }

/* ---------- 記事ページの型 ---------- */
.single .wp-block-post-title,
.page .wp-block-post-title { font-size: clamp(26px, 4vw, 38px); line-height: 1.4; font-weight: 700; }
.entry-content { font-size: 17px; }
.entry-content h2 {
  font-size: clamp(21px, 2.8vw, 26px);
  font-weight: 700;
  line-height: 1.5;
  margin: 2.6em 0 .9em;
  padding-top: 14px;
  border-top: 2px solid var(--b5-ink);
  position: relative;
}
.entry-content h2::before { content: ""; position: absolute; top: -2px; left: 0; width: 48px; height: 2px; background: var(--b5-red); }
.entry-content h3 { font-size: 19px; font-weight: 700; margin: 2em 0 .6em; padding-left: 12px; border-left: 4px solid var(--b5-red); line-height: 1.5; }
.entry-content a { color: var(--b5-red); text-underline-offset: 3px; }
.entry-content strong { background: linear-gradient(transparent 62%, var(--b5-dial) 62%); font-weight: 700; }

/* 表 */
.entry-content .wp-block-table table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--b5-surface); }
.entry-content .wp-block-table th,
.entry-content .wp-block-table thead td { background: var(--b5-ink); color: var(--b5-paper); font-weight: 700; text-align: left; padding: 12px 14px; border: 1px solid var(--b5-ink); }
.entry-content .wp-block-table td { padding: 12px 14px; border: 1px solid var(--b5-rule); vertical-align: top; }
.entry-content .wp-block-table td:nth-child(2) { font-family: var(--b5-mono); white-space: nowrap; }
.entry-content .wp-block-table thead { border-bottom: 0; }

/* 広告の表記（記事の冒頭の段落に class「b5-pr」） */
.b5-pr { font-size: 13px; color: var(--b5-muted); background: var(--b5-surface); border: 1px solid var(--b5-rule); border-radius: 4px; padding: 10px 14px; line-height: 1.7; }

/* 実測サマリー枠（パターン「BROCON5 実測サマリー」） */
.b5-summary { background: var(--b5-ink); color: var(--b5-paper); border-radius: 8px; padding: 22px 24px; margin: 1.6em 0 2.2em; }
.b5-summary .b5-summary__label { font-family: var(--b5-mono); font-size: 12px; letter-spacing: .14em; color: var(--b5-dial); margin: 0 0 14px; }
.b5-summary .b5-readouts { margin: 0; }
.b5-summary .b5-summary__conclusion { margin: 16px 0 0; font-size: 15px; line-height: 1.8; color: var(--b5-paper); }

/* ロボットのひとこと（パターン「BROCON5 のひとこと」） */
.b5-say { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; margin: 1.6em 0; }
.b5-say__face { margin: 0; }
.b5-say__face img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--b5-rule); background: #fff; display: block; }
.b5-say__bubble { position: relative; background: var(--b5-surface); border: 1px solid var(--b5-rule); border-radius: 6px; padding: 12px 16px; margin: 0; font-size: 15px; line-height: 1.8; }
.b5-say__bubble::before { content: ""; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; background: var(--b5-surface); border-left: 1px solid var(--b5-rule); border-bottom: 1px solid var(--b5-rule); transform: rotate(45deg); }


/* ---------- ブロックテーマの既定の余白を、この子テーマの部品の中だけ消す ---------- */
.b5-main .is-layout-flow > *,
.b5-header .is-layout-flow > *,
.b5-footer .is-layout-flow > *,
.b5-summary.is-layout-flow > *,
.b5-summary .is-layout-flow > *,
.b5-say.is-layout-flow > * { margin-block-start: 0; }
.b5-main, .b5-header, .b5-footer { margin-block-start: 0 !important; }
.b5-main .wp-block-image, .b5-say .wp-block-image { margin: 0; }
.b5-hero__body .wp-block-image.b5-hero__avatar { margin-top: -72px; }
.b5-nav { margin: 0; }
.b5-log .wp-block-post-template { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--b5-ink); }
.b5-log { border-top: 0; }
.b5-gift .wp-block-buttons { margin: 0; }
@media (max-width: 600px) {
  .b5-hero__body .wp-block-image.b5-hero__avatar { margin-top: -44px; }
}


/* 上の余白消しより強く効かせる（部品ごとの上の余白） */
.b5-main .b5-buttons { margin-top: 32px; }
.b5-main .b5-hero__text { margin-top: 28px; }
.b5-main .b5-meter__title { margin-top: 4px; }
.b5-main .b5-readout__label { margin-top: 8px; }
.b5-main .b5-meter__note, .b5-summary .b5-summary__conclusion { margin-top: 16px; }
.b5-main .b5-meter__more { margin-top: 20px; }
.b5-footer .b5-footer__note { margin-top: 12px; }
@media (max-width: 600px) {
  .b5-main .b5-readout__label { margin-top: 0; }
  .b5-main .b5-hero__text { margin-top: 22px; }
  .b5-buttons .wp-block-button.b5-btn-primary .wp-block-button__link,
  .b5-buttons .wp-block-button.b5-btn-ghost .wp-block-button__link,
  .b5-gift .wp-block-button .wp-block-button__link { display: block; text-align: center; }
  .b5-gift .wp-block-buttons, .b5-gift .wp-block-button { width: 100%; }
}

/* ---------- スマホ ---------- */
@media (max-width: 860px) {
  .b5-rules { grid-template-columns: 1fr; }
  .b5-rule { border-left: 0; border-top: 1px solid var(--b5-rule); }
  .b5-rule:first-child { border-top: 0; }
  .b5-gift { grid-template-columns: 1fr; padding: 28px 22px; }
}
@media (max-width: 600px) {
  .b5-section { padding-block: 52px; }
  .b5-nav { gap: 14px; font-size: 13px; }
  .b5-readouts { grid-template-columns: 1fr; }
  .b5-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .b5-readout__label { margin: 0; order: -1; }
  .b5-meter { padding: 22px 18px 20px; }
  .b5-log .wp-block-post,
  .b5-log > li { grid-template-columns: 1fr; gap: 4px; }
  .b5-about { grid-template-columns: 1fr; gap: 20px; }
  .b5-about__photo img { width: 112px; height: 112px; }
  .b5-buttons .wp-block-button, .b5-buttons > * { width: 100%; }
  .b5-buttons .wp-block-button__link, .b5-buttons > * > a { display: block; text-align: center; box-sizing: border-box; }
  .b5-gift .b5-btn > a, .b5-gift .wp-block-button__link { display: block; text-align: center; }
  .b5-hero { padding-block: 12px 44px; }
  .b5-hero__banner img { border-radius: 6px; }
  .b5-hero__body { padding-inline: 12px; gap: 0 14px; }
  .b5-hero__avatar { margin-top: -44px; }
  .b5-hero__avatar img { width: 96px; height: 96px; border-width: 4px; }
  .b5-hero__name { font-size: 18px; }
  .b5-hero__text { padding-inline: 0; margin-top: 22px; }
}
