/* ============================================================
   13分でわかる実家じまいマニュアル
   デザインテーマ: 「和モダン・墨と杉」
   明朝体見出し × 墨黒 × 生成り × 杉色（深緑）＋朱のアクセント
   ============================================================ */
:root {
  --ink: #23211d;
  --ink-soft: #45413a;
  --muted: #6f6a5f;
  --base: #f6f3ec;      /* 生成り */
  --panel: #fffdf9;
  --panel-2: #f1ece1;
  --line: #ddd6c8;
  --sugi: #33604a;      /* 杉 */
  --sugi-dark: #244436;
  --sugi-soft: #e4ede7;
  --shu: #b8492f;       /* 朱 */
  --shu-soft: #f7e6df;
  --kincha: #9a7736;    /* 金茶 */
  --kincha-soft: #f4ecda;
  --shadow: 0 12px 30px rgba(35, 33, 29, 0.10);
  --radius: 4px;
  --content: 1060px;
  --serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", "MS PMincho", serif;
  --sans: "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--base);
  font-family: var(--sans);
  line-height: 1.95;
  font-size: 16px;
  /* 和紙のような細かい地紋 */
  background-image:
    radial-gradient(rgba(160, 145, 115, 0.07) 1px, transparent 1px),
    radial-gradient(rgba(160, 145, 115, 0.05) 1px, transparent 1px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--sugi); text-underline-offset: 0.2em; }
a:hover { color: var(--shu); }

h1, h2, h3, .brand-text { font-family: var(--serif); letter-spacing: 0.03em; line-height: 1.55; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--sugi); color: #fff; padding: 8px 16px; }
.skip-link:focus { left: 8px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(246, 243, 236, 0.97);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(51, 96, 74, 0.35);
  backdrop-filter: blur(10px);
}
.header-inner {
  width: min(var(--content), calc(100% - 34px));
  margin: 0 auto; min-height: 70px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 3px;
  background: var(--sugi); color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 19px;
  display: grid; place-items: center;
}
.brand-text { font-size: 15px; font-weight: 700; line-height: 1.35; }
.brand-text small {
  display: block; font-family: var(--sans); font-size: 10.5px;
  color: var(--shu); font-weight: 700; letter-spacing: 0.16em;
}

/* PCナビ */
.global-nav { display: flex; align-items: stretch; gap: 0; }
.nav-group { position: relative; }
.nav-group > a, .nav-group > button {
  display: flex; align-items: center; gap: 4px; height: 70px; padding: 0 13px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--ink);
  text-decoration: none;
}
.nav-group > a:hover, .nav-group > button:hover { color: var(--shu); }
.nav-group > button::after {
  content: ""; width: 6px; height: 6px; margin-left: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.nav-drop {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  min-width: 262px; padding: 9px;
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--sugi);
  box-shadow: var(--shadow); display: none;
  max-height: calc(100vh - 94px); overflow-y: auto;
}
.nav-group:hover .nav-drop,
.nav-group:focus-within .nav-drop,
.nav-group.open .nav-drop { display: block; }
.nav-drop a {
  display: block; padding: 9px 13px; border-radius: 3px;
  font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink);
}
.nav-drop a:hover { background: var(--sugi-soft); color: var(--sugi-dark); }
.nav-drop a small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 400; line-height: 1.5; }
.menu-button { display: none; }

@media (max-width: 980px) {
  .global-nav {
    position: fixed; top: 0; right: 0;
    height: 100vh; height: 100dvh;
    width: min(330px, 88vw);
    flex-direction: column; gap: 0; align-items: stretch;
    background: var(--panel); border-left: 1px solid var(--line);
    padding: 82px 12px 30px; overflow-y: auto;
    transform: translateX(105%); visibility: hidden;
    transition: transform .25s ease, visibility .25s ease;
    box-shadow: -12px 0 30px rgba(35, 33, 29, 0.14); z-index: 70;
  }
  .global-nav.open { transform: translateX(0); visibility: visible; }
  .nav-group > a, .nav-group > button {
    width: 100%; height: auto; padding: 13px 10px; justify-content: space-between;
    border-bottom: 1px solid var(--line); font-size: 15px;
  }
  .nav-drop {
    position: static; transform: none; display: none; min-width: 0;
    max-height: none; overflow: visible;
    border: 0; border-left: 3px solid var(--sugi-soft); border-radius: 0;
    box-shadow: none; background: none; padding: 4px 0 4px 10px; margin: 4px 0 8px;
  }
  .nav-group.open .nav-drop { display: block; }
  .nav-group:hover .nav-drop { display: none; }
  .nav-group.open:hover .nav-drop { display: block; }
  .menu-button {
    display: grid; place-items: center;
    width: 44px; height: 44px; border-radius: 3px;
    background: var(--sugi); border: 0; cursor: pointer; position: relative; z-index: 80;
  }
  .menu-button span, .menu-button::before, .menu-button::after {
    content: ""; display: block; width: 21px; height: 2px; background: #fff;
    margin: 3px auto; transition: transform .2s ease, opacity .2s ease;
  }
  .menu-button[aria-expanded="true"]::before { transform: translateY(5px) rotate(45deg); }
  .menu-button[aria-expanded="true"] span { opacity: 0; }
  .menu-button[aria-expanded="true"]::after { transform: translateY(-5px) rotate(-45deg); }
}

/* ---------- ページ本体 ---------- */
.page { width: min(var(--content), calc(100% - 34px)); margin: 0 auto; padding: 0 0 60px; }
.page-head { padding: 26px 0 8px; }
.breadcrumb { font-size: 12.5px; color: var(--muted); display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span { color: var(--line); }
.breadcrumb span:last-child { color: var(--muted); }

.page h1 {
  margin: 0 0 18px; font-size: clamp(25px, 3.6vw, 36px);
  padding-bottom: 16px; position: relative;
}
.page h1::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 68px; height: 3px; background: var(--shu);
}
.page .lead { font-size: 16.5px; color: var(--ink-soft); margin: 0 0 10px; max-width: 800px; }
.hero-note {
  display: inline-block; margin: 6px 0 0; padding: 5px 14px;
  background: var(--kincha-soft); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); border-radius: 999px;
}

/* 目次 */
.toc {
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--sugi);
  padding: 20px 26px; margin: 30px 0 36px;
}
.toc h2 { margin: 0 0 8px; font-size: 17px; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 36px; font-size: 14.5px; }
.toc li { margin: 5px 0; break-inside: avoid; }

/* セクション */
.sec { margin: 0 0 46px; scroll-margin-top: 92px; }
.sec > h2 {
  font-size: clamp(21px, 2.8vw, 27px); margin: 46px 0 20px;
  padding: 0 0 12px; border-bottom: 2px solid var(--sugi);
}
.sec p { margin: 0 0 16px; }
.sec h3 {
  font-size: 18.5px; margin: 32px 0 12px; padding-left: 13px;
  border-left: 4px solid var(--shu);
}
.sec h4 { font-size: 16px; margin: 22px 0 8px; color: var(--sugi-dark); }
.sec ul, .sec ol { margin: 0 0 18px; padding-left: 24px; }
.sec li { margin: 6px 0; }
.sec strong { font-weight: 700; }
em.mark { font-style: normal; background: linear-gradient(transparent 62%, #f3e0a8 62%); font-weight: 700; }

/* 手順リスト */
ol.steps { list-style: none; margin: 22px 0; padding: 0; counter-reset: st; display: grid; gap: 12px; }
ol.steps > li {
  counter-increment: st; position: relative;
  background: var(--panel); border: 1px solid var(--line);
  padding: 16px 20px 16px 68px;
}
ol.steps > li::before {
  content: counter(st, decimal-leading-zero);
  position: absolute; left: 20px; top: 15px;
  font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--sugi);
}
ol.steps > li strong { display: block; font-size: 16.5px; font-family: var(--serif); margin-bottom: 2px; }
ol.steps > li span { display: block; font-size: 14.5px; color: var(--ink-soft); line-height: 1.8; }

/* カード（リンク集） */
ul.cards { list-style: none; margin: 22px 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
ul.cards a {
  display: block; height: 100%; padding: 16px 20px;
  background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
ul.cards a:hover { border-color: var(--sugi); transform: translateY(-2px); }
.card-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 16.5px; margin-bottom: 3px; }
.card-desc { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* 注意・ポイント枠 */
.box { padding: 18px 24px; margin: 22px 0; border: 1px solid var(--line); background: var(--panel); }
.box-title { font-family: var(--serif); font-weight: 700; font-size: 16.5px; margin: 0 0 8px !important; }
.box p { font-size: 14.5px; margin: 0 0 8px; }
.box p:last-child, .box ul:last-child, .box ol:last-child { margin-bottom: 0; }
.box ul, .box ol { font-size: 14.5px; margin-bottom: 0; }
.box-note { border-left: 5px solid var(--sugi); }
.box-note .box-title { color: var(--sugi-dark); }
.box-warn { border-left: 5px solid var(--shu); background: var(--shu-soft); }
.box-warn .box-title { color: var(--shu); }
.box-tip { border-left: 5px solid var(--kincha); background: var(--kincha-soft); }
.box-tip .box-title { color: #7d5f24; }
.box-money { border-left: 5px solid var(--sugi); background: var(--sugi-soft); }
.box-money .box-title { color: var(--sugi-dark); }

/* テーブル */
.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 14.5px; min-width: 540px; }
caption { caption-side: top; text-align: left; padding: 10px 16px; font-size: 13px; color: var(--muted); background: var(--panel-2); }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.75; }
thead th { background: var(--sugi); color: #fff; font-weight: 700; white-space: nowrap; }
tbody tr:nth-child(even) { background: rgba(221, 214, 200, 0.2); }
tbody tr:last-child td { border-bottom: 0; }

/* Q&A */
.qa { background: var(--panel); border: 1px solid var(--line); padding: 18px 24px; margin: 0 0 12px; }
.qa .q { font-family: var(--serif); font-weight: 700; font-size: 16.5px; margin: 0 0 10px; padding-left: 28px; position: relative; }
.qa .q::before { content: "Q"; position: absolute; left: 0; top: 0; color: var(--shu); font-size: 18px; }
.qa .a { font-size: 14.5px; color: var(--ink-soft); padding-left: 28px; position: relative; border-top: 1px dashed var(--line); padding-top: 10px; }
.qa .a::before { content: "A"; position: absolute; left: 0; top: 10px; color: var(--sugi); font-family: var(--serif); font-size: 18px; font-weight: 700; }
.qa .a p { margin: 0 0 8px; }
.qa .a p:last-child { margin-bottom: 0; }

/* アフィリエイト枠 */
.aff-box {
  margin: 30px 0; padding: 22px 26px 20px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--kincha); border-top: 4px solid var(--kincha);
  position: relative;
}
.aff-pr {
  position: absolute; top: -1px; right: 0;
  margin: 0; padding: 2px 12px;
  background: var(--kincha); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
}
.aff-title { margin: 0 0 8px !important; font-size: 18px; padding: 0 !important; border: 0 !important; font-family: var(--serif); }
.aff-body { font-size: 14.5px; margin: 0 0 16px; color: var(--ink-soft); }
.aff-action { margin: 0 0 10px; }
.aff-button {
  display: inline-block; padding: 13px 32px; border-radius: 999px;
  background: var(--shu); color: #fff; font-weight: 700; font-size: 15.5px;
  text-decoration: none; border: 2px solid var(--shu); transition: opacity .15s ease;
}
.aff-button:hover { opacity: .85; color: #fff; }
.aff-button.is-placeholder { background: var(--muted); border-color: var(--muted); cursor: default; }
.aff-note { font-size: 12px; color: var(--muted); margin: 0; }

/* 関連リンク */
.related { margin: 46px 0 0; padding: 22px 26px; background: var(--sugi-soft); border: 1px solid var(--line); }
.related h2 { margin: 0 0 8px; font-size: 17px; border: 0; padding: 0; }
.related ul { margin: 0; padding-left: 20px; font-size: 14.5px; }
.related li { margin: 5px 0; }

/* 図解 */
figure.fig { margin: 26px 0; }
figure.fig img, figure.fig svg { width: 100%; border: 1px solid var(--line); background: var(--panel); }
figure.fig figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; text-align: center; }

/* トップページ専用 */
.hero-top { background: var(--panel); border-bottom: 1px solid var(--line); margin-bottom: 0; }
.top-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center; }
.eyebrow { display: inline-block; margin: 0 0 8px; color: var(--shu); font-size: 13px; font-weight: 700; letter-spacing: 0.16em; }
.top-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 0; }
.button {
  display: inline-block; padding: 13px 28px; border-radius: 999px;
  background: var(--sugi); color: #fff; font-weight: 700; font-size: 15px;
  text-decoration: none; border: 2px solid var(--sugi); transition: opacity .15s ease;
}
.button:hover { opacity: .85; color: #fff; }
.button.ghost { background: transparent; color: var(--sugi-dark); }
.button.ghost:hover { background: var(--sugi); color: #fff; opacity: 1; }

.chapter-list { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 14px; counter-reset: ch; }
.chapter-list > li { counter-increment: ch; background: var(--panel); border: 1px solid var(--line); }
.chapter-list > li > a {
  display: block; padding: 20px 24px 20px 78px; position: relative; text-decoration: none; color: var(--ink);
}
.chapter-list > li > a::before {
  content: "第" counter(ch) "章"; position: absolute; left: 20px; top: 22px;
  font-family: var(--serif); font-size: 13px; font-weight: 700; color: #fff;
  background: var(--sugi); padding: 3px 8px; letter-spacing: .05em;
}
.chapter-list > li > a:hover { background: var(--sugi-soft); }
.chapter-list h3 { margin: 0 0 4px; padding: 0; border: 0; font-size: 18.5px; font-family: var(--serif); }
.chapter-list p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); padding: 18px 20px; text-align: center; }
.stat .num { display: block; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--sugi); line-height: 1.3; }
.stat .cap { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

/* チェックリスト */
.chk { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 7px; }
.chk li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); padding: 10px 14px; font-size: 15px; }
.chk input[type="checkbox"] { width: 19px; height: 19px; margin-top: 5px; accent-color: var(--sugi); flex: none; }
.chk label { cursor: pointer; line-height: 1.7; }

/* 用語集 */
.term { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--kincha); padding: 15px 20px; margin: 12px 0; }
.term dt { font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--sugi-dark); margin-bottom: 5px; }
.term dd { margin: 0; font-size: 14.5px; }
.jump-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; }
.jump-row a { background: var(--sugi); color: #fff; border-radius: 999px; padding: 5px 15px; font-size: 13px; font-weight: 600; text-decoration: none; }
.jump-row a:hover { background: var(--shu); color: #fff; }

/* コラム一覧 */
.column-list { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.column-list li { background: var(--panel); border: 1px solid var(--line); padding: 20px 24px; }
.column-list h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 18px; }
.column-list h3 a { text-decoration: none; }
.column-list p { margin: 6px 0 0; font-size: 14.5px; color: var(--muted); }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.meta-row .cat { background: var(--shu-soft); color: var(--shu); font-weight: 700; border-radius: 999px; padding: 3px 12px; }

/* フォーム */
.form { display: grid; gap: 20px; max-width: 640px; margin: 24px 0; }
.form .field label { display: block; font-weight: 700; margin-bottom: 6px; }
.form .field label small { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 12.5px; }
.form input[type="text"], .form input[type="email"], .form select, .form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--panel); color: var(--ink); font: inherit; line-height: 1.7;
}
.form textarea { min-height: 180px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--sugi); outline-offset: 1px; border-color: var(--sugi); }
.form .button { justify-self: start; border: 0; cursor: pointer; font-family: var(--sans); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* フッター */
.site-footer { margin-top: 60px; background: var(--sugi-dark); color: #dfe6e0; }
.site-footer a { color: #fff; text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: #f0c0ad; text-decoration: underline; }
.footer-inner {
  width: min(var(--content), calc(100% - 34px)); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 2.4fr; gap: 36px; padding: 44px 0 28px;
}
.footer-brand .brand-mark { background: #fff; color: var(--sugi-dark); margin-bottom: 10px; }
.footer-brand p { margin: 0 0 8px; font-size: 14.5px; font-family: var(--serif); }
.footer-brand .footer-lead { font-family: var(--sans); font-size: 12.5px; color: #b3c2b8; line-height: 1.8; }
.footer-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.footer-cols h2 { font-size: 14px; margin: 0 0 10px; color: #f0c0ad; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sibling {
  width: min(var(--content), calc(100% - 34px)); margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,.16); padding: 16px 0 10px;
}
.sibling p { margin: 0 0 8px; font-size: 12.5px; color: #b3c2b8; }
.sibling ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.copyright {
  width: min(var(--content), calc(100% - 34px)); margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,.16); padding: 14px 0 24px;
  font-size: 12px; color: #9fb0a5;
}

/* トップへ戻る */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--sugi); color: #fff; font-size: 19px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 980px) {
  .top-grid { grid-template-columns: 1fr; gap: 24px; }
  ul.cards { grid-template-columns: 1fr; }
  .toc ol { columns: 1; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .page h1 { font-size: 24px; }
  .aff-box { padding: 20px 18px 18px; }
  .aff-button { display: block; text-align: center; padding: 14px 10px; }
  ol.steps > li { padding: 15px 16px 15px 58px; }
  ol.steps > li::before { left: 14px; font-size: 21px; }
  th, td { padding: 10px 12px; }
  .sec > h2 { font-size: 20px; }
  .box { padding: 16px 18px; }
  .qa { padding: 16px 18px; }
}

/* 印刷 */
@media print {
  .site-header, .site-footer, .to-top, .aff-box, .breadcrumb, .toc { display: none !important; }
  body { background: #fff; background-image: none; }
  .box, .chk li, ol.steps > li, .qa { break-inside: avoid; }
  a { color: #000; text-decoration: none; }
}
