@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --ink: #1c2333;
  --ink-soft: #3d465c;
  --paper: #faf8f4;
  --paper-raised: #ffffff;
  --line: #d9d3c7;
  --seal: #8a2e2e;
  --seal-soft: #f3e6e2;
  --sidebar-w: 300px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Serif JP', serif;
  line-height: 1.9;
  font-size: 16px;
}

a { color: var(--seal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

/* ---------- Layout shell ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  color: #e8e6df;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  font-family: 'Noto Sans JP', sans-serif;
  padding: 28px 22px 40px;
}

.sidebar .lang-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 13px;
}

.sidebar .lang-switch a {
  color: #cfcabd;
  padding: 4px 10px;
  border: 1px solid #4a5170;
  border-radius: 3px;
}
.sidebar .lang-switch a.current {
  background: var(--seal);
  border-color: var(--seal);
  color: #fff;
}

.sidebar .home-link {
  display: block;
  font-family: 'Noto Serif JP', serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.6;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #454c68;
}
.sidebar .home-link:hover { text-decoration: none; color: var(--seal-soft); }

.sidebar .toc-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a95a6;
  margin: 0 0 10px 2px;
}

.sidebar ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: articles;
}

.sidebar li { margin-bottom: 2px; }

.sidebar li a {
  display: block;
  color: #d7d3c9;
  font-size: 14px;
  padding: 9px 10px;
  border-radius: 4px;
  line-height: 1.6;
}

.sidebar li a:hover {
  background: #2a3247;
  text-decoration: none;
  color: #fff;
}

.sidebar li a.active {
  background: var(--seal);
  color: #fff;
  font-weight: 500;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 56px 64px 100px;
  max-width: 880px;
}

/* ---------- Title page (index) ---------- */
.doc-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.7;
  margin: 0 0 12px;
}

.doc-title a {
  color: var(--ink);
}
.doc-title a:hover { color: var(--seal); }

.doc-subtitle {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.doc-meta {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--seal-soft);
  border-left: 3px solid var(--seal);
  padding: 14px 18px;
  margin-bottom: 44px;
}

.article-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.article-grid li {
  border-bottom: 1px solid var(--line);
}

.article-grid a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 18px 6px;
  color: var(--ink);
}

.article-grid a:hover {
  color: var(--seal);
  text-decoration: none;
}

.article-num {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: var(--seal);
  min-width: 34px;
  flex-shrink: 0;
}

/* ---------- Section pages ---------- */
.section-eyebrow {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--seal);
  margin-bottom: 6px;
}

h2.section-heading {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ink);
}

.section-body p {
  margin: 0 0 22px;
}

.section-body ul {
  margin: 0 0 22px;
  padding-left: 0;
  list-style: none;
}

.section-body ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
}

.section-body ul li::before {
  content: "・";
  position: absolute;
  left: 0;
  color: var(--seal);
}

.section-body ol.numbered {
  padding-left: 26px;
  margin: 0 0 22px;
}
.section-body ol.numbered li { margin-bottom: 10px; }

.case-block {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink-soft);
  padding: 16px 20px;
  margin: 0 0 22px;
  font-size: 15px;
}

.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
}

.pager a { color: var(--ink); }
.pager a:hover { color: var(--seal); }
.pager .next { text-align: right; }
.pager span.label {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

/* ---------- Mobile ---------- */
.sidebar-toggle {
  display: none;
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ink);
    color: #fff;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 20;
    border: none;
    width: 100%;
    cursor: pointer;
  }

  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    display: none;
  }

  .sidebar.open { display: block; }

  .main { padding: 32px 22px 70px; }
  .doc-title { font-size: 20px; }
}
