/* ============================================
   13分でわかる初めての一人暮らし - スタイルシート
   ============================================ */
:root {
  --main: #0e9f9a;        /* メインカラー（ティール） */
  --main-dark: #0b7d79;
  --main-light: #e6f6f5;
  --accent: #ff8a5c;      /* アクセント（コーラル） */
  --accent-dark: #e8703f;
  --text: #333a40;
  --text-light: #6b7680;
  --bg: #ffffff;
  --bg-soft: #f7fafa;
  --border: #dde5e7;
  --yellow: #ffd166;
  --max-width: 1080px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(20, 60, 60, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--main-dark); }
a:hover { opacity: .85; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; gap: 16px;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-logo img { width: 42px; height: 42px; }
.site-logo .logo-text { font-weight: 700; font-size: 1.05rem; color: var(--text); line-height: 1.3; }
.site-logo .logo-text small { display: block; font-size: .68rem; color: var(--main-dark); font-weight: 600; letter-spacing: .05em; }

/* グローバルナビ（PC） */
.global-nav ul { display: flex; list-style: none; gap: 2px; flex-wrap: wrap; }
.global-nav a {
  display: block; padding: 8px 12px; text-decoration: none;
  color: var(--text); font-size: .88rem; font-weight: 600;
  border-radius: 8px; white-space: nowrap;
}
.global-nav a:hover { background: var(--main-light); color: var(--main-dark); opacity: 1; }
.global-nav a[aria-current="page"] { background: var(--main); color: #fff; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; position: relative;
}
.nav-toggle span {
  display: block; width: 24px; height: 2.5px; background: var(--text);
  margin: 5px auto; border-radius: 2px; transition: .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- パンくず ---------- */
.breadcrumb { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.breadcrumb ol {
  max-width: var(--max-width); margin: 0 auto; padding: 8px 20px;
  list-style: none; display: flex; flex-wrap: wrap; gap: 4px;
  font-size: .78rem; color: var(--text-light);
}
.breadcrumb li + li::before { content: "›"; margin: 0 6px; color: var(--text-light); }
.breadcrumb a { color: var(--main-dark); text-decoration: none; }

/* ---------- ヒーロー ---------- */
.hero {
  background: linear-gradient(135deg, var(--main-light) 0%, #fff7f0 100%);
  padding: 40px 0 30px;
}
.hero-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 30px; align-items: center;
}
.hero h1 { font-size: 2rem; line-height: 1.4; margin-bottom: 16px; }
.hero h1 .hero-num { color: var(--main-dark); font-size: 2.6rem; }
.hero .lead { font-size: 1rem; color: var(--text-light); margin-bottom: 20px; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.hero-badge {
  background: #fff; border: 1.5px solid var(--main); color: var(--main-dark);
  font-size: .8rem; font-weight: 700; padding: 4px 14px; border-radius: 999px;
}

/* ---------- ページヒーロー（下層） ---------- */
.page-hero { background: linear-gradient(135deg, var(--main-light) 0%, #fff7f0 100%); padding: 28px 0; }
.page-hero-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: center;
}
.page-hero h1 { font-size: 1.7rem; line-height: 1.45; margin-bottom: 10px; }
.page-hero .lead { color: var(--text-light); font-size: .95rem; }
.page-hero img { max-height: 190px; margin: 0 auto; }

/* ---------- メイン ---------- */
.main-content { padding: 36px 0 60px; }
.article-body h2 {
  font-size: 1.45rem; margin: 48px 0 20px; padding: 12px 16px;
  background: var(--main-light); border-left: 6px solid var(--main);
  border-radius: 0 8px 8px 0; line-height: 1.5;
}
.article-body h2:first-child { margin-top: 0; }
.article-body h3 {
  font-size: 1.15rem; margin: 32px 0 14px; padding-bottom: 8px;
  border-bottom: 2.5px solid var(--main); line-height: 1.5;
}
.article-body h4 { font-size: 1rem; margin: 24px 0 10px; color: var(--main-dark); }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 1.4em; }
.article-body li { margin-bottom: 6px; }

/* 目次 */
.toc {
  background: var(--bg-soft); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 32px;
}
.toc-title { font-weight: 700; font-size: 1rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.toc-title::before { content: "📑"; }
.toc ol { margin: 0 0 0 1.3em; font-size: .92rem; }
.toc li { margin-bottom: 4px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* テーブル */
.table-wrap { overflow-x: auto; margin: 0 0 20px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 480px; }
caption { text-align: left; font-size: .82rem; color: var(--text-light); margin-bottom: 6px; }
th, td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--main); color: #fff; font-weight: 700; }
tbody th { background: var(--main-light); font-weight: 600; width: 32%; }
tbody tr:nth-child(even) td { background: var(--bg-soft); }
td.num { text-align: right; white-space: nowrap; }

/* ボックス */
.point-box, .caution-box, .memo-box {
  border-radius: var(--radius); padding: 18px 20px 14px; margin: 0 0 20px;
  position: relative; border: 1.5px solid;
}
.point-box { background: var(--main-light); border-color: var(--main); }
.caution-box { background: #fff3ec; border-color: var(--accent); }
.memo-box { background: #fffaeb; border-color: var(--yellow); }
.box-label { font-weight: 700; font-size: .9rem; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.point-box .box-label { color: var(--main-dark); }
.point-box .box-label::before { content: "✅"; }
.caution-box .box-label { color: var(--accent-dark); }
.caution-box .box-label::before { content: "⚠️"; }
.memo-box .box-label { color: #b8860b; }
.memo-box .box-label::before { content: "💡"; }
.point-box p:last-child, .caution-box p:last-child, .memo-box p:last-child { margin-bottom: 4px; }

/* チェックリスト */
.checklist { list-style: none; margin: 0 0 20px !important; }
.checklist li {
  padding: 10px 14px 10px 40px; background: var(--bg-soft);
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px;
  position: relative; font-size: .95rem;
}
.checklist li::before {
  content: "☐"; position: absolute; left: 13px; top: 9px;
  color: var(--main); font-size: 1.15rem; font-weight: 700;
}

/* ステップ */
.step-list { counter-reset: step; list-style: none; margin: 0 0 24px !important; }
.step-list > li {
  counter-increment: step; position: relative;
  padding: 16px 18px 12px 66px; margin-bottom: 14px;
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.step-list > li::before {
  content: "STEP " counter(step);
  position: absolute; left: 14px; top: 16px;
  background: var(--main); color: #fff; font-size: .62rem; font-weight: 700;
  padding: 3px 6px; border-radius: 6px; letter-spacing: .03em;
}
.step-list .step-title { font-weight: 700; font-size: 1.02rem; display: block; margin-bottom: 4px; }
.step-list p { font-size: .92rem; margin-bottom: 6px; color: var(--text-light); }

/* カードグリッド（トップの章一覧） */
.card-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0 8px;
}
.guide-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.guide-card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(20,60,60,.14); opacity: 1; }
.guide-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.guide-card .card-body { padding: 14px 16px 16px; flex: 1; }
.guide-card .card-num { font-size: .7rem; font-weight: 700; color: var(--accent-dark); letter-spacing: .08em; }
.guide-card h3 { font-size: 1.02rem; margin: 4px 0 6px; border: none; padding: 0; }
.guide-card p { font-size: .84rem; color: var(--text-light); margin: 0; line-height: 1.7; }

/* CTAバナー */
.cta-banner {
  background: linear-gradient(120deg, var(--main) 0%, var(--main-dark) 100%);
  border-radius: var(--radius); padding: 28px 24px; margin: 40px 0;
  color: #fff; text-align: center;
}
.cta-banner p { margin-bottom: 14px; font-weight: 600; }
.cta-banner .btn { background: #fff; color: var(--main-dark); }

.btn {
  display: inline-block; padding: 12px 32px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none;
  font-size: .95rem; box-shadow: var(--shadow); transition: transform .15s;
}
.btn:hover { transform: scale(1.04); opacity: 1; }

/* 前後ページナビ */
.page-nav { display: flex; justify-content: space-between; gap: 12px; margin: 48px 0 0; flex-wrap: wrap; }
.page-nav a {
  flex: 1; min-width: 220px; text-decoration: none;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; color: var(--text); background: #fff; box-shadow: var(--shadow);
}
.page-nav a small { display: block; color: var(--text-light); font-size: .72rem; }
.page-nav a span { font-weight: 700; font-size: .92rem; }
.page-nav .next { text-align: right; }

/* FAQアコーディオン */
details.faq-item {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; background: #fff; box-shadow: var(--shadow);
  overflow: hidden;
}
details.faq-item summary {
  cursor: pointer; padding: 16px 18px 16px 48px; font-weight: 700;
  position: relative; list-style: none; font-size: .98rem; line-height: 1.6;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::before {
  content: "Q"; position: absolute; left: 14px; top: 15px;
  color: #fff; background: var(--main); width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: .8rem;
}
details.faq-item[open] summary { background: var(--main-light); }
details.faq-item .faq-answer { padding: 14px 18px 14px 48px; position: relative; border-top: 1px dashed var(--border); }
details.faq-item .faq-answer::before {
  content: "A"; position: absolute; left: 14px; top: 15px;
  color: #fff; background: var(--accent); width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: .8rem;
}
details.faq-item .faq-answer p { margin-bottom: 8px; font-size: .94rem; }

/* 公開日・更新日 */
.update-date { font-size: .8rem; color: var(--text-light); margin: 0 0 20px; }

/* 用語集 */
dl.glossary dt {
  background: var(--main-light); padding: 8px 14px; margin-top: 18px;
  border-left: 4px solid var(--main); border-radius: 0 6px 6px 0;
  font-weight: 700; font-size: 1rem;
}
dl.glossary dd { margin: 8px 0 0; padding: 0 4px 0 18px; font-size: .95rem; }

/* コラム一覧 */
.post-item {
  display: block; background: #fff; border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 14px; text-decoration: none; color: var(--text);
}
.post-item:hover { border-color: var(--main); opacity: 1; }
.post-item .post-date { font-size: .75rem; color: var(--text-light); }
.post-item h2, .post-item h3 { font-size: 1.05rem; margin: 4px 0 6px; border: none; background: none; padding: 0; }
.post-item p { font-size: .88rem; color: var(--text-light); margin: 0; }

/* 記事内写真 */
figure.photo { margin: 0 0 22px; }
figure.photo img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
figure.photo figcaption { font-size: .78rem; color: var(--text-light); margin-top: 8px; }

/* 関連リンク */
.related-links { background: var(--bg-soft); border-radius: var(--radius); padding: 20px 24px; margin: 32px 0; }
.related-links h2 { background: none; border: none; padding: 0; margin: 0 0 12px; font-size: 1.1rem; }
.related-links ul { list-style: none; margin: 0; }
.related-links li { padding: 6px 0 6px 22px; position: relative; border-bottom: 1px dashed var(--border); }
.related-links li::before { content: "▶"; position: absolute; left: 0; color: var(--main); font-size: .7rem; top: 12px; }
.related-links a { text-decoration: none; font-size: .93rem; }

/* ---------- フッター ---------- */
.site-footer { background: #223235; color: #cfe0e0; margin-top: 40px; }
.footer-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 36px 20px 20px;
  display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 30px;
}
.footer-inner h2 { font-size: 1rem; color: #fff; margin-bottom: 10px; }
.footer-inner p { font-size: .82rem; line-height: 1.8; }
.footer-nav ul { list-style: none; }
.footer-nav li { margin-bottom: 6px; }
.footer-nav a { color: #cfe0e0; text-decoration: none; font-size: .85rem; }
.footer-nav a:hover { color: #fff; }
.copyright {
  text-align: center; font-size: .75rem; padding: 14px 20px;
  border-top: 1px solid #3a4d50; color: #9db4b4;
}

/* トップに戻る */
#to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--main); color: #fff; font-size: 1.2rem; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
#to-top.visible { opacity: .9; pointer-events: auto; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .global-nav a { font-size: .8rem; padding: 6px 8px; }
}

@media (max-width: 768px) {
  body { font-size: 15.5px; }
  .nav-toggle { display: block; }
  .global-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0,0,0,.08);
  }
  .global-nav.open { display: block; }
  .global-nav ul { flex-direction: column; gap: 0; padding: 8px 12px 14px; }
  .global-nav a { padding: 12px 14px; font-size: .95rem; border-bottom: 1px dashed var(--border); border-radius: 0; }
  .hero-inner, .page-hero-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.5rem; }
  .hero h1 .hero-num { font-size: 2rem; }
  .page-hero h1 { font-size: 1.35rem; }
  .page-hero img { max-height: 150px; }
  .article-body h2 { font-size: 1.2rem; margin-top: 40px; }
  .article-body h3 { font-size: 1.05rem; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  tbody th { width: auto; }
}
