/*
Theme Name: カワサキ不動産ラボ
Theme URI: https://kawasaki-fudosan-lab.com/
Author: 株式会社RiBeQ
Description: 不動産メディア「カワサキ不動産ラボ」専用テーマ。余計な機能を持たない軽量構成。
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: kawasaki-lab
*/

/* ============================================================
   1. トークン
   ============================================================ */
:root {
  --ink:        #1b1b1f;   /* 墨黒（地の文・背景） */
  --paper:      #f5f2ec;   /* オフホワイト */
  --accent:     #e04b2f;   /* 朱（アクセント） */
  --accent-dk:  #b93a21;
  --muted:      #6f6a63;   /* 補助文字 */
  --line:       #ddd7cc;   /* 罫線 */
  --card:       #ffffff;

  --serif: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --sans:  "Noto Sans JP", -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

  --content: 720px;   /* 本文カラム幅 */
  --wide:    1120px;  /* 全体の最大幅 */
}

/* ============================================================
   2. リセットと基本
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

a { color: var(--accent-dk); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.wrap { width: min(100% - 40px, var(--wide)); margin-inline: auto; }
.narrow { width: min(100% - 40px, var(--content)); margin-inline: auto; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================================================
   3. ヘッダー
   ============================================================ */
.site-header {
  background: var(--ink);
  color: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.site-title {
  font-family: var(--serif);
  font-size: 20px; font-weight: 700; letter-spacing: 0.06em; line-height: 1.2;
}
.site-title a { color: var(--paper); text-decoration: none; }
.site-title small {
  display: block; font-family: var(--sans); font-size: 10px; font-weight: 400;
  letter-spacing: 0.18em; color: #9a958c; margin-top: 3px;
}

.global-nav ul { display: flex; gap: 26px; list-style: none; }
.global-nav a {
  color: var(--paper); text-decoration: none; font-size: 14px; letter-spacing: 0.04em;
  padding-bottom: 3px; border-bottom: 2px solid transparent; transition: border-color .2s;
}
.global-nav a:hover { border-bottom-color: var(--accent); color: var(--paper); }

.nav-toggle { display: none; }
.nav-toggle-btn {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px; color: var(--paper);
}
.nav-toggle-btn span {
  display: block; width: 24px; height: 2px; background: var(--paper); margin: 5px 0; transition: .25s;
}

/* ============================================================
   4. ヒーロー（トップページ）
   ============================================================ */
.hero {
  background: var(--ink); color: var(--paper);
  padding: 76px 0 84px;
  border-bottom: 6px solid var(--accent);
}
.hero__bar { width: 88px; height: 6px; background: var(--accent); margin-bottom: 28px; }
.hero__title {
  font-family: var(--serif);
  font-size: clamp(28px, 5.2vw, 46px); font-weight: 700; line-height: 1.5; letter-spacing: 0.01em;
}
.hero__lead { margin-top: 22px; color: #cfc9bf; font-size: 16px; max-width: 40em; }
.hero__author {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid #35333a;
  font-size: 14px; color: #9a958c;
}
.hero__author strong { color: var(--paper); font-weight: 700; }

/* ============================================================
   5. セクション見出し
   ============================================================ */
.section { padding: 64px 0; }
.section__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 30px; }
.section__title { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: 0.04em; }
.section__en { font-size: 11px; letter-spacing: 0.22em; color: var(--muted); text-transform: uppercase; }
.section__more { margin-left: auto; font-size: 14px; }

/* ============================================================
   6. 記事カード
   ============================================================ */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }

.card { background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; }
.card a { text-decoration: none; color: inherit; }
.card__thumb { aspect-ratio: 1200 / 630; overflow: hidden; background: var(--ink); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card__thumb img { transform: scale(1.04); }
.card__body { padding: 18px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card__cat {
  display: inline-block; align-self: flex-start;
  font-size: 11px; letter-spacing: 0.1em; color: var(--accent-dk);
  border: 1px solid var(--accent); padding: 2px 9px; margin-bottom: 11px;
}
.card__title { font-family: var(--serif); font-size: 17px; font-weight: 700; line-height: 1.62; }
.card:hover .card__title { color: var(--accent-dk); }
.card__meta { margin-top: auto; padding-top: 14px; font-size: 12px; color: var(--muted); }

/* ============================================================
   7. 記事本文
   ============================================================ */
.breadcrumb { font-size: 12px; color: var(--muted); padding: 20px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span + span::before { content: "›"; margin: 0 8px; color: var(--line); }

.entry-header { padding: 26px 0 34px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.entry-cat {
  display: inline-block; font-size: 11px; letter-spacing: 0.1em;
  background: var(--accent); color: #fff; padding: 3px 11px; margin-bottom: 16px;
}
.entry-title {
  font-family: var(--serif);
  font-size: clamp(25px, 4.4vw, 35px); font-weight: 700; line-height: 1.52;
}
.entry-meta { margin-top: 18px; font-size: 13px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.entry-thumb { margin: 0 0 34px; }

/* --- 冒頭のアフィリエイト表記（ステマ規制対応） --- */
.entry-content .ad-disclosure {
  font-size: 12.5px; color: var(--muted); background: #ece7dd;
  border-left: 3px solid var(--line); padding: 9px 14px; margin-bottom: 34px;
}
.entry-content .ad-disclosure em { font-style: normal; }

.entry-content > * + * { margin-top: 1.65em; }
.entry-content p { line-height: 1.95; }

.entry-content h2 {
  font-family: var(--serif); font-size: 24px; font-weight: 700; line-height: 1.5;
  margin-top: 2.6em; padding: 4px 0 4px 18px; border-left: 6px solid var(--accent);
}
.entry-content h3 {
  font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.55;
  margin-top: 2.2em; padding-bottom: 8px; border-bottom: 2px solid var(--line);
}
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: 0.5em; }
.entry-content strong { background: linear-gradient(transparent 62%, #f7d9a8 62%); font-weight: 700; }
/* <mark> は下線。strong のマーカーと役割を分け、最も持ち帰ってほしい数箇所だけに使う */
.entry-content mark {
  background: none; color: inherit; font-weight: 700;
  border-bottom: 2px solid var(--accent); padding-bottom: 1px;
}
.entry-content blockquote {
  border-left: 3px solid var(--line); padding: 4px 0 4px 20px; color: #4b4740; font-size: 16px;
}
.entry-content a { font-weight: 500; }

/* CTAボックス（アフィリエイトリンクを置く場所） */
.cta-box {
  background: var(--ink); color: var(--paper); padding: 30px 28px; margin: 2.6em 0;
}
.cta-box p { color: #cfc9bf; font-size: 15px; }
.cta-box .cta-btn {
  display: inline-block; margin-top: 18px; background: var(--accent); color: #fff;
  padding: 14px 34px; text-decoration: none; font-weight: 700; letter-spacing: 0.04em;
}
.cta-box .cta-btn:hover { background: var(--accent-dk); color: #fff; }

/* Easy Table of Contents の見た目調整 */
#ez-toc-container {
  background: #ece7dd !important; border: 1px solid var(--line) !important;
  border-radius: 0 !important; box-shadow: none !important; padding: 20px 24px !important;
}
#ez-toc-container .ez-toc-title { font-family: var(--serif); font-weight: 700 !important; }
#ez-toc-container a { text-decoration: none !important; }

/* ============================================================
   8. 著者ボックス・関連記事
   ============================================================ */
.author-box {
  margin-top: 60px; padding: 28px; background: var(--card); border: 1px solid var(--line);
  display: flex; gap: 22px; align-items: flex-start;
}
.author-box__avatar { flex: 0 0 84px; }
.author-box__avatar img { border-radius: 50%; }
.author-box__name { font-family: var(--serif); font-size: 17px; font-weight: 700; }
.author-box__role { font-size: 12px; color: var(--muted); margin-top: 3px; }
.author-box__bio { font-size: 14.5px; line-height: 1.85; margin-top: 12px; }
.author-box__link { font-size: 13px; margin-top: 10px; }

.related { margin-top: 64px; }
.related .section__title { font-size: 20px; }

/* ============================================================
   9. フッター
   ============================================================ */
.site-footer { background: var(--ink); color: #9a958c; margin-top: 90px; padding: 50px 0 34px; }
.site-footer a { color: #cfc9bf; text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 12px 28px; list-style: none; font-size: 14px; }
.footer-note { margin-top: 26px; padding-top: 22px; border-top: 1px solid #35333a; font-size: 12px; line-height: 1.9; }

/* ============================================================
   10. 一覧・検索・404
   ============================================================ */
.archive-head { padding: 46px 0 34px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.archive-title { font-family: var(--serif); font-size: 28px; font-weight: 700; }
.archive-desc { margin-top: 10px; color: var(--muted); font-size: 15px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 56px; }
.pagination .page-numbers {
  padding: 9px 15px; border: 1px solid var(--line); background: var(--card);
  text-decoration: none; font-size: 14px; color: var(--ink);
}
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.searchform { display: flex; gap: 8px; max-width: 420px; }
.searchform input[type="search"] {
  flex: 1; padding: 11px 14px; border: 1px solid var(--line); background: var(--card);
  font-size: 15px; font-family: inherit;
}
.searchform button {
  background: var(--ink); color: var(--paper); border: 0; padding: 0 20px; cursor: pointer; font-size: 14px;
}

.notfound { padding: 90px 0; text-align: center; }
.notfound h1 { font-family: var(--serif); font-size: 30px; margin-bottom: 14px; }

/* ============================================================
   11. 固定ページ
   ============================================================ */
.page-content h2 {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  margin-top: 2.4em; padding-left: 15px; border-left: 5px solid var(--accent);
}
.page-content > * + * { margin-top: 1.6em; }
.page-content ul { padding-left: 1.4em; }

/* ============================================================
   12. レスポンシブ
   ============================================================ */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

@media (max-width: 782px) {
  body { font-size: 16px; }

  .nav-toggle-btn { display: block; }
  .global-nav {
    position: fixed; inset: 68px 0 auto 0; background: var(--ink);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
    border-bottom: 3px solid var(--accent);
  }
  .nav-toggle:checked ~ .global-nav { max-height: 420px; }
  .global-nav ul { flex-direction: column; gap: 0; padding: 8px 20px 20px; }
  .global-nav li { border-bottom: 1px solid #35333a; }
  .global-nav a { display: block; padding: 15px 0; border-bottom: 0; font-size: 15px; }

  .hero { padding: 52px 0 58px; }
  .section { padding: 46px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .card { display: grid; grid-template-columns: 116px 1fr; }
  .card__thumb { aspect-ratio: 1 / 1; }
  .card__body { padding: 14px 16px; }
  .card__title { font-size: 15px; }
  .card__cat { margin-bottom: 8px; }

  .entry-content h2 { font-size: 21px; padding-left: 14px; border-left-width: 5px; }
  .entry-content h3 { font-size: 18px; }

  .author-box { flex-direction: column; gap: 16px; }
  .author-box__avatar { flex: 0 0 auto; width: 72px; }

  .footer-nav ul { gap: 10px 20px; font-size: 13px; }
}

/* 印刷時はナビ等を落とす */
@media print {
  .site-header, .site-footer, .related, .cta-box { display: none; }
  body { background: #fff; font-size: 12pt; }
}
