/* ═══════════════════════════════════════════════════════
   賃貸ガイド — guide.css
   既存CSS変数（style.css :root）を全面踏襲
═══════════════════════════════════════════════════════ */

/* ── レイアウト ───────────────────────────── */
.guide-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ── ヒーロー ─────────────────────────────── */
.guide-hero {
  background: linear-gradient(135deg, var(--accent) 0%, #b07040 100%);
  color: #fff;
  border-radius: 12px;
  padding: 32px 36px;
  margin: 20px 0 28px;
}
.guide-hero h1 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 10px;
  line-height: 1.5;
}
.guide-hero .guide-hero-sub {
  font-size: .88rem;
  opacity: .92;
  line-height: 1.7;
  margin: 0;
}
.guide-hero-meta {
  display: flex;
  gap: 14px;
  margin-top: 14px;
  font-size: .78rem;
  opacity: .8;
}
.guide-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── 目次（TOC） ─────────────────────────── */
.guide-toc {
  background: var(--accent-lt);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.guide-toc-title {
  font-size: .88rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--ink);
}
.guide-toc ol {
  margin: 0;
  padding-left: 20px;
}
.guide-toc li {
  margin-bottom: 6px;
  font-size: .86rem;
  line-height: 1.6;
}
.guide-toc a {
  color: var(--accent);
  text-decoration: none;
}
.guide-toc a:hover {
  text-decoration: underline;
}

/* ── 本文セクション ───────────────────────── */
.guide-body {
  font-size: .94rem;
  line-height: 2;
  color: var(--text);
}
.guide-body h2 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--ink);
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin: 44px 0 18px;
  line-height: 1.5;
}
.guide-body h3 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.guide-body p {
  margin: 0 0 18px;
}
.guide-body ul, .guide-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.guide-body li {
  margin-bottom: 6px;
  line-height: 1.9;
}

/* ── ステップカード ───────────────────────── */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0 28px;
}
.guide-step {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.guide-step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
}
.guide-step-body {
  flex: 1;
  min-width: 0;
}
.guide-step-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.guide-step-days {
  display: inline-block;
  background: var(--accent-lt);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.guide-step-body p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.8;
  color: var(--text-light);
}

/* ── チェックリスト ───────────────────────── */
.guide-checklist {
  list-style: none;
  padding: 0;
  margin: 12px 0 24px;
  columns: 2;
  column-gap: 20px;
}
.guide-checklist li {
  break-inside: avoid;
  padding: 5px 0 5px 26px;
  position: relative;
  font-size: .88rem;
  line-height: 1.7;
  border-bottom: 1px solid #f0f0f0;
}
.guide-checklist li::before {
  content: '\2713';
  position: absolute;
  left: 4px;
  top: 5px;
  color: var(--accent);
  font-weight: 700;
  font-size: .82rem;
}

/* div 型チェックリスト（印刷用。<div class="guide-checklist-item"><span class="guide-checklist-check"></span>…）
   2026-10-17: 多くの記事で使われていたが定義が無く、ただの行として表示されていた */
.guide-checklist-item {
  break-inside: avoid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 4px;
  font-size: .9rem;
  line-height: 1.7;
  border-bottom: 1px solid #f0f0f0;
}
.guide-checklist-check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 4px;
  border: 2px solid var(--accent);
  border-radius: 3px;
  background: #fff;
}
/* 印刷（2026-10-17）: チェックリストを紙で使えるよう、ヘッダー・メニュー・横の欄・目次などを出さず本文だけにする */
@media print {
  .site-header, .breadcrumb-nav, .guide-sidebar, .guide-toc, .site-footer, footer, .skip-link,
  .sp-fixed-bar, .guide-pager, .guide-related, .guide-side-cta { display: none !important; }
  .guide-article-layout { display: block !important; }
  .guide-article-main { width: 100% !important; max-width: none !important; }
  .guide-checklist-item { break-inside: avoid; font-size: 11pt; padding: 6px 2px; }
  .guide-checklist-check { width: 18px; height: 18px; border-color: #333; }
  a { color: inherit; text-decoration: none; }
}

/* ── 注意・ポイントボックス ───────────────── */
.guide-note {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  margin: 18px 0 24px;
  font-size: .88rem;
  line-height: 1.8;
}
.guide-note-title {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 6px;
}
.guide-note--tip {
  background: #edf7ed;
  border-left: 4px solid #27ae60;
}
.guide-note--warning {
  background: #fef9e7;
  border-left: 4px solid #f0c040;
}
.guide-note--info {
  background: #eaf2fb;
  border-left: 4px solid #2e86c1;
}

/* ── テーブル ─────────────────────────────── */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  margin: 12px 0 24px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.guide-table th {
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}
.guide-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.7;
}
.guide-table tr:nth-child(even) td {
  background: #faf9f7;
}

/* ── 挿絵画像 ─────────────────────────────── */
.guide-image {
  margin: 24px 0;
  text-align: center;
}
.guide-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.guide-image figcaption {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ── 前後記事ナビ ─────────────────────────── */
.guide-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 48px;
}
.guide-pager-link {
  display: block;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: box-shadow .15s, border-color .15s;
}
.guide-pager-link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.guide-pager-label {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.guide-pager-title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.5;
}
.guide-pager-link--next {
  text-align: right;
}

/* ── CTA ──────────────────────────────────── */
.guide-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #b07040 100%);
  color: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  text-align: center;
  margin-top: 40px;
}
.guide-cta p {
  margin: 0 0 14px;
  font-size: .95rem;
}
.guide-cta-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.guide-cta-btn {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 24px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s;
}
.guide-cta-btn:hover { opacity: .9; text-decoration: none; }
.guide-cta-btn--primary {
  background: #fff;
  color: var(--accent);
}
.guide-cta-btn--secondary {
  background: rgba(255,255,255,.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}

/* ── 一覧ページ ───────────────────────────── */
.guide-list-hero {
  background: linear-gradient(135deg, var(--accent) 0%, #b07040 100%);
  color: #fff;
  border-radius: 12px;
  padding: 28px 32px;
  margin: 20px 0 32px;
  text-align: center;
}
.guide-list-hero h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 8px;
}
.guide-list-hero p {
  font-size: .88rem;
  opacity: .9;
  margin: 0;
}

.guide-section-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin: 32px 0 8px;
  padding: 10px 0;
  border-bottom: 2px solid var(--accent);
}

.guide-cat-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin: 32px 0 16px;
}

.guide-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-card {
  display: flex;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.guide-card-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
}
.guide-card-body {
  flex: 1;
  min-width: 0;
}
.guide-card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.5;
}
.guide-card-desc {
  font-size: .82rem;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
}
.guide-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: .74rem;
  color: var(--text-muted);
}

/* ── ガイド一覧 サイドバーレイアウト ────────── */
.guide-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
}
.guide-sidebar {
  position: sticky;
  top: 77px; /* 固定ヘッダー(65px)の下に出す */
  max-height: calc(100vh - 89px);
  overflow-y: auto;
}
.guide-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.guide-main {
  min-width: 0;
}

/* ── ガイド記事 サイドバーレイアウト ─────────── */
.guide-article-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
.guide-article-sidebar {
  position: sticky;
  top: 77px; /* 固定ヘッダー(65px)の下に出す */
  max-height: calc(100vh - 89px);
  overflow-y: auto;
}
.guide-article-main {
  min-width: 0;
}

/* ── サイドバー上部の相談導線（売買・売却ガイド）: サイドバー内でスクロールしても上に留まる ── */
.guide-side-cta {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.guide-side-cta-title { font-size: .82rem; font-weight: 700; color: var(--ink); }
.guide-side-cta-btn {
  display: block;
  text-align: center;
  font-size: .88rem;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: #fff;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.guide-side-cta-btn:hover { background: #fff3ee; text-decoration: none; }
.guide-side-cta-btn.is-primary { background: var(--accent); color: #fff; }
.guide-side-cta-btn.is-primary:hover { background: var(--accent-dark, var(--accent)); color: #fff; }
.guide-side-cta-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.guide-side-cta-note { font-size: .7rem; color: var(--text-muted); text-align: center; }
@media (max-width: 900px) {
  .guide-side-cta { position: static; flex: 1 1 100%; }
  /* スマホ・タブレット: 記事ページは「相談ボタン → 本文 → 記事一覧」の順に並べる
     （aside と中身を grid に溶かし、order で並べ替える。ガイド一覧ページの .guide-sidebar には効かない） */
  .guide-article-sidebar,
  .guide-article-sidebar > .guide-sidebar-inner { display: contents; }
  .guide-article-sidebar .guide-side-cta { order: 0; }
  .guide-article-layout > .guide-article-main { order: 1; min-width: 0; }
  .guide-article-sidebar > .guide-sidebar-inner > :not(.guide-side-cta) { order: 2; }
  /* 相談ボックスは本文の上で場所を取らないよう、ボタンを横並びにして小さくする */
  .guide-article-sidebar .guide-side-cta { flex-direction: row; flex-wrap: wrap; padding: 10px 12px; gap: 6px 8px; }
  .guide-article-sidebar .guide-side-cta-title { flex: 1 1 100%; }
  .guide-article-sidebar .guide-side-cta-btn { flex: 1 1 0; min-width: 0; padding: 9px 6px; font-size: .84rem; }
  .guide-article-sidebar .guide-side-cta-btn > span[aria-hidden] { display: none; }
}

/* ── サイドバー フィルタセクション ────────────── */
.guide-filter-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.guide-filter-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.guide-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: .84rem;
  color: var(--text);
  transition: color .15s;
}
.guide-filter-item:hover {
  color: var(--accent);
}
.guide-filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.guide-filter-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.guide-filter-label {
  flex: 1;
}
.guide-filter-count {
  font-size: .74rem;
  color: var(--text-muted);
  background: #f0f0f0;
  padding: 1px 7px;
  border-radius: 8px;
  min-width: 20px;
  text-align: center;
}
.guide-filter-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.guide-filter-btn {
  flex: 1;
  padding: 4px 0;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-lt);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.guide-filter-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ── サイドバー 統計 ────────────────────────── */
.guide-sidebar-stat {
  font-size: .88rem;
  color: var(--text);
  text-align: center;
}
.guide-sidebar-stat span {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
}

/* ── サイドバー 辞典リンク ───────────────────── */
.guide-sidebar-dict {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.guide-sidebar-dict:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
  color: #fff;
}
.guide-sidebar-dict-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.guide-sidebar-dict-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.guide-sidebar-dict-body strong {
  font-size: .82rem;
}
.guide-sidebar-dict-body small {
  font-size: .7rem;
  opacity: .8;
}

/* ── サイドバー 記事ナビ（article.php） ────── */
.guide-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.guide-sidebar-cat-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 0 3px;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.guide-sidebar-cat-label:first-child {
  padding-top: 0;
}
.guide-sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.guide-sidebar-link {
  display: block;
  padding: 5px 8px;
  font-size: .78rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  transition: background .12s, color .12s;
  line-height: 1.5;
}
.guide-sidebar-link:hover {
  background: var(--accent-lt);
  color: var(--accent);
  text-decoration: none;
}
.guide-sidebar-link.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}
.guide-sidebar-link.is-active:hover {
  background: var(--accent);
  color: #fff;
}

/* ── サイドバー 他大分類リンク ────────────────── */
.guide-sidebar-section-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: .82rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.guide-sidebar-section-link:hover {
  background: var(--accent-lt);
  color: var(--accent);
  text-decoration: none;
}

/* ── ガイド検索バー ──────────────────────────── */
.guide-search-wrap {
  margin-bottom: 20px;
  position: relative;
}
.guide-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .9rem;
  pointer-events: none;
  opacity: .5;
}
.guide-search {
  width: 100%;
  padding: 10px 14px 10px 36px;
  font-size: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  transition: border-color .15s;
  box-sizing: border-box;
}
.guide-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb, 180,120,60), .15);
}

/* ── 関連記事セクション ──────────────────────── */
.guide-related {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.guide-related-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 14px;
}
.guide-related-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.guide-related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: transform .12s, box-shadow .12s;
  box-shadow: var(--shadow);
}
.guide-related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.guide-related-card-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
}
.guide-related-card-meta {
  display: flex;
  gap: 10px;
  font-size: .72rem;
  color: var(--text-muted);
}

/* ── レスポンシブ ─────────────────────────────── */
@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .guide-article-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .guide-sidebar,
  .guide-article-sidebar {
    position: static;
    max-height: none;
  }
  .guide-sidebar-inner {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .guide-filter-section {
    flex: 1;
    min-width: 200px;
  }
  .guide-related-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .guide-layout { padding: 0 14px 40px; }
  .guide-article-layout { padding: 0 14px 40px; }
  .guide-sidebar-inner { flex-direction: column; }
  .guide-filter-section { min-width: 0; }
  .guide-hero { padding: 24px 20px; }
  .guide-hero h1 { font-size: 1.2rem; }
  .guide-body { font-size: .92rem; line-height: 1.9; }
  .guide-body h2 { font-size: 1.15rem; }
  .guide-body h3 { font-size: 1.05rem; }
  .guide-step { flex-direction: column; gap: 10px; padding: 16px; }
  .guide-step-body p { font-size: .88rem; line-height: 1.7; }
  .guide-checklist { columns: 1; }
  .guide-checklist li { font-size: .88rem; padding: 6px 0 6px 26px; }
  .guide-pager { grid-template-columns: 1fr; }
  .guide-table { font-size: .82rem; }
  .guide-table th, .guide-table td { padding: 8px 10px; }
  .guide-card { padding: 16px; }
  .guide-card-title { font-size: .9rem; }
  .guide-cta { padding: 22px 18px; }
  .guide-cta-buttons { flex-direction: column; }
  .guide-cta-btn { text-align: center; min-height: 44px; }
  .guide-related-cards { grid-template-columns: 1fr; }
}

/* 出典欄: 長いURLや条文番号の連続がスマホ幅で横にはみ出さないよう折り返す (2026-09-28) */
.guide-sources, .guide-sources small, .guide-sources a { overflow-wrap: anywhere; word-break: break-word; }
