/* 漫画「みんシス物語」（/history/） */
main:has(.hs-page) { margin-bottom: 0; }

.hs-page {
  --hs-yellow: #fed93f;
  --hs-ink: #231815;
  --hs-text: #2b3540;
  --hs-paper: #ffffff;
  --hs-desk: #f4f1ea;
  --hs-line: 3px;
  --hs-gutter: clamp(6px, 1.4vw, 12px);
  --hs-sheet-w: min(760px, calc(100% - 24px));
  --hs-font-bubble: clamp(10px, 2.1vw, 16px);
  color: var(--hs-text);
  background: var(--hs-desk);
  font-family: "Noto Sans JP", sans-serif;
  padding-bottom: 96px;
  overflow: clip;
}
.hs-page *, .hs-page *::before, .hs-page *::after { box-sizing: border-box; }
.hs-page h1, .hs-page h2, .hs-page p, .hs-page figure { margin: 0; }

/* ---------- 導入 ---------- */
.hs-intro {
  width: var(--hs-sheet-w);
  margin-inline: auto;
  padding: 56px 0 40px;
  text-align: center;
}
.hs-intro__en {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2em;
  color: #b8860b;
}
.hs-intro__title {
  margin-top: 8px !important;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 900;
  color: var(--hs-ink);
}
.hs-intro__lead {
  margin-top: 16px !important;
  font-size: 15px;
  line-height: 1.9;
}

/* ---------- 1枚の紙（共通） ---------- */
.hs-book { display: grid; gap: 40px; }
.hs-sheet {
  position: relative;
  width: var(--hs-sheet-w);
  margin-inline: auto;
  background: var(--hs-paper);
  box-shadow: 0 2px 0 rgba(0,0,0,.04), 0 12px 32px rgba(35,24,21,.10);
  overflow: hidden;
}

/* ---------- 表紙 ---------- */
.hs-cover { aspect-ratio: 3 / 4; }
.hs-cover__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hs-cover__title {
  position: absolute;
  left: 6%; bottom: 13%;
  display: grid;
  gap: .2em;
  color: var(--hs-ink);
}
.hs-cover__dots { display: flex; gap: .35em; font-size: clamp(10px, 2.2vw, 18px); }
.hs-cover__dots i {
  width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid var(--hs-ink);
}
.hs-cover__dots i:nth-child(1) { background: #fed93f; }
.hs-cover__dots i:nth-child(2) { background: #ee88a6; }
.hs-cover__dots i:nth-child(3) { background: #e94c66; }
.hs-cover__dots i:nth-child(4) { background: #20aee5; }
.hs-cover__dots i:nth-child(5) { background: #8dc556; }
.hs-cover__dots i:nth-child(6) { background: #b78ebf; }
.hs-cover__en {
  margin-top: .4em;
  font-size: clamp(12px, 2.4vw, 20px);
  font-weight: 900;
  letter-spacing: .12em;
  font-style: italic;
}
.hs-cover__jp {
  font-size: clamp(40px, 9.5vw, 80px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: .02em;
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--hs-yellow);
}
.hs-cover__logo {
  position: absolute;
  left: 6%; bottom: 4.5%;
  width: 34%; height: auto;
}

/* ---------- 扉 ---------- */
.hs-chapter { aspect-ratio: 3 / 4; container-type: inline-size; }
.hs-chapter__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hs-chapter__title {
  position: absolute;
  left: 0; right: 0; bottom: 8%;
  display: grid;
  justify-items: center;
  gap: .3em;
  color: var(--hs-ink);
  text-align: center;
}
.hs-chapter__no {
  padding: .15em .9em;
  background: var(--hs-ink);
  color: #fff;
  font-size: clamp(14px, 2.8vw, 22px);
  font-weight: 900;
  letter-spacing: .2em;
}
.hs-chapter__name {
  /* タイトルは1行に収める（扉の幅に合わせて縮む） */
  font-size: 5.4cqi !important; /* common.css のSP用 span 14px !important を上書き */
  white-space: nowrap;
  font-weight: 900;
  -webkit-text-stroke: 6px #fff;
  paint-order: stroke fill;
}

/* ---------- 本編（コマ割り） ---------- */
.hs-comic {
  display: grid;
  gap: var(--hs-gutter);
  padding: clamp(14px, 4vw, 36px) clamp(12px, 3.6vw, 32px) clamp(30px, 6vw, 48px);
}
/* 日本の漫画は右→左に読む */
.hs-row {
  display: flex;
  flex-direction: row-reverse;
  gap: var(--hs-gutter);
}
.hs-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border: var(--hs-line) solid var(--hs-ink);
  background: #fff;
  overflow: hidden;
}
.hs-panel img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hs-panel--text {
  display: grid;
  place-items: center;
  background: var(--hs-ink);
  color: #fff;
}
.hs-panel--text p {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: calc(var(--hs-font-bubble) * 1.15);
  font-weight: 700;
  line-height: 2;
  letter-spacing: .12em;
}
.hs-comic__no {
  position: absolute;
  left: 50%; bottom: clamp(8px, 2vw, 16px);
  transform: translateX(-50%);
  font-size: 12px;
  color: #6b7681;
}

/* ---------- 吹き出し（縦書き） ---------- */
/* 右上から読む順（右→左）に並べる */
.hs-bubbles {
  position: absolute;
  top: 4%; right: 3%;
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: .7em;
  font-size: var(--hs-font-bubble);
}
.hs-bubble {
  position: relative;
  writing-mode: vertical-rl;
  white-space: pre-line;
  font-size: var(--hs-font-bubble);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: .04em;
  color: var(--hs-ink);
  text-orientation: upright;
  inline-size: max-content; /* 改行はデータ側の \n だけで行う */
}
.hs-bubble--speech,
.hs-bubble--thought {
  padding: 1em .7em;
  background: #fff;
  border: 2px solid var(--hs-ink);
  border-radius: 50% / 22%;
}
.hs-bubble--thought {
  border-style: dashed;
  border-radius: 46% / 26%;
}
.hs-bubble--narration {
  padding: .7em .45em;
  background: #fff;
  border: 2px solid var(--hs-ink);
  font-weight: 500;
}
.hs-bubble--shout {
  /* 叫び・決めゼリフ：枠なしの太字に白フチ（形で切り抜くと文字が欠けるため） */
  padding: 0;
  font-size: calc(var(--hs-font-bubble) * 1.6);
  font-weight: 900;
  line-height: 1.35;
  -webkit-text-stroke: .28em #fff;
  paint-order: stroke fill;
}
/* しっぽ */
.hs-bubble[class*="--tail-"]::after {
  content: "";
  position: absolute;
  width: .9em; height: .9em;
  background: #fff;
  border: 2px solid var(--hs-ink);
  border-top: 0; border-left: 0;
}
.hs-bubble--placed { position: absolute; }
.hs-bubble--tail-bottom::after { left: 50%; bottom: -.5em; transform: translateX(-50%) rotate(45deg); }
.hs-bubble--tail-left::after   { left: -.5em; top: 60%; transform: rotate(135deg); }
.hs-bubble--tail-right::after  { right: -.5em; top: 60%; transform: rotate(-45deg); }

/* ---------- つづく ---------- */
.hs-next {
  width: var(--hs-sheet-w);
  margin: 16px auto 0;
  padding: 40px 24px;
  text-align: center;
  background: var(--hs-paper);
  border-top: 6px solid var(--hs-yellow);
}
.hs-next__tsuzuku {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 900;
  color: var(--hs-ink);
  letter-spacing: .3em;
}
.hs-next__label { margin-top: 20px !important; font-size: 14px; font-weight: 700; color: #b8860b; }
.hs-next__title { margin-top: 4px !important; font-size: clamp(18px, 3vw, 24px); font-weight: 900; color: var(--hs-ink); }
.hs-next__text  { margin-top: 10px !important; font-size: clamp(17px, 2.2vw, 24px) !important; font-weight: 700; line-height: 1.8; color: var(--hs-ink); }
.hs-next__link {
  display: inline-block;
  margin-top: 28px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--hs-ink);
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.hs-next__link:hover { opacity: .85; }
.hs-next__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.hs-next__buttons .hs-next__link { margin-top: 0; background: #fff; color: var(--hs-ink) !important; border: 2px solid var(--hs-ink); }
.hs-next__buttons .hs-next__link--primary { background: var(--hs-yellow); border-color: var(--hs-yellow); }
.hs-chapter__sub {
  font-size: clamp(13px, 2.6vw, 20px);
  font-weight: 700;
  -webkit-text-stroke: 4px #fff;
  paint-order: stroke fill;
}

@media (max-width: 599px) {
  .hs-page { --hs-line: 2px; padding-bottom: 64px; }
  .hs-book { gap: 24px; }
  .hs-bubble--speech, .hs-bubble--thought, .hs-bubble--narration { border-width: 1.5px; }
  /* スマホは横並びのコマを縦に積み、コマを高めにしてセリフが収まるようにする */
  .hs-row { flex-direction: column; }
  .hs-panel { flex: none; aspect-ratio: 4 / 3 !important; }
  .hs-panel--text { aspect-ratio: auto !important; min-height: 160px; padding: 20px 0; }
}
