/* あさひこブログ 新着（reader）。紙と墨と緑1色。書体は端末の標準。 */
:root {
  color-scheme: light dark;
  --surface: #f2f4ef;
  --surface-2: #e8ece5;
  --ink: #1c2621;
  --muted: #55625a;
  --rule: #c5cdc2;
  --accent: #2c5b43;
  --on-accent: #ffffff;
  --focus: #1d4ed8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #131815;
    --surface-2: #1b221d;
    --ink: #e3e9e2;
    --muted: #a3afa6;
    --rule: #2e3a32;
    --accent: #8ec6a6;
    --on-accent: #0d120f;
    --focus: #8cb4ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--surface);
  color: var(--ink);
}
body {
  margin: 0 auto;
  max-width: 40rem;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
           max(2.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", "Meiryo", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

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

/* ヘッダー */
.top { padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); }
.top h1 { font-size: 1.25rem; line-height: 1.5; font-weight: 700; }
.top-line {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  column-gap: 1rem; font-size: 0.875rem; line-height: 1.5; color: var(--muted);
}
.link {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-size: 0.9375rem; white-space: nowrap;
}

/* お知らせ・状態 */
.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem;
  margin: 0.75rem 0 0; padding: 0.5rem 0.75rem;
  font-size: 0.875rem; line-height: 1.6;
  background: var(--surface-2); border-left: 3px solid var(--accent);
}
.notice[hidden] { display: none; }
.state { padding: 1.5rem 0; color: var(--muted); }
.state .link { margin-left: 0.25rem; }
.state-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-top: 0.75rem; }

.btn {
  font: inherit; font-size: 0.9375rem; line-height: 1.4;
  min-height: 2.75rem; padding: 0.5rem 1rem; cursor: pointer;
  color: var(--accent); background: transparent;
  border: 1px solid var(--accent); border-radius: 0.375rem;
}
.btn:hover { background: var(--surface-2); }

/* 見出し */
.section-title {
  margin: 1.5rem 0 0.25rem; font-size: 0.875rem; line-height: 1.5;
  font-weight: 600; letter-spacing: 0.05em; color: var(--muted);
}

/* 最新の日の記事 */
.article { padding: 1rem 0 1.25rem; border-bottom: 1px solid var(--rule); }
.article:last-child { border-bottom: 0; }
.title { font-size: 1.3125rem; line-height: 1.5; font-weight: 700; }
.meta {
  margin-top: 0.25rem; font-size: 0.875rem; line-height: 1.6; color: var(--muted);
}
.text { margin-top: 1rem; white-space: pre-wrap; text-wrap: pretty; }
.photos { margin-top: 0.5rem; }
.photos a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.25rem 0;
  font-weight: 600;
}

/* 新着の印 */
.new {
  display: inline-block; margin-right: 0.5rem; padding: 0 0.5rem;
  font-size: 0.75rem; line-height: 1.5; font-weight: 700; vertical-align: 0.1em;
  color: var(--on-accent); background: var(--accent); border-radius: 0.25rem;
}

/* それより前の記事 */
.day {
  margin: 1.25rem 0 0.25rem; font-size: 0.875rem; line-height: 1.5; font-weight: 600;
  color: var(--muted);
}
details { border-bottom: 1px solid var(--rule); }
summary {
  position: relative; display: block; min-height: 2.75rem; padding: 0.5rem 2rem 0.5rem 0;
  font-weight: 600; line-height: 1.6; cursor: pointer; list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: ""; position: absolute; right: 0.5rem; top: 1.1rem;
  width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}
details[open] > summary::after { top: 1.4rem; transform: rotate(-135deg); }
.detail { padding: 0 0 1rem; }
.detail .text { margin-top: 0.5rem; }

@media (min-width: 40rem) {
  body { padding-top: 2rem; }
  .title { font-size: 1.5rem; }
}
