/*
Theme Name: AI実測ラボ
Template: twentytwentyfive
Version: 2.0
*/

/* ==========================================================
   配色。アイキャッチ（ai_thumb.py）と揃えている。
   ⚠️片方だけ変えないこと
   ========================================================== */
:root {
  --ink:      #11141a;
  --ink-2:    #1c2029;
  --text:     #2b3038;
  --muted:    #6b7280;
  --line:     #e4e7ec;
  --line-2:   #f0f2f5;
  --bg:       #f4f6f9;
  --card:     #ffffff;
  --accent:   #2f7fd4;
  --accent-d: #1f5fa8;
  --accent-l: #eaf2fb;
}

body, .wp-site-blocks { background: var(--bg); color: var(--text); }
.wp-site-blocks a { color: var(--accent); }

/* 幅。サイドバーを置くので既定より広げる */
.ailab-main { max-width: 1180px !important; margin-inline: auto; padding-inline: 20px; }
.ailab-main > .wp-block-columns { max-width: 100% !important; }

/* ---------- ヘッダー ---------- */
header.wp-block-template-part {
  background: var(--ink);
  border-bottom: 3px solid var(--accent);
}
header.wp-block-template-part * { color: #f3f5f8 !important; }
header.wp-block-template-part a { text-decoration: none; }
header.wp-block-template-part a:hover { opacity: .72; }
header.wp-block-template-part .wp-block-site-title a {
  font-weight: 800; letter-spacing: .01em;
}

/* ---------- 冒頭 ---------- */
.ailab-hero {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  padding: 2.1rem 2rem 1.7rem !important;
  margin: 2rem 0 2.4rem !important;
}
.hero-h {
  color: var(--ink); font-size: 1.9rem; line-height: 1.45;
  margin: 0 0 .8rem; letter-spacing: -.01em;
}
.hero-p { color: var(--text); line-height: 1.95; margin: 0 0 .9rem; max-width: 46em; }
.hero-stat {
  color: var(--muted); font-size: .84rem; margin: 0;
  padding-top: .8rem; border-top: 1px dashed var(--line);
}

/* ---------- 2カラム ---------- */
.ailab-cols { gap: 2.4rem !important; align-items: flex-start; }
.ailab-col-side { position: sticky; top: 1.5rem; }

.sec-title {
  color: var(--ink); font-size: 1.15rem; margin: 0 0 1.1rem;
  padding-left: .65rem; border-left: 4px solid var(--accent);
}

/* ---------- 記事カード ---------- */
.post-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1.4rem !important;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.post-card:hover {
  box-shadow: 0 8px 26px rgba(17,20,26,.10);
  transform: translateY(-2px);
  border-color: #cfd8e3;
}
.post-card .wp-block-post-featured-image { margin: 0; }
.post-card .wp-block-post-featured-image img { display: block; width: 100%; border-radius: 0; }
.post-body { padding: 1.15rem 1.4rem 1.4rem !important; }
.post-card .wp-block-post-title { margin: .5rem 0 .5rem; line-height: 1.55; font-size: 1.1rem; }
.post-card .wp-block-post-title a { color: var(--ink); text-decoration: none; font-weight: 700; }
.post-card .wp-block-post-title a:hover { color: var(--accent); }
.post-card .wp-block-post-excerpt__excerpt {
  color: var(--muted); line-height: 1.85; font-size: .93rem; margin: 0 0 .7rem;
}
.wp-block-read-more {
  color: var(--accent); font-weight: 600; text-decoration: none; font-size: .9rem;
}
.wp-block-read-more:hover { text-decoration: underline; }

/* 日付・カテゴリ */
.post-meta { align-items: center; gap: .7rem !important; margin: 0; }
.post-meta .wp-block-post-date,
.post-meta .wp-block-post-date a {
  color: var(--muted); text-decoration: none; font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.post-meta .wp-block-post-terms a {
  display: inline-block; background: var(--accent-l); color: var(--accent-d);
  border-radius: 4px; padding: .2em .7em; font-size: .74rem; font-weight: 700;
  text-decoration: none; letter-spacing: .02em;
}
.post-meta .wp-block-post-terms a:hover { background: #dbe9f8; }

/* ---------- パンくず ---------- */
.ailab-crumb {
  font-size: .82rem; color: var(--muted); margin: 1.4rem 0 .6rem;
  display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
}
.ailab-crumb a { color: var(--muted); text-decoration: none; }
.ailab-crumb a:hover { color: var(--accent); text-decoration: underline; }
.ailab-crumb .cur { color: var(--ink); }

/* ---------- 記事ページ ---------- */
.single-head { margin-bottom: 1.2rem !important; }
.single-head .wp-block-post-title {
  color: var(--ink); font-size: 1.95rem; line-height: 1.5;
  margin: .6rem 0 1.1rem; letter-spacing: -.01em;
}
.single-head .wp-block-post-featured-image img { border-radius: 10px; }

.wp-block-post-content {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 2.2rem 2.1rem 2.6rem; margin-top: 1.4rem;
}
.wp-block-post-content p { line-height: 2.05; margin: 1.2em 0; }
.wp-block-post-content h2 {
  color: var(--ink); font-size: 1.35rem; line-height: 1.55;
  margin: 2.7em 0 1em; padding: .15em 0 .15em .75rem;
  border-left: 5px solid var(--accent);
}
.wp-block-post-content h2:first-child { margin-top: 0; }
.wp-block-post-content h3 {
  color: var(--ink); font-size: 1.1rem; margin: 2.1em 0 .8em;
  padding-bottom: .35em; border-bottom: 1px solid var(--line);
}
.wp-block-post-content ul, .wp-block-post-content ol {
  line-height: 2.0; padding-left: 1.5em; margin: 1.2em 0;
}
.wp-block-post-content li { margin: .5em 0; }
.wp-block-post-content strong { color: var(--ink); font-weight: 700; }
.wp-block-post-content a { color: var(--accent); text-decoration: underline; }

.wp-block-post-content pre {
  background: var(--ink); color: #dfe5ee; border-radius: 10px;
  padding: 1.2em 1.35em; overflow-x: auto; font-size: .87rem;
  line-height: 1.9; margin: 1.6em 0;
}
.wp-block-post-content code {
  background: #eef1f5; color: var(--ink); border-radius: 4px;
  padding: .12em .45em; font-size: .9em;
}
.wp-block-post-content pre code { background: none; color: inherit; padding: 0; }

.wp-block-post-content table {
  border-collapse: collapse; width: 100%; margin: 1.6em 0; font-size: .93rem;
}
.wp-block-post-content th, .wp-block-post-content td {
  border: 1px solid var(--line); padding: .72em .9em; text-align: left; vertical-align: top;
}
.wp-block-post-content th { background: #eef1f5; color: var(--ink); font-weight: 700; }
.wp-block-post-content tr:nth-child(even) td { background: #fafbfc; }

/* ==========================================================
   記事の装飾部品
   ⚠️ここに無いクラスを記事側で使っても効かない。
     ai_writer.py のプロンプトと**必ず対にして**増やすこと
   ========================================================== */

/* リード文（冒頭の要約） */
.wp-block-post-content .lead {
  background: #f8fafc; border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: 8px; padding: 1.1rem 1.3rem; margin: 0 0 2rem;
  font-size: .97rem; line-height: 1.95; color: var(--text);
}
.wp-block-post-content .lead p { margin: .4em 0; }
.wp-block-post-content .lead p:first-child { margin-top: 0; }
.wp-block-post-content .lead p:last-child { margin-bottom: 0; }

/* マーカー */
.wp-block-post-content mark,
.wp-block-post-content .mk {
  background: linear-gradient(transparent 62%, #ffe680 62%);
  color: inherit; padding: 0 .1em; font-weight: 600;
}
.wp-block-post-content .mk-blue {
  background: linear-gradient(transparent 62%, #bfe0ff 62%);
  padding: 0 .1em; font-weight: 600;
}
.wp-block-post-content .mk-red {
  background: linear-gradient(transparent 62%, #ffd0d0 62%);
  padding: 0 .1em; font-weight: 600;
}

/* 囲み（注意・ポイント・実測値） */
.wp-block-post-content .box {
  border-radius: 10px; padding: 1.15rem 1.3rem 1.2rem; margin: 1.8em 0;
  border: 1px solid var(--line); background: var(--card);
}
.wp-block-post-content .box > :first-child { margin-top: 0; }
.wp-block-post-content .box > :last-child { margin-bottom: 0; }
.wp-block-post-content .box .t {
  display: block; font-weight: 700; font-size: .9rem; margin-bottom: .6rem;
  letter-spacing: .02em;
}
.wp-block-post-content .box p { margin: .6em 0; line-height: 1.9; }

.wp-block-post-content .box.warn { background: #fff8f0; border-color: #f2d9bd; }
.wp-block-post-content .box.warn .t { color: #b45309; }
.wp-block-post-content .box.point { background: #f0f7ff; border-color: #c9def5; }
.wp-block-post-content .box.point .t { color: var(--accent-d); }
.wp-block-post-content .box.ok { background: #f2fbf5; border-color: #c4e8d1; }
.wp-block-post-content .box.ok .t { color: #15803d; }
.wp-block-post-content .box.ng { background: #fff5f5; border-color: #f3cdcd; }
.wp-block-post-content .box.ng .t { color: #b91c1c; }

/* 実測値の強調 */
.wp-block-post-content .fact {
  background: var(--ink); color: #e7ecf3; border-radius: 10px;
  padding: 1.1rem 1.3rem; margin: 1.8em 0;
}
.wp-block-post-content .fact .t {
  display: block; color: #8fb8e6; font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; margin-bottom: .5rem;
}
.wp-block-post-content .fact .n {
  font-size: 1.7rem; font-weight: 800; line-height: 1.4;
  font-variant-numeric: tabular-nums; color: #ffffff;
}
.wp-block-post-content .fact .s { color: #9fb0c6; font-size: .87rem; line-height: 1.8; }

/* 手順 */
.wp-block-post-content ol.steps { list-style: none; counter-reset: st; padding-left: 0; }
.wp-block-post-content ol.steps > li {
  counter-increment: st; position: relative;
  padding: .1em 0 .1em 2.6rem; margin: .9em 0; line-height: 1.9;
}
.wp-block-post-content ol.steps > li::before {
  content: counter(st); position: absolute; left: 0; top: .15em;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .85rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 良い/悪い の並べ書き */
.wp-block-post-content ul.tick { list-style: none; padding-left: 0; }
.wp-block-post-content ul.tick > li {
  position: relative; padding-left: 1.7rem; margin: .6em 0; line-height: 1.9;
}
.wp-block-post-content ul.tick > li::before {
  content: "✓"; position: absolute; left: 0; color: #15803d; font-weight: 800;
}
.wp-block-post-content ul.cross { list-style: none; padding-left: 0; }
.wp-block-post-content ul.cross > li {
  position: relative; padding-left: 1.7rem; margin: .6em 0; line-height: 1.9;
}
.wp-block-post-content ul.cross > li::before {
  content: "✕"; position: absolute; left: 0; color: #b91c1c; font-weight: 800;
}

/* 引用 */
.wp-block-post-content blockquote {
  border-left: 4px solid var(--line); margin: 1.8em 0; padding: .3em 0 .3em 1.2rem;
  color: var(--muted); font-size: .95rem; line-height: 1.95;
}

/* まとめ */
.wp-block-post-content .wrap-up {
  background: #f8fafc; border: 2px solid var(--accent); border-radius: 12px;
  padding: 1.4rem 1.5rem 1.5rem; margin: 2.4em 0 1em;
}
.wp-block-post-content .wrap-up .t {
  display: block; color: var(--accent-d); font-weight: 800; font-size: 1.02rem;
  margin-bottom: .8rem;
}
.wp-block-post-content .wrap-up ul { margin: 0; padding-left: 1.3em; }
.wp-block-post-content .wrap-up li { margin: .5em 0; }

/* ---------- 関連記事 ---------- */
.ailab-related {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.6rem 1.7rem 1.8rem; margin-top: 1.6rem;
}
.ailab-related > h2 {
  color: var(--ink); font-size: 1.1rem; margin: 0 0 1.1rem;
  padding-left: .65rem; border-left: 4px solid var(--accent);
}
.ailab-related ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.ailab-related li { margin: 0; }
.ailab-related a {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.ailab-related a:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(17,20,26,.08); }
.ailab-related .th img { display: block; width: 100%; height: auto; }
.ailab-related .tx {
  display: block; padding: .7rem .85rem .9rem; font-size: .88rem;
  line-height: 1.6; font-weight: 600;
}

/* ---------- 前後の記事 ---------- */
.ailab-navlinks { margin: 1.6rem 0 2.4rem !important; gap: .8rem; }
.wp-block-post-navigation-link a {
  display: inline-block; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: .65em 1.1em; color: var(--ink);
  text-decoration: none; font-size: .9rem;
}
.wp-block-post-navigation-link a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- ページ送り ---------- */
.ailab-pager { gap: .5rem !important; margin: 2rem 0 1rem !important; }
.ailab-pager a, .ailab-pager span {
  background: var(--card); border: 1px solid var(--line); border-radius: 7px;
  padding: .45em .85em; text-decoration: none; color: var(--accent); font-size: .9rem;
}
.ailab-pager .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- サイドバー ---------- */
.ailab-side { display: flex; flex-direction: column; gap: 1.2rem; }
.side-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 1.2rem 1.25rem 1.35rem;
}
.side-title {
  color: var(--ink); font-weight: 700; font-size: .95rem;
  margin-bottom: .9rem; padding-left: .55rem; border-left: 4px solid var(--accent);
}
.side-about p { color: var(--muted); font-size: .87rem; line-height: 1.9; margin: 0 0 .8rem; }
.side-link { color: var(--accent); font-size: .87rem; font-weight: 600; text-decoration: none; }
.side-link:hover { text-decoration: underline; }

.side-cats { list-style: none; margin: 0; padding: 0; }
.side-cats li + li { border-top: 1px solid var(--line-2); }
.side-cats a {
  display: flex; justify-content: space-between; align-items: center;
  padding: .58em .1em; color: var(--text); text-decoration: none; font-size: .89rem;
}
.side-cats a:hover { color: var(--accent); }
.side-cats span {
  background: var(--line-2); color: var(--muted); border-radius: 999px;
  padding: .05em .6em; font-size: .76rem; font-variant-numeric: tabular-nums;
}

.side-posts { list-style: none; margin: 0; padding: 0; }
.side-posts li + li { margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line-2); }
.side-posts a {
  display: grid; grid-template-columns: 72px 1fr; gap: .7rem;
  align-items: center; text-decoration: none; color: var(--text);
}
.side-posts .th img { display: block; width: 72px; height: auto; border-radius: 5px; }
.side-posts .tx { font-size: .84rem; line-height: 1.6; font-weight: 600; }
.side-posts a:hover .tx { color: var(--accent); }

.side-box .wp-block-search__inside-wrapper { gap: .4rem; }
.side-box input[type="search"] {
  border: 1px solid var(--line); border-radius: 7px; padding: .5em .7em; font-size: .88rem;
}
.side-box .wp-block-search__button {
  background: var(--accent); color: #fff; border: none; border-radius: 7px;
  padding: .5em 1em; font-size: .88rem; cursor: pointer;
}
.side-box .wp-block-search__button:hover { background: var(--accent-d); }

/* ---------- フッター ---------- */
footer.wp-block-template-part { background: var(--ink); margin-top: 3.5rem; }
footer.wp-block-template-part * { color: #9aa4b2 !important; }
footer.wp-block-template-part a:hover { color: #f3f5f8 !important; }

/* ---------- スマホ ---------- */
@media (max-width: 781px) {
  .ailab-cols { gap: 1.8rem !important; }
  .ailab-col-side { position: static; }
  .ailab-hero { padding: 1.5rem 1.25rem 1.3rem !important; margin: 1.4rem 0 1.8rem !important; }
  .hero-h { font-size: 1.42rem; }
  .single-head .wp-block-post-title { font-size: 1.45rem; }
  .wp-block-post-content { padding: 1.5rem 1.15rem 1.9rem; border-radius: 10px; }
  .wp-block-post-content h2 { font-size: 1.18rem; }
  .wp-block-post-content pre { font-size: .78rem; }
  .ailab-related ul { grid-template-columns: 1fr; }
  .ailab-related { padding: 1.3rem 1.1rem 1.4rem; }
}
