:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --text: #24231f;
  --muted: #68655c;
  --line: #dedbd2;
  --link: #1f5f5b;
  --accent: #1f5f5b;
  --band: #1f5f5b;
  --on-band: #ffffff;
  --tint: #e8f1ef;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1b19;
    --text: #e9e7e0;
    --muted: #a7a498;
    --line: #3a3934;
    --link: #7fc4bd;
    --accent: #7fc4bd;
    --band: #173f3c;
    --on-band: #f2f7f6;
    --tint: #24302e;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  /* Windows の游ゴシックは標準の太さだと細く見えるので Medium を先に指定する */
  font-family: "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.9;
  overflow-wrap: break-word;
}

/* Medium の字体に太字がないので、太字は標準の游ゴシックで出す */
strong,
.article-list li::before {
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-weight: 700;
}

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

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

.site-header,
main,
.site-footer {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

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

.header-band { background: var(--band); }

.site-name {
  color: var(--on-band);
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.site-header nav a {
  margin-left: 1.25rem;
  color: var(--on-band);
  text-decoration: none;
}

.header-band a:focus-visible { outline-color: var(--on-band); }

.site-header nav a:first-child { margin-left: 0; }
.site-header nav a:hover { text-decoration: underline; }

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.hero {
  margin-bottom: 2.75rem;
  padding: 1.5rem;
  background: var(--tint);
  border-radius: 0.5rem;
}

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

h1,
h2,
h3 {
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-weight: 700;
  /* 長い見出しの末尾に1文字だけ残らないようにする */
  text-wrap: balance;
  word-break: auto-phrase;
}

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

h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.25rem;
  line-height: 1.6;
}

main h2 {
  padding-left: 0.75rem;
  border-left: 4px solid var(--accent);
}

h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
}

p,
li,
.article-description {
  /* 段落の末尾に「す。」だけが残らないようにする */
  text-wrap: pretty;
}

p { margin: 0 0 1.1rem; }

ul,
ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

li { margin-bottom: 0.35rem; }
li::marker { color: var(--muted); }

table {
  width: 100%;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.7;
}

th,
td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th { background: var(--tint); }

.meta,
.site-footer {
  color: var(--muted);
  font-size: 0.875rem;
}

.meta { margin-bottom: 2rem; }

.article-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: article;
}

.article-list li {
  position: relative;
  margin: 0;
  padding: 1rem 0 1rem 2.5rem;
  border-top: 1px solid var(--line);
  counter-increment: article;
}

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

.article-list li::before {
  content: counter(article);
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--band);
  border-radius: 50%;
  color: var(--on-band);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.75rem;
  text-align: center;
}

.article-title {
  display: block;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  font-weight: 700;
}

.article-description {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.article-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--tint);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
}

/* 前の記事がない1本目でも、次の記事を右に寄せる */
.article-nav-next { margin-left: auto; }

.article-nav-list {
  flex-basis: 100%;
  text-align: center;
}

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--line);
}

.site-footer p { margin: 0; }

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  h1 { font-size: 1.5rem; }
  main { padding-top: 1.5rem; }
  .article-list li { padding-left: 2.4rem; }
}
