/*
 * ニコリスの公開サイト（nicoris.app）の共通スタイル。
 * 外部の読み込み（Web フォント・CDN）はしない。フォントは端末の標準のもの。
 * 配色はゲームの和紙・墨・朱・藍（lib/washi-ink.ts）に寄せている。
 */

:root {
  color-scheme: light dark;
  --bg: #f3ead7;
  --paper: #fbf7ee;
  --paper-edge: #dccba7;
  --ink: #211913;
  --muted: #66553f;
  --shu: #b8352a;
  --print: #3d6a80;
  --rule: #d9c8a6;
  --link: #8e2f24;
  --link-hover: #c4382a;
  --shadow: rgba(60, 40, 20, 0.12);
  --serif:
    'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'Yu Mincho', 'YuMincho',
    'Noto Serif JP', 'Noto Serif CJK JP', 'BIZ UDPMincho', serif;
  --sans:
    'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'YuGothic',
    'Noto Sans JP', 'Noto Sans CJK JP', 'BIZ UDPGothic', Meiryo, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1815;
    --paper: #25201b;
    --paper-edge: #3d342a;
    --ink: #ece3d0;
    --muted: #bcae95;
    --shu: #e3705b;
    --print: #93bccf;
    --rule: #463b2f;
    --link: #f0a08e;
    --link-hover: #ffc2b2;
    --shadow: rgba(0, 0, 0, 0.35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background-color: var(--bg);
  /* 和紙の繊維のような、ごく淡いむら（画像は使わない） */
  background-image:
    radial-gradient(
      ellipse at 20% 0%,
      rgba(255, 255, 255, 0.35),
      transparent 55%
    ),
    radial-gradient(
      ellipse at 90% 100%,
      rgba(140, 100, 50, 0.06),
      transparent 60%
    );
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
  line-break: strict;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      radial-gradient(
        ellipse at 20% 0%,
        rgba(255, 240, 210, 0.05),
        transparent 55%
      ),
      radial-gradient(
        ellipse at 90% 100%,
        rgba(196, 56, 42, 0.05),
        transparent 60%
      );
  }
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover,
a:focus-visible {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px solid var(--shu);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

.wrap {
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- ヘッダ ---- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.25rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.6rem;
  box-shadow: 0 1px 3px var(--shadow);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  text-decoration: none;
}

.site-nav a[aria-current='page'] {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--shu);
}

/* ---- 本文 ---- */

main {
  flex: 1 0 auto;
  padding: 2rem 0 3rem;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
}

h1::after {
  content: '';
  display: block;
  width: 3rem;
  height: 4px;
  margin-top: 0.6rem;
  border-radius: 2px;
  background: var(--shu);
}

h2 {
  position: relative;
  margin: 2.5rem 0 0.9rem;
  padding-left: 0.85rem;
  font-size: 1.3rem;
}

h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 4px;
  border-radius: 2px;
  background: var(--print);
}

h3 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.1rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4em;
}

li + li {
  margin-top: 0.3rem;
}

strong {
  font-weight: 700;
}

.lead {
  font-size: 1.05rem;
}

.note {
  color: var(--muted);
  font-size: 0.92rem;
}

/* 保存する情報の一覧 */
.items {
  margin: 0 0 1rem;
}

.items > div {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--shu);
  border-radius: 6px;
  background: var(--paper);
}

.items dt {
  font-family: var(--serif);
  font-weight: 700;
}

.items dd {
  margin: 0.2rem 0 0;
}

.items dd + dd {
  margin-top: 0.15rem;
}

.label {
  display: inline-block;
  min-width: 2.6em;
  margin-right: 0.4em;
  color: var(--muted);
  font-size: 0.85rem;
}

/* よくある質問 */
.qa {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 2px 4px var(--shadow);
}

.qa h3 {
  display: flex;
  gap: 0.6rem;
  margin: 0 0 0.6rem;
}

.qa h3::before {
  content: '問';
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  margin-top: 0.05rem;
  border-radius: 4px;
  background: var(--shu);
  color: #fbf7ee;
  font-size: 0.95rem;
  line-height: 1;
}

.qa > div {
  padding-left: 2.3rem;
}

.qa > div > :last-child {
  margin-bottom: 0;
}

/* 問い合わせ先 */
.contact {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  background: var(--paper);
}

.contact p {
  margin: 0 0 0.35rem;
}

.contact p:last-child {
  margin-bottom: 0;
}

.mail {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
}

.contact .mail-line .label {
  display: block;
  margin: 0;
}

.dates {
  margin-top: 2.5rem;
  color: var(--muted);
  text-align: right;
}

/* ---- フッタ ---- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .wrap {
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 26rem) {
  body {
    line-height: 1.8;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .qa > div {
    padding-left: 0;
  }
}
