@font-face {
  font-family: "HS Heading";
  src: url("/base/heading.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --board: #efeae1;
  --paper: #fff;
  --ink: #2b2622;
  --ink-sub: #6b625a;
  --cover: #3a2e27;
  --line: #d9d1c3;
  --pale: #f6f3ee;
  --link: #6d3a5e;
  --c1: #5b7f6e;
  --c2: #8a6d2f;
  --c3: #5e6a99;
  --c4: #2f7480;
  --c5: #8c5a7a;
  --tab: var(--cover);
  --head: "HS Heading", "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

/* 記事ごとのタブの色 */
.hs-Index_Card-c1, .hs-Rail_Tab-c1, .hs-Article-c1, .hs-Related_Item-c1 { --tab: var(--c1); }
.hs-Index_Card-c2, .hs-Rail_Tab-c2, .hs-Article-c2, .hs-Related_Item-c2 { --tab: var(--c2); }
.hs-Index_Card-c3, .hs-Rail_Tab-c3, .hs-Article-c3, .hs-Related_Item-c3 { --tab: var(--c3); }
.hs-Index_Card-c4, .hs-Rail_Tab-c4, .hs-Article-c4, .hs-Related_Item-c4 { --tab: var(--c4); }
.hs-Index_Card-c5, .hs-Rail_Tab-c5, .hs-Article-c5, .hs-Related_Item-c5 { --tab: var(--c5); }

.hs-Skip {
  position: absolute;
  left: 8px;
  top: -40px;
  background: var(--cover);
  color: #fff;
  padding: 6px 12px;
  z-index: 10;
}
.hs-Skip:focus { top: 8px; }

/* ヘッダー：表紙のラベル */
.hs-Head {
  border-top: 4px solid transparent;
  border-image: linear-gradient(90deg, var(--c1) 0 20%, var(--c2) 20% 40%, var(--c3) 40% 60%, var(--c4) 60% 80%, var(--c5) 80% 100%) 1;
}
.hs-Head_Inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
}
.hs-Head_Label {
  display: block;
  background: var(--paper);
  border: 2px solid var(--cover);
  padding: 10px 18px;
  color: var(--ink);
  text-decoration: none;
  max-width: 100%;
}
.hs-Head_Name { display: block; font-family: var(--head); font-weight: 700; font-size: 1.25rem; line-height: 1.4; }
.hs-Head_Sub { display: block; font-size: .8rem; color: var(--ink-sub); }
.hs-Head_Catch { margin: 0; font-size: .9rem; color: var(--ink-sub); }

/* 本文の紙とインデックスタブ */
.hs-Binder {
  max-width: 1040px;
  margin: 0 auto 48px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  align-items: start;
}
.hs-Sheet {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 40px 48px 56px 72px;
  min-width: 0;
}
/* バインダーの穴 */
.hs-Sheet::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 48px;
  width: 16px;
  height: 208px;
  background: radial-gradient(circle, var(--board) 0 6px, var(--line) 6.5px 7.5px, transparent 8px) 0 0 / 16px 96px repeat-y;
}

.hs-Rail { padding-top: 40px; }
.hs-Rail_Label { margin: 0 0 8px 12px; font-size: .75rem; color: var(--ink-sub); letter-spacing: .1em; }
.hs-Rail_List { list-style: none; margin: 0; padding: 0; }
.hs-Rail_List li { margin-bottom: 6px; }
.hs-Rail_Tab {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-left: 10px;
  padding: 10px 12px;
  background: var(--tab);
  color: #fff;
  border-radius: 0 6px 6px 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: .9rem;
  line-height: 1.4;
  text-decoration: none;
}
.hs-Rail_Tab:hover { text-decoration: underline; }
.hs-Rail_Tab[aria-current="page"] {
  margin-left: -1px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-left: 6px solid var(--tab);
  padding-left: 14px;
}
.hs-Rail_No { font-size: .75rem; opacity: .85; }
.hs-Rail_Sub { display: block; margin: 20px 0 0 12px; font-size: .85rem; }
.hs-Rail_Sub[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: none; }

/* TOP */
.hs-Intro { margin-bottom: 40px; }
.hs-Intro_Title { margin: 0; font-family: var(--head); font-weight: 700; line-height: 1.45; }
.hs-Intro_Main { display: block; font-size: 1.75rem; }
.hs-Intro_Sub { display: block; font-size: 1.05rem; color: var(--ink-sub); margin-top: 4px; }
.hs-Intro_Catch { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-weight: 700; color: var(--cover); }

.hs-Index_Heading {
  margin: 0 0 16px;
  font-family: var(--head);
  font-size: 1rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--cover);
}
.hs-Index { list-style: none; margin: 0; padding: 0; }
.hs-Index_Card {
  display: grid;
  grid-template-columns: 40px 240px minmax(0, 1fr);
  border: 1px solid var(--line);
  margin-bottom: 20px;
  background: var(--paper);
}
.hs-Index_Tab {
  margin: 0;
  writing-mode: vertical-rl;
  background: var(--tab);
  color: #fff;
  font-family: var(--head);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .12em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 0;
  border-radius: 6px 0 0 6px;
  margin-left: -1px;
}
.hs-Index_Media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.hs-Index_Text { padding: 14px 20px 16px; }
.hs-Index_Date { margin: 0; font-size: .8rem; color: var(--ink-sub); }
.hs-Index_Title { margin: 4px 0 8px; font-family: var(--head); font-size: 1.08rem; line-height: 1.5; }
.hs-Index_Title a { color: var(--ink); text-decoration: none; }
.hs-Index_Title a:hover { text-decoration: underline; }
.hs-Index_Excerpt {
  margin: 0;
  font-size: .88rem;
  color: var(--ink-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hs-Index_More { margin: 8px 0 0; font-size: .85rem; }

/* 記事 */
.hs-Crumbs ol { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; font-size: .8rem; color: var(--ink-sub); }
.hs-Crumbs li + li::before { content: "→"; margin: 0 .5em; color: var(--ink-sub); }

.hs-Article_Meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 8px; font-size: .85rem; color: var(--ink-sub); }
.hs-Article_Tab {
  background: var(--tab);
  color: #fff;
  padding: 2px 12px 2px 10px;
  border-radius: 0 6px 6px 0;
  font-family: var(--head);
  font-weight: 700;
}
.hs-Article_Title { margin: 0 0 24px; font-family: var(--head); font-size: 1.6rem; line-height: 1.5; }
.hs-Article_Eye { margin: 0 auto 48px; max-width: 600px; }
.hs-Article_Eye img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); }

.hs-Toc {
  position: relative;
  background: var(--pale);
  border: 1px solid var(--line);
  padding: 18px 20px 14px;
  margin: 0 0 40px;
  font-size: .9rem;
}
.hs-Toc_Label {
  position: absolute;
  top: 0;
  left: 16px;
  transform: translateY(-100%);
  margin: 0;
  background: var(--cover);
  color: #fff;
  padding: 3px 16px;
  border-radius: 6px 6px 0 0;
  font-family: var(--head);
  font-weight: 700;
  font-size: .85rem;
}
.hs-Toc_List { list-style: none; margin: 0; padding: 0; }
.hs-Toc_Item { margin: 0 0 4px; }
.hs-Toc_Item a { color: var(--ink); text-decoration: none; display: flex; gap: .6em; }
.hs-Toc_Item a:hover { color: var(--link); text-decoration: underline; }
.hs-Toc_Item-h2 { font-weight: 700; margin-top: 6px; }
.hs-Toc_Item-h3 { padding-left: 2.2em; }
.hs-Toc_Num { flex: none; min-width: 1.6em; color: var(--tab); font-weight: 700; }

.hs-Prose h2, .hs-Prose h3 { font-family: var(--head); font-weight: 700; line-height: 1.5; scroll-margin-top: 16px; }
.hs-Prose h2 {
  display: flex;
  align-items: flex-start;
  gap: .6em;
  font-size: 1.3rem;
  margin: 2.4em 0 .9em;
  padding-bottom: .45em;
  border-bottom: 1px solid var(--cover);
}
.hs-Prose h2:first-child { margin-top: 0; }
.hs-Prose h2 .hs-Prose_Num {
  flex: none;
  min-width: 1.7em;
  height: 1.7em;
  margin-top: .05em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tab);
  color: #fff;
  font-size: .85em;
}
.hs-Prose h3 { display: flex; gap: .6em; font-size: 1.08rem; margin: 1.8em 0 .6em; }
.hs-Prose h3 .hs-Prose_Num { flex: none; color: var(--tab); }
.hs-Prose p { margin: 0 0 1.2em; }

.hs-Related { margin-top: 56px; }
.hs-Related_Heading { margin: 0 0 8px; font-family: var(--head); font-size: 1.1rem; padding-bottom: 6px; border-bottom: 1px solid var(--cover); }
.hs-Related_List { list-style: none; margin: 0; padding: 0; }
.hs-Related_Item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.hs-Related_Tab {
  background: var(--tab);
  color: #fff;
  padding: 1px 10px 1px 8px;
  border-radius: 0 6px 6px 0;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.hs-Related_Title { font-family: var(--head); font-weight: 700; line-height: 1.5; }
.hs-Related_Excerpt {
  grid-column: 2;
  margin: 0;
  font-size: .85rem;
  color: var(--ink-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-History {
  display: grid;
  grid-template-columns: 4em 1fr;
  margin: 40px 0 0;
  border-top: 1px solid var(--cover);
  font-size: .85rem;
}
.hs-History dt, .hs-History dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hs-History dt { color: var(--ink-sub); }

.hs-Missing_Code { margin: 0 0 8px; font-size: .8rem; color: var(--ink-sub); letter-spacing: .15em; }

/* フッター */
.hs-Foot { background: var(--cover); color: var(--board); }
.hs-Foot_Inner { max-width: 1040px; margin: 0 auto; padding: 32px 16px 24px; }
.hs-Foot_Name { margin: 0 0 8px; font-family: var(--head); font-weight: 700; }
.hs-Foot_Note { margin: 0 0 16px; font-size: .82rem; max-width: 720px; }
.hs-Foot_Links { list-style: none; margin: 0 0 20px; padding: 0; display: flex; gap: 20px; font-size: .88rem; }
.hs-Foot a { color: #fff; }
.hs-Foot_Edition { margin: 0; padding-top: 12px; border-top: 1px solid rgba(239, 234, 225, .3); font-size: .75rem; opacity: .85; }

/* 狭い画面 */
@media (max-width: 879px) {
  .hs-Binder { grid-template-columns: minmax(0, 1fr); }
  .hs-Sheet { padding: 28px 24px 40px; }
  .hs-Sheet::before { display: none; }
  .hs-Rail { padding-top: 24px; }
  .hs-Rail_Label { margin-left: 0; }
  .hs-Rail_List { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .hs-Rail_List li { margin: 0; }
  .hs-Rail_Tab, .hs-Rail_Tab[aria-current="page"] { margin-left: 0; border-radius: 0 0 6px 6px; height: 100%; }
  .hs-Rail_Tab[aria-current="page"] { border: 1px solid var(--line); border-top: 4px solid var(--tab); padding-left: 12px; }
  .hs-Rail_Sub { margin-left: 0; }
}
@media (max-width: 640px) {
  .hs-Head_Inner { padding: 16px; }
  .hs-Head_Name { font-size: 1.1rem; }
  .hs-Sheet { padding: 24px 16px 32px; }
  .hs-Intro_Main { font-size: 1.4rem; }
  .hs-Index_Card { grid-template-columns: 32px minmax(0, 1fr); }
  .hs-Index_Tab { grid-row: span 2; }
  .hs-Index_Text { padding: 12px 14px 14px; }
  .hs-Article_Title { font-size: 1.35rem; }
  .hs-Prose h2 { font-size: 1.15rem; }
  .hs-Related_Item { grid-template-columns: minmax(0, 1fr); }
  .hs-Related_Tab { justify-self: start; }
  .hs-Related_Excerpt { grid-column: 1; }
}
