/* Newspaper amber (user choice C, 2026-11-06; B-006 note 9, B-020 item 3), on top of pico.classless.amber.min.css (Pico CSS 2.1.1, MIT).
   Phone first: the page is opened inside LINE. Serif body text, sans-serif for controls and small print. Notes: docs/theme-notes.md */
:root {
  --news-serif: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --news-sans: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
  --pico-font-family: var(--news-serif);
  --pico-border-radius: 2px;
  --pico-line-height: 1.7;
}
/* Colors: Pico defines its light variables under :root:not([data-theme=dark]) (higher specificity than plain :root), so the same selector is used here. */
:root:not([data-theme="dark"]) {
  --pico-background-color: #fbf7ee;
  --pico-color: #2b2418;
  --pico-muted-color: #5f5545;
  --news-rule: #cdbf9f;
  --news-ok: #1b5e20;
  --news-err: #b00020;
  --news-notice-bg: #fff1d6;
  --news-link: #7a4b00;
  --news-danger: #9b1c1c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pico-background-color: #1c1810;
    --pico-color: #eadfc8;
    --pico-muted-color: #b9ab8e;
    --news-rule: #4a4130;
    --news-ok: #8fd19a;
    --news-err: #ff8a9b;
    --news-notice-bg: #3a2f14;
    --news-link: #ffcf5a;
    --news-danger: #c62828;
  }
}

/* Links: set explicitly so both themes keep enough contrast (checked in docs/theme-notes.md). */
a { color: var(--news-link); }
a:hover, a:active { color: var(--pico-color); }

body { position: relative; }
body > main { padding-block: 56px 8px; }
body > footer { padding-block: 8px 32px; font-family: var(--news-sans); font-size: 0.9rem; }
body > footer a { margin-right: 12px; }

/* Masthead: "每日新聞" between a double rule. */
main > h1, main > [data-l] > h1 {
  text-align: center;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  font-size: 1.6rem;
  margin: 0 0 16px;
  padding: 8px 0;
  border-top: 4px double var(--news-rule);
  border-bottom: 4px double var(--news-rule);
}
#status { margin-bottom: 12px; }
#actions { margin-bottom: 8px; }
#report, #settings { margin-top: 24px; }
/* Phone-sized headings (Pico's defaults are for wide screens). */
h2 { font-size: 1.35rem; margin: 0 0 8px; }
h3 { font-size: 1.1rem; margin: 20px 0 4px; }
/* Empty status lines stay in the page (they are live regions) but take no room. */
.note:empty, .err:empty { min-height: 0 !important; height: 0; margin: 0 !important; padding: 0; }

/* Controls and small print stay sans-serif. */
button, input, textarea, .tag, .hint, .note, .err, #msg { font-family: var(--news-sans); }
button { font-size: 1rem; width: auto; margin: 4px 8px 4px 0; padding: 10px 16px; }
#msg { color: var(--news-err); }
.notice { background: var(--news-notice-bg); padding: 8px 12px; border-left: 4px solid var(--pico-primary); }

#report ol { padding-left: 1.2rem; }
#report li { margin-bottom: 0.8rem; }
#report .why { color: var(--pico-muted-color); }

#settings h3 { margin-bottom: 4px; }
#settings ul { list-style: none; padding: 0; margin: 0 0 8px; }
#settings li { display: flex; align-items: center; gap: 8px; padding: 4px 0; margin: 0; border-bottom: 1px solid var(--news-rule); }
#settings .url { flex: 1; overflow-wrap: anywhere; font-size: 0.9rem; font-family: var(--news-sans); }
#settings .tag { font-size: 0.8rem; color: var(--pico-muted-color); white-space: nowrap; border: 1px solid var(--news-rule); padding: 0 6px; }
#settings input[type=url], #settings textarea { width: 100%; box-sizing: border-box; font: inherit; font-family: var(--news-sans); padding: 8px; margin-bottom: 4px; }
#settings textarea { min-height: 8rem; }
#settings .hint { color: var(--pico-muted-color); font-size: 0.9rem; margin: 4px 0; }
#settings .note { color: var(--news-ok); min-height: 1.4em; margin: 0; }
#settings .err { color: var(--news-err); min-height: 1.4em; margin: 0; }
#settings li button { margin: 0; padding: 4px 10px; font-size: 0.9rem; }

/* Language switch (2026-11-19): a round, quiet button in the top right. "A" while the page is Chinese, "文" while it is English
   (set by i18n.js). Long static text exists twice, data-l="zh" and data-l="en"; the one that does not match <html lang> is hidden. */
#lang-toggle {
  position: absolute; top: 10px; right: 12px; z-index: 10;
  width: 40px; height: 40px; min-width: 40px; margin: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--news-rule); background: transparent;
  color: inherit; font-family: var(--news-sans); font-size: 1.15rem; line-height: 1; cursor: pointer;
}
#lang-toggle:hover, #lang-toggle:focus-visible { background: var(--news-notice-bg); color: inherit; border-color: var(--pico-primary); }
html:not([lang="en"]) [data-l="en"], html[lang="en"] [data-l="zh"] { display: none; }
/* English headings: the wide letter spacing of the Chinese masthead looks wrong on Latin letters. */
html[lang="en"] main > h1, html[lang="en"] main > [data-l] > h1 { letter-spacing: 0.06em; text-indent: 0.06em; }

/* Note under the masthead (language and reports) and the leave section at the very bottom (2026-11-19).
   The red is a muted brick red that sits with the amber paper theme: white text on it is 8.2:1 (light) and 5.6:1 (dark). */
.lang-note { font-family: var(--news-sans); font-size: 0.85rem; color: var(--pico-muted-color); margin: -4px 0 12px; }
#leave { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--news-rule); }
#leave p { font-family: var(--news-sans); font-size: 0.9rem; color: var(--pico-muted-color); }
button.danger { background: var(--news-danger); border-color: var(--news-danger); color: #fff; }
button.danger:hover, button.danger:focus-visible { background: var(--news-danger); border-color: var(--pico-color); color: #fff; filter: brightness(1.12); }
