/* グルリザ 操作マニュアル
   デジタル庁デザインシステム（DADS）のカラー・タイポグラフィ・余白・フォーカス表現に準拠 */

:root {
  /* カラー（DADS プリミティブ） */
  --blue-50: #E8F1FE;
  --blue-100: #D9E6FF;
  --blue-900: #0017C1;   /* キーカラー・リンク */
  --blue-1000: #00118F;  /* ホバー */
  --blue-1100: #000082;  /* アクティブ */
  --purple-900: #5C10BE; /* 訪問済みリンク */
  --gray-900: #1A1A1C;   /* 本文 */
  --gray-700: #4D4D4D;
  --gray-600: #666666;   /* 補足テキスト */
  --gray-420: #949497;   /* 強い罫線 */
  --gray-200: #CCCCCC;
  --gray-100: #E6E6E6;
  --gray-50: #F2F2F2;    /* 背景 */
  --white: #FFFFFF;
  --red-800: #EC0000;
  --yellow-50: #FFFBE6;
  --yellow-900: #927200;
  --yellow-300: #FFD43D; /* フォーカス */

  --text: var(--gray-900);
  --text-sub: var(--gray-600);
  --border: var(--gray-200);
  --bg: var(--white);
  --bg-sub: var(--gray-50);
  --link: var(--blue-900);

  /* 余白（8px グリッド） */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px;
  --radius: 8px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + var(--s2)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 3px; }
a:visited { color: var(--purple-900); }
a:hover { color: var(--blue-1000); text-decoration-thickness: 3px; }
a:active { color: var(--blue-1100); }
/* DADS のフォーカスリング：黒の外枠＋黄色 */
:focus-visible {
  outline: 4px solid var(--gray-900);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--yellow-300);
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s2); top: var(--s1); z-index: 100; background: var(--white); padding: var(--s1) var(--s2); }

/* ── ヘッダー ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -2px 0 var(--blue-900);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--s3);
  height: var(--header-h); max-width: 1440px; margin: 0 auto; padding: 0 var(--s3);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand:visited { color: var(--text); }
.brand__logo { display: block; width: auto; height: 36px; }
.brand__name { padding-left: 12px; border-left: 1px solid var(--border); line-height: 1.4; }
.search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.search input {
  width: 100%; height: 40px; padding: 0 var(--s2);
  border: 1px solid var(--gray-420); border-radius: var(--radius);
  font: inherit; font-size: 16px; background: var(--white); color: var(--text);
}
.search input::placeholder { color: var(--text-sub); }
.search__results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  margin: 0; padding: var(--s1) 0; list-style: none;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
}
.search__results a { display: block; padding: var(--s1) var(--s2); text-decoration: none; }
.search__results a:hover { background: var(--blue-50); }
.search__results small { display: block; color: var(--text-sub); font-size: 13px; }
.search__results .none { padding: var(--s1) var(--s2); color: var(--text-sub); }
.menu-btn { display: none; }

/* ── 3カラムレイアウト ── */
.layout {
  display: grid; grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1440px; margin: 0 auto;
}
.layout--toc { grid-template-columns: 280px minmax(0, 1fr) 260px; }
main { padding: var(--s5) var(--s6) var(--s8); min-width: 0; }
main > *, .article { max-width: 800px; }

/* ── サイドナビ ── */
.sidenav {
  position: sticky; top: var(--header-h); align-self: start;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: var(--s3) var(--s2); border-right: 1px solid var(--border);
}
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav > ul > li { border-bottom: 1px solid var(--gray-100); }
.sidenav a, .sidenav summary, .sidenav .planned {
  display: block; padding: 12px var(--s1); font-size: 15px; line-height: 1.5;
}
.sidenav a { color: var(--text); text-decoration: none; border-radius: 4px; }
.sidenav a:hover { background: var(--blue-50); color: var(--blue-1000); text-decoration: underline; }
.sidenav a[aria-current="page"] {
  color: var(--blue-900); font-weight: 700; background: var(--blue-50);
  box-shadow: inset 4px 0 0 var(--blue-900);
}
.sidenav summary {
  cursor: pointer; font-weight: 700; list-style: none; position: relative; padding-right: var(--s4);
}
.sidenav summary::-webkit-details-marker { display: none; }
.sidenav summary::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--gray-700); border-bottom: 2px solid var(--gray-700);
  transform: translateY(-70%) rotate(45deg); transition: transform .15s;
}
.sidenav details[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.sidenav details ul { padding: 0 0 var(--s1) var(--s2); }
.sidenav details a, .sidenav details .planned { font-size: 14px; padding: 8px var(--s1); }

.planned { color: var(--text-sub); }
.chip {
  display: inline-block; margin-left: var(--s1); padding: 0 8px;
  border: 1px solid var(--gray-420); border-radius: 4px;
  font-size: 12px; line-height: 20px; color: var(--text-sub); vertical-align: 1px;
}
.planned-link { color: var(--text-sub); }

/* ── 目次（右） ── */
.toc {
  position: sticky; top: calc(var(--header-h) + var(--s5)); align-self: start;
  max-height: calc(100vh - var(--header-h) - var(--s8)); overflow-y: auto;
  margin: var(--s5) var(--s3) 0 0; padding-left: var(--s2); border-left: 1px solid var(--border);
}
.toc__title { margin: 0 0 var(--s1); font-size: 14px; font-weight: 700; color: var(--text-sub); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px var(--s1); font-size: 14px; line-height: 1.5; color: var(--text); text-decoration: none; border-radius: 4px; }
.toc a:hover { background: var(--blue-50); color: var(--blue-1000); text-decoration: underline; }

/* ── 見出し・本文 ── */
.breadcrumb ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 var(--s3); padding: 0; font-size: 14px; color: var(--text-sub); }
.breadcrumb li + li::before { content: "›"; margin: 0 var(--s1); }
.article h1, .page-title {
  margin: 0 0 var(--s2); padding-left: var(--s2);
  border-left: 6px solid var(--blue-900);
  font-size: 32px; line-height: 1.4; font-weight: 700; letter-spacing: 0.01em;
}
.meta { margin: 0 0 var(--s1); color: var(--text-sub); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: var(--s1); list-style: none; margin: 0 0 var(--s3); padding: 0; }
.tags li { padding: 2px 12px; border-radius: 999px; background: var(--blue-50); color: var(--blue-900); font-size: 13px; }
.lead { margin: 0 0 var(--s4); font-size: 17px; line-height: 1.8; }

.before {
  margin: 0 0 var(--s5); padding: var(--s3);
  background: var(--bg-sub); border-radius: var(--radius);
}
.before h2 { margin: 0 0 var(--s1); font-size: 18px; }
.before ul { margin: 0; padding-left: 1.4em; }

.step, .extra, .related { padding-top: var(--s5); margin-top: var(--s5); border-top: 1px solid var(--border); }
.step:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.step h2, .extra h2, .related h2 {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 var(--s2); font-size: 24px; line-height: 1.5; font-weight: 700;
}
.step__num {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue-900); color: var(--white); font-size: 18px;
}
.step p, .extra p { margin: 0 0 var(--s2); }

.shot { margin: var(--s3) 0; }
.shot a { display: block; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shot a:hover { border-color: var(--blue-900); }
.shot img { display: block; width: 100%; }

/* お知らせ（DADS Notification Banner 相当） */
.notice { margin: var(--s3) 0; padding: var(--s2) var(--s3); border-radius: var(--radius); border: 1px solid; }
.notice p { margin: 0; }
.notice__title { font-weight: 700; margin-bottom: 4px !important; }
.notice--info { background: var(--blue-50); border-color: var(--blue-900); }
.notice--info .notice__title { color: var(--blue-900); }
.notice--warn { background: var(--yellow-50); border-color: var(--yellow-900); }
.notice--warn .notice__title { color: var(--yellow-900); }

/* 表 */
.table-wrap { overflow-x: auto; margin: 0 0 var(--s3); }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
th, td { padding: 12px var(--s2); border: 1px solid var(--border); text-align: left; vertical-align: top; }
thead th { background: var(--bg-sub); font-weight: 700; }
tbody th { font-weight: 700; white-space: nowrap; background: #FAFAFA; }
.req { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--red-800); color: var(--white); font-size: 12px; white-space: nowrap; }

.related ul, .link-list { list-style: none; margin: 0; padding: 0; }
.related li, .link-list li { padding: 12px 0; border-bottom: 1px solid var(--gray-100); }

/* ── トップページ ── */
.section-title { margin: var(--s6) 0 var(--s3); font-size: 24px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3); max-width: none; }
main > .cats { max-width: 1040px; }
.cat { padding: var(--s3); border: 1px solid var(--border); border-radius: var(--radius); }
.cat h3 { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s1); font-size: 18px; }
.cat h3 a { color: var(--text); }
.cat__count { font-size: 13px; font-weight: 400; color: var(--text-sub); white-space: nowrap; }
.cat ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.cat li { padding: 6px 0; border-top: 1px solid var(--gray-100); }
.legend { color: var(--text-sub); font-size: 14px; }

/* ── フッター ── */
.site-footer {
  border-top: 1px solid var(--border); background: var(--bg-sub);
  padding: var(--s4) var(--s3); text-align: center; font-size: 14px; color: var(--text-sub);
}
.site-footer p { margin: 0; }
.site-footer p:first-child { font-weight: 700; color: var(--text); }

/* ── レスポンシブ ── */
@media (max-width: 1200px) {
  .layout--toc { grid-template-columns: 260px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .site-header__inner { gap: var(--s1); padding: 0 var(--s2); }
  .brand { font-size: 15px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .menu-btn {
    display: block; flex: none; height: 40px; padding: 0 12px;
    border: 1px solid var(--gray-420); border-radius: var(--radius); background: var(--white);
    font: inherit; font-size: 14px; color: var(--text);
  }
  .layout, .layout--toc { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--border); }
  .sidenav.is-open { display: block; }
  main { padding: var(--s3) var(--s2) var(--s6); }
  .article h1, .page-title { font-size: 26px; }
  .step h2, .extra h2, .related h2 { font-size: 20px; }
  .cats { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .brand__logo { height: 28px; }
  .brand__name { display: none; }
}
