/* Newsroom front page: navy masthead, red section rubrics, white story columns on a cool grey page. */
:root {
  --navy: #0B2545;
  --navy-deep: #071A33;
  --navy-line: #24426B;
  --navy-muted: #A9BCD6;
  --red: #C8102E;
  --page: #F2F4F7;
  --surface: #FFFFFF;
  --ink: #111A26;
  --muted: #55606F;
  --line: #E2E6EC;
  --rule: #111A26;
  --link: #0B5CAD;
  --link-hover: #073F78;
  --sep: #9AA6B4;
  --input-border: #8A97A8;
  --chip-border: #B9C3D0;
  --ph: #DDE3EA;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.7 var(--sans); }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 6px 12px; z-index: 10; }
.skip:focus { left: 16px; }
:focus-visible { outline: 3px solid #4FA3E0; outline-offset: 2px; }

/* Top bar: date left, visitor count top-right */
.topbar { background: var(--navy-deep); color: var(--navy-muted); font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.visitors { white-space: nowrap; }
.visitors strong { margin-left: 6px; color: #fff; font: 500 15px var(--mono); }

/* Masthead */
.masthead { background: var(--navy); color: #fff; text-align: center; padding: 26px 0 22px; border-bottom: 4px solid var(--red); }
.eyebrow { margin: 0; font: 12px/1.6 var(--mono); letter-spacing: .22em; color: var(--navy-muted); }
.masthead h1 { margin: 6px 0 4px; font: 900 clamp(26px, 4.4vw, 46px)/1.25 var(--serif); letter-spacing: .02em; word-break: keep-all; overflow-wrap: anywhere; }
.masthead h1 a { color: inherit; text-decoration: none; }
.masthead h1 span { color: #7FE3E8; }
.tagline { margin: 0; font-size: 14px; color: var(--navy-muted); }

/* Section nav */
.sections { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 rgba(17, 26, 38, .04); }
.section-nav { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.section-nav button {
  min-height: 46px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none;
  font: 500 15px var(--sans); color: var(--ink); white-space: nowrap; cursor: pointer;
}
.section-nav button:hover { color: var(--red); }
.section-nav button[aria-pressed="true"] { color: var(--red); border-bottom-color: var(--red); font-weight: 700; }

/* Rubric (section heading) */
.rubric { margin: 0 0 14px; padding-top: 10px; border-top: 3px solid var(--rule); font: 700 20px/1.4 var(--serif); display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rubric-note { font: 400 14px var(--sans); color: var(--muted); }
.kicker { display: inline-block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--red); letter-spacing: .04em; }

/* Front page */
.front { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 28px; }
.lead { flex: 999 1 560px; min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.lead-figure { margin: 0; position: relative; }
.lead-figure button { all: unset; display: block; width: 100%; cursor: zoom-in; }
.lead-figure img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--ph); }
.lead-figure figcaption { padding: 6px 20px 0; font-size: 12px; color: var(--muted); }
.lead-body { padding: 14px 20px 22px; }
.lead h2 { margin: 0; font: 700 clamp(22px, 2.6vw, 30px)/1.4 var(--serif); }
.lead h2 a { color: var(--ink); text-decoration: none; }
.lead h2 a:hover { color: var(--link); text-decoration: underline; }
.lead .news-meta { margin-top: 8px; }
.latest { flex: 1 1 300px; min-width: 0; }
.latest-list { list-style: none; margin: 0; padding: 0; counter-reset: latest; }
.latest-list li { counter-increment: latest; display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.latest-list li::before { content: counter(latest); flex: 0 0 22px; font: 700 22px/1.2 var(--serif); color: var(--red); }
.latest-list a { color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.55; }
.latest-list a:hover { color: var(--link); text-decoration: underline; }
.latest-list .news-meta { margin: 2px 0 0; font-size: 13px; }

/* Photo strip */
.gallery { margin-top: 36px; }
.gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.gallery-grid button { all: unset; cursor: zoom-in; display: block; width: 100%; }
.gallery-grid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--ph); }
.gallery-grid .g-title { display: block; margin-top: 6px; font-size: 14px; font-weight: 700; line-height: 1.45; }
.gallery-grid .g-credit { display: block; font-size: 12px; color: var(--muted); }
.gallery-grid button:focus-visible { outline: 3px solid #4FA3E0; outline-offset: 2px; }

/* News list */
#news { margin-top: 40px; }
.news-head .rubric { margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
input, button { font: inherit; }
.search {
  flex: 1 1 280px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--input-border); color: var(--muted);
}
.search:focus-within { outline: 3px solid #4FA3E0; outline-offset: 1px; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { min-height: 44px; padding: 0 14px; cursor: pointer; font-size: 14px; font-weight: 500; background: var(--surface); color: var(--ink); border: 1px solid var(--chip-border); }
.chip:hover { border-color: var(--navy); }
.chip .n { margin-left: 6px; font-family: var(--mono); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"] .n { color: var(--navy-muted); }
.clear { min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--link); font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.group { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); padding: 4px 22px 6px; }
.group h3 { margin: 0; padding: 14px 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--red); font: 700 17px/1.4 var(--serif); }
.group h3 .n { font: 400 13px var(--mono); color: var(--muted); white-space: nowrap; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { display: flex; gap: 16px; padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.news-item:last-child { border-bottom: 0; }
.news-item .num { flex: 0 0 26px; padding-top: 2px; font: 500 14px/1.7 var(--mono); color: var(--muted); }
.news-body { flex: 1; min-width: 0; }
.news-item h4 { margin: 0; font: 700 18px/1.55 var(--serif); }
.news-meta { margin: 4px 0 6px; font-size: 14px; color: var(--muted); }
.news-meta .sep { margin: 0 8px; color: var(--sep); }
.news-url { font: 13px/1.6 var(--mono); overflow-wrap: anywhere; }
.news-url:visited { color: #5B3A9E; }
.thumb { all: unset; flex: 0 0 150px; cursor: zoom-in; align-self: flex-start; }
.thumb img { display: block; width: 150px; height: 100px; object-fit: cover; background: var(--ph); }
.empty { margin: 24px 0; padding: 40px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--sep); background: var(--surface); }

/* Lightbox */
.lightbox { width: min(1100px, 100vw); max-width: 100vw; max-height: 100dvh; padding: 0; border: 0; background: transparent; overflow: visible; }
.lightbox::backdrop { background: rgba(6, 18, 34, .92); }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.lightbox img { display: block; max-width: 100%; max-height: calc(100dvh - 170px); width: auto; height: auto; background: #1b2a3d; }
.lightbox figcaption { color: #EEF2F7; text-align: center; padding: 10px 16px 0; max-width: 760px; }
.lb-date { color: var(--navy-muted); margin-left: .6em; font-size: 14px; }
.lightbox figcaption p { margin: 4px 0 0; font-size: 15px; }
.lightbox .lb-credit { font-size: 13px; color: var(--navy-muted); }
.lb-close, .lb-nav { position: fixed; background: rgba(0, 0, 0, .45); border: 0; color: #fff; font-size: 30px; line-height: 1; width: 48px; height: 48px; padding: 0; border-radius: 50%; cursor: pointer; }
.lb-close:hover, .lb-nav:hover { background: rgba(0, 0, 0, .7); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; translate: 0 -50%; }
.lb-next { right: 12px; top: 50%; translate: 0 -50%; }
.lb-nav[hidden] { display: none; }

.site-footer { margin-top: 56px; background: var(--navy-deep); color: var(--navy-muted); padding: 28px 0 40px; font-size: 13px; }
.site-footer p { margin: 0 0 6px; max-width: 820px; }
.footer-title { color: #fff; font: 700 16px var(--serif); }

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .masthead { padding: 20px 0 16px; }
  .front { margin-top: 18px; gap: 22px; }
  .lead-body { padding: 12px 16px 18px; }
  .lead-figure figcaption { padding: 6px 16px 0; }
  .group { padding: 2px 14px 4px; margin-top: 18px; }
  .news-item { gap: 10px; }
  .news-item h4 { font-size: 17px; }
  .thumb { flex-basis: 92px; }
  .thumb img { width: 92px; height: 69px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lb-nav { top: auto; bottom: 14px; translate: none; }
}
