/* 東港小鎮公告 — a small-town paper: a serif nameplate over a double rule, notices filed under the month with the day large in the
   margin. Newsprint by day, ink-dark by night; no cards, only rules. One harbour red marks what is new; sea blue is the link and
   focus colour (shared with 東港鎮停水查詢); amber marks an edited title. */
:root {
  --paper: #f4f1ea; --tint: #ebe6da; --ink: #18212a; --ink-2: #3a4650; --muted: #5c6770; --rule: #d6cfc1;
  --sea: #0d6e8f; --red: #b3261e; --amber: #8a5a00; --warn-tint: #f8ead0;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101417; --tint: #182025; --ink: #ece7dd; --ink-2: #cdc7bb; --muted: #9c9a92; --rule: #2b3338;
    --sea: #74c3dd; --red: #ff8a7a; --amber: #f0c463; --warn-tint: #2a2416;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule) var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.75 var(--sans); letter-spacing: 0.02em; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--sea) 24%, transparent); color: var(--ink); }
main { max-width: 44rem; margin: 0 auto; padding: 2rem 1.15rem 3.5rem; }
a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--sea); outline-offset: 3px; border-radius: 0.3rem; }

/* masthead: nameplate, the date between hairlines, the sections */
.masthead { text-align: center; border-top: 5px double var(--ink); padding-top: 1.1rem; }
.masthead h1 { margin: 0; font: 900 clamp(2.3rem, 11vw, 3.9rem)/1.15 var(--serif); letter-spacing: 0.1em; }
.masthead h1 a { text-decoration: none; }
.dateline { display: flex; justify-content: space-between; gap: 1rem; margin: 0.9rem 0 0; padding: 0.35rem 0.1rem;
  border-block: 1px solid var(--ink); color: var(--ink-2); white-space: nowrap; font-size: 0.82rem; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; }
.tabs { display: flex; justify-content: center; gap: 1.6rem; padding: 0.7rem 0 0; }
.tabs a { padding: 0.15rem 0.1rem; color: var(--muted); font-size: 0.95rem; letter-spacing: 0.12em; text-decoration: none; border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); font-weight: 700; border-bottom-color: var(--sea); }

.warn { margin: 1.4rem 0 0; padding: 0.7rem 1rem; border-radius: 0.6rem; background: var(--warn-tint); color: var(--amber); font-size: 0.92rem; }
.digest { margin: 1.4rem 0 0; padding: 0.65rem 1rem; border-radius: 0.6rem; background: var(--tint); color: var(--ink-2); font-size: 0.92rem; }
.nw { white-space: nowrap; }
.digest strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.empty { margin: 2.5rem 0; color: var(--muted); text-align: center; }

/* a month: serif head with a rule running to the margin */
.month { margin-top: 2.4rem; }
.month h2 { display: flex; align-items: center; gap: 0.9rem; margin: 0 0 0.3rem; font: 700 1.3rem/1.4 var(--serif); letter-spacing: 0.08em; }
.month h2::after { content: ''; flex: 1; border-top: 1px solid var(--ink); }
.notes { list-style: none; margin: 0; padding: 0; }
.note { display: grid; grid-template-columns: 3.4rem 1fr; gap: 0 0.9rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.note:last-child { border-bottom: 0; }
.day { display: grid; justify-items: center; align-content: start; padding-top: 0.15rem; color: var(--ink-2); }
.day b { font-size: 1.85rem; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.day span { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.1em; }
.fresh .day b { color: var(--red); }
.body { min-width: 0; }
.src { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.8rem; margin: 0 0 0.15rem; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.06em; }
.title { display: block; color: var(--ink); font-size: 1.06rem; font-weight: 500; line-height: 1.65; text-decoration: none; text-wrap: pretty; }
.title:hover { text-decoration: underline; text-decoration-color: var(--sea); }
.title:visited { color: var(--ink-2); }

/* change marks: a drawn dot and the word (colour is never the only signal) */
.tag { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; }
.tag::before { content: ''; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.tag.new { color: var(--red); }
.tag.edit { color: var(--amber); }
.tag.gone { color: var(--muted); }
.removed .title { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.removed .day { opacity: 0.6; }

details { margin-top: 0.4rem; font-size: 0.85rem; }
details summary { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ''; width: 0.4rem; height: 0.4rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
details[open] summary::before { transform: translateY(-0.12rem) rotate(45deg); }
details summary:hover { color: var(--ink); }
.old { margin: 0.3rem 0 0; color: var(--ink-2); }
.at { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.8rem; }

/* the one moment: a new notice's dot rings twice when the page opens */
@media (prefers-reduced-motion: no-preference) {
  .tag.new::before { animation: ring 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s 2; }
  @keyframes ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } to { box-shadow: 0 0 0 0.55rem transparent; } }
}

footer { margin-top: 3rem; padding-top: 1rem; border-top: 5px double var(--ink); color: var(--muted); font-size: 0.82rem; line-height: 1.8; text-align: center; }
footer p { margin: 0; }

@media (max-width: 380px) {
  .note { grid-template-columns: 2.8rem 1fr; gap: 0 0.7rem; }
  .day b { font-size: 1.55rem; }
}

/* privacy page: the nameplate small, the text at reading measure */
.masthead.small { padding-top: 0.8rem; }
.nameplate { margin: 0; font: 900 1.5rem/1.3 var(--serif); letter-spacing: 0.1em; }
.nameplate a { text-decoration: none; }
.doc article { max-width: 34rem; margin: 2.2rem auto 0; }
.doc h1 { margin: 0; font: 700 1.9rem/1.35 var(--serif); letter-spacing: 0.06em; }
.doc-date { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.doc h2 { margin: 2.2rem 0 0.4rem; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.06em; }
.doc article p { margin: 0; color: var(--ink-2); line-height: 1.9; }
