/* 美郷町議会 一般質問サイト
   色：江の川の深い緑青を基調に、議場の名札（白木）を差し色として使う */

:root {
  --paper: #f5f7f5;
  --surface: #ffffff;
  --ink: #1d2b2a;
  --muted: #586866;
  --line: #d6ddd9;
  --river: #24615c;
  --river-ink: #f3f7f6;
  --river-soft: #e3eeec;
  --accent: #24615c;
  --plate: #efe6d2;
  --plate-edge: #d8c9a6;
  --plate-ink: #22201b;
  --draft: #f6e7a8;

  --mincho: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif;
  --gothic: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
            "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;

  --pad: clamp(18px, 5vw, 28px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16201f;
    --surface: #1d2928;
    --ink: #e5ecea;
    --muted: #9fb0ad;
    --line: #2f3d3b;
    --river: #1d4f4b;
    --river-ink: #eaf3f1;
    --river-soft: #22403d;
    --accent: #86c6bd;
    --plate: #2b2721;
    --plate-edge: #4a4134;
    --plate-ink: #f1e9d8;
    --draft: #5a4f1f;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 56px);
}

body {
  margin: 0 auto;
  max-width: 640px;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  line-height: 1.75;
  font-feature-settings: "palt" 0;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 下書き表示 ---------- */
.draft {
  margin: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) var(--pad) 8px;
  background: var(--draft);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

/* ---------- 見出し部 ---------- */
.masthead {
  padding: calc(env(safe-area-inset-top, 0px) + 22px) var(--pad) 22px;
  background: var(--river);
  color: var(--river-ink);
}
.draft + .masthead { padding-top: 22px; }

.council {
  display: inline-block;
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0.85;
}
a.council:hover { text-decoration: underline; }

.masthead h1 {
  margin: 10px 0 6px;
  font-family: var(--mincho);
  font-weight: 700;
  line-height: 1.3;
}
.mh-title { display: block; font-size: 1.05rem; font-weight: 600; }
.mh-sub {
  display: block;
  margin-top: 2px;
  font-size: clamp(2.3rem, 11vw, 3rem);
  letter-spacing: 0.08em;
}
.page-top .mh-title { font-size: clamp(2.3rem, 11vw, 3rem); letter-spacing: 0.08em; }

.mh-facts { margin: 0; font-size: 0.95rem; }

.daynav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.daynav a {
  padding: 6px 14px;
  border: 1px solid color-mix(in srgb, var(--river-ink) 55%, transparent);
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
}
.daynav a:active { background: color-mix(in srgb, var(--river-ink) 15%, transparent); }

/* ---------- 一覧：日ごと ---------- */
.day-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--pad) 10px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font-family: var(--mincho);
  font-size: 1.25rem;
  font-weight: 700;
}
.day-start {
  margin-left: 12px;
  font-family: var(--gothic);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}

.rows { list-style: none; }
.row + .row { border-top: 1px solid var(--line); }

.row-link {
  display: grid;
  grid-template-columns: 2rem 64px 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px var(--pad);
  text-decoration: none;
}
.row-link:active { background: var(--river-soft); }
@media (hover: hover) { .row-link:hover { background: var(--river-soft); } }

.row-order {
  font-family: var(--mincho);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  text-align: center;
  padding-top: 4px;
}

.row-photo {
  width: 64px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--plate);
}
.row-photo--empty, .hero-photo--empty {
  display: grid;
  place-items: center;
  font-family: var(--mincho);
  color: var(--plate-ink);
  border: 1px solid var(--plate-edge);
}
.row-photo--empty { font-size: 1.6rem; }

.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.row-name {
  font-family: var(--mincho);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.35;
}
.row-time { flex-shrink: 0; font-size: 0.9rem; color: var(--muted); }
.row-meta { display: block; font-size: 0.8rem; color: var(--muted); }

.row-topics {
  list-style: none;
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}
.row-topics li {
  position: relative;
  padding-left: 0.9em;
}
.row-topics li + li { margin-top: 4px; }
.row-topics li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68em;
  width: 0.35em;
  height: 0.35em;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- 質問者ページ ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) var(--pad) 10px;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.back {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  padding: 4px 0;
}
.back::before { content: "‹ "; font-size: 1.2em; }
.pos { color: var(--muted); }

.q-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 22px var(--pad) 0;
}
.q-photo { min-width: 0; }
.hero-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  background: var(--plate);
}
.hero-photo--empty { font-size: 4.5rem; }

/* 議場の名札。このサイトでいちばん目立たせる要素 */
.plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: clamp(72px, 21vw, 96px);
  padding: 18px 0 14px;
  background: var(--plate);
  border: 1px solid var(--plate-edge);
  border-radius: 3px;
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--plate) 70%, var(--plate-edge));
  color: var(--plate-ink);
  font-family: var(--mincho);
  font-weight: 700;
}
.plate-name {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: clamp(1.6rem, 7.6vw, 2.2rem);
  letter-spacing: 0.22em;
  line-height: 1;
}
.plate-title {
  writing-mode: vertical-rl;
  font-size: clamp(0.95rem, 4vw, 1.15rem);
  letter-spacing: 0.3em;
}

.q-id { grid-column: 1 / -1; }
.q-order {
  margin: 4px 0 0;
  font-family: var(--mincho);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}
.q-name {
  margin: 0;
  font-family: var(--mincho);
  font-size: clamp(1.8rem, 8vw, 2.2rem);
  font-weight: 700;
  line-height: 1.3;
}
.q-kana {
  display: block;
  font-family: var(--gothic);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.q-facts {
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
}
.q-facts div {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.q-facts dt { color: var(--muted); }
.q-facts dd { margin: 0; }

.items { padding: 8px var(--pad) 0; }

.item {
  margin-top: 22px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 4px 10px 10px 4px;
}
.item-no {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}
.item-title {
  margin: 2px 0 0;
  font-family: var(--mincho);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.45;
}
.item-ans {
  display: inline-block;
  margin: 10px 0 0;
  padding: 2px 10px;
  background: var(--river-soft);
  border-radius: 4px;
  font-size: 0.8rem;
}
.item-text { margin: 12px 0 0; }

.item-points {
  list-style: none;
  counter-reset: pt;
  margin-top: 12px;
}
.item-points > li {
  counter-increment: pt;
  position: relative;
  padding: 10px 0 10px 2.2em;
  border-top: 1px dashed var(--line);
}
.item-points > li:first-child { border-top: 0; }
.item-points > li::before {
  content: counter(pt);
  position: absolute;
  left: 0;
  top: 11px;
  display: grid;
  place-items: center;
  width: 1.55em;
  height: 1.55em;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.pdf { margin: 20px 0 0; font-size: 0.95rem; }

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 28px var(--pad) 0;
}
.pager a {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}
.pager a:active { background: var(--river-soft); }
.pager-next { text-align: right; }
.pager-label { font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.pager-name { font-family: var(--mincho); font-weight: 700; }

.session-name {
  margin: 20px var(--pad) 0;
  font-size: 0.9rem;
  text-align: center;
}
.session-name a { color: var(--accent); }

/* ---------- トップ ---------- */
.toplist { list-style: none; padding: 8px 0; }
.toplist li + li { border-top: 1px solid var(--line); }
.toplist a {
  display: block;
  padding: 18px var(--pad);
  text-decoration: none;
}
.toplist a:active { background: var(--river-soft); }
.ts-title {
  display: block;
  font-family: var(--mincho);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}
.ts-meta { font-size: 0.9rem; color: var(--muted); }
.toplist .empty { padding: 24px var(--pad); color: var(--muted); }

/* ---------- フッター ---------- */
.site-foot {
  margin-top: 40px;
  padding: 22px var(--pad) calc(env(safe-area-inset-bottom, 0px) + 28px);
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
.site-foot p { margin: 0; }
.site-foot .publisher { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

@media (min-width: 641px) {
  body { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---------- 追加：注記・前置き・要旨の入れ子 ---------- */
.session-note {
  margin: 0;
  padding: 10px var(--pad);
  background: var(--river-soft);
  font-size: 0.85rem;
}

.intro {
  margin-top: 22px;
  padding: 4px 0 0;
}
.intro-title {
  margin: 0;
  font-family: var(--mincho);
  font-size: 1.2rem;
  font-weight: 700;
}

.item-text + .item-text { margin-top: 0.6em; }
.item-text { text-indent: 1em; }
.item-closing { text-indent: 0; margin-top: 14px; color: var(--muted); }

.pt-title { margin: 0; font-weight: 700; line-height: 1.6; }
.pt-text { margin: 6px 0 0; text-indent: 1em; }
.pt-title + .pt-text { margin-top: 6px; }

.pt-sub {
  list-style: none;
  counter-reset: sub;
  margin-top: 8px;
}
.pt-sub li {
  counter-increment: sub;
  position: relative;
  padding: 3px 0 3px 1.8em;
}
.pt-sub li::before {
  content: counter(sub);
  position: absolute;
  left: 0.15em;
  top: 0.55em;
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: var(--river-soft);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

/* ---------- 町章 ---------- */
.council { display: inline-flex; align-items: center; gap: 8px; }
.emblem {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
}
.emblem img { width: 22px; height: 22px; }
.publisher { display: flex; align-items: center; gap: 8px; }
.site-foot .emblem { box-shadow: 0 0 0 1px var(--line); }

/* ---------- 議会中継（YouTube） ---------- */
.live-wrap { padding: 14px var(--pad) 0; }
.live {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}
.live:active { background: var(--river-soft); }
@media (hover: hover) { .live:hover { border-color: var(--accent); } }
.live-icon { width: 34px; height: 24px; flex-shrink: 0; }
.live-text { flex: 1; line-height: 1.4; }
.live-ext {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}
.live-ext::after { content: " ↗"; }
.live--inline { margin-top: 16px; }
.live-wrap + .session-note { margin-top: 14px; }
