/* Nextcloud News: modern, calm, light + dark (follows the system). No external fonts or requests. */
:root {
  --bg: #f6f8fb; --surface: #ffffff; --surface-2: #eef2f7; --text: #16202c; --muted: #5d6b7c; --line: #e1e7ef;
  --accent: #0082c9; --accent-ink: #ffffff; --accent-soft: #e3f2fb;
  --shadow: 0 1px 2px rgba(16,32,52,.06), 0 8px 24px -12px rgba(16,32,52,.12);
  --radius: 16px;
  --c-security: #c0392b; --c-release: #0082c9; --c-gov: #6a4fc4; --c-biz: #0f8a6a;
  --c-edu: #b7791f; --c-ai: #c2418d; --c-community: #3a7d1e; --c-other: #5d6b7c;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1119; --surface: #121b27; --surface-2: #1a2635; --text: #e8eef6; --muted: #93a3b8; --line: #243245;
    --accent: #4cb4ec; --accent-ink: #06202f; --accent-soft: #123248;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
    --c-security: #ff8a7a; --c-release: #5ec0f5; --c-gov: #b6a2ff; --c-biz: #4fd1a8;
    --c-edu: #f0b955; --c-ai: #f58ac6; --c-community: #8fd36a; --c-other: #93a3b8;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.container { max-width: var(--w, 1120px); margin: 0 auto; padding: 0 20px; }
main.container { padding-bottom: 24px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.logo svg { width: 22px; height: 22px; }
.spacer { flex: 1; }
.toplinks { display: flex; gap: 6px; align-items: center; }
.toplinks a { text-decoration: none; font-size: .92rem; font-weight: 500; color: var(--muted); padding: 8px 12px; border-radius: 999px; }
.toplinks a:hover { background: var(--surface-2); color: var(--text); }
.toplinks a.rss { background: var(--accent-soft); color: var(--accent); }

/* hero */
.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 14px; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: var(--muted); font-size: 1.1rem; max-width: 56ch; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; }
.pill b { color: var(--text); font-weight: 600; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #2fb344; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,179,68,.5); } 70% { box-shadow: 0 0 0 8px rgba(47,179,68,0); } 100% { box-shadow: 0 0 0 0 rgba(47,179,68,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } html { scroll-behavior: auto; } }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 20px 0 22px; }
.search { flex: 1 1 260px; min-width: 0; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; }
.search::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); padding: 7px 14px; border-radius: 999px; text-transform: capitalize; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); padding-bottom: 24px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.card[hidden] { display: none; }
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h2 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.01em; margin: 0; overflow-wrap: anywhere; }
.card h2 a { text-decoration: none; }
.card h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card .dek { margin: 0; color: var(--muted); font-size: .95rem; }
.card .foot { margin-top: auto; padding-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .82rem; color: var(--muted); }
.card .foot .also { color: var(--accent); }
.card .foot a { position: relative; z-index: 1; margin-left: auto; color: var(--accent); text-decoration: none; font-weight: 500; }
.card .foot a:hover { text-decoration: underline; }
.card.lead { grid-column: 1 / -1; padding: 30px; }
.card.lead h2 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -.02em; }
.card.lead .dek { font-size: 1.05rem; max-width: 70ch; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .82rem; color: var(--muted); }
.tag { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--tag, var(--c-other)); background: color-mix(in srgb, var(--tag, var(--c-other)) 13%, transparent); padding: 3px 10px; border-radius: 999px; }
.c-security { --tag: var(--c-security); } .c-release { --tag: var(--c-release); } .c-gov { --tag: var(--c-gov); }
.c-biz { --tag: var(--c-biz); } .c-edu { --tag: var(--c-edu); } .c-ai { --tag: var(--c-ai); }
.c-community { --tag: var(--c-community); } .c-other { --tag: var(--c-other); }
.empty { text-align: center; color: var(--muted); padding: 48px 0; font-weight: 600; }

/* search results (compact list) */
.results { list-style: none; margin: 0 0 24px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results[hidden] { display: none; }
.results li { display: block; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.results li:last-child { border-bottom: 0; }
.results a { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.results a:hover { color: var(--accent); }
.results .meta { margin-top: 2px; }

/* pager + buttons */
.pager { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; padding: 8px 0 32px; color: var(--muted); }
.btn { display: inline-block; text-decoration: none; font-weight: 600; font-size: .95rem; background: var(--accent); color: var(--accent-ink); padding: 10px 20px; border-radius: 999px; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }

/* article page */
.article { max-width: 720px; margin: 0 auto; padding: 40px 0 24px; }
.article h1 { font-size: clamp(1.8rem, 4.5vw, 2.7rem); line-height: 1.15; letter-spacing: -.025em; margin: 14px 0 14px; overflow-wrap: anywhere; }
.article .dek { font-size: 1.2rem; color: var(--muted); margin: 0 0 24px; }
.article .body p { font-size: 1.08rem; margin: 0 0 1.1em; }
.source-box { margin-top: 32px; padding: 20px 22px; border-radius: var(--radius); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); font-size: .95rem; }
.source-box a.go { display: inline-block; margin-top: 6px; font-weight: 600; color: var(--accent); }
.source-box .also-list { margin: 12px 0 0; }
.source-box .also-list a { color: var(--accent); }
.source-box small { display: block; margin-top: 12px; color: var(--muted); }
.back { display: inline-block; margin-top: 28px; color: var(--muted); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--accent); }
.plain { padding-left: 1.1rem; }

.sitefoot { border-top: 1px solid var(--line); margin-top: 24px; padding: 28px 0 48px; color: var(--muted); font-size: .88rem; }
.sitefoot p { margin: 0 0 6px; max-width: 80ch; }

@media (max-width: 560px) {
  .topbar .container { height: 58px; }
  .toplinks a:not(.rss) { display: none; }
  .hero { padding-top: 36px; }
  .grid { grid-template-columns: 1fr; }
}
 