/* newswire — zero-JS, mobile-first, auto dark/light */

:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5f6368;
  --accent: #0a4d8f;
  --accent-fg: #ffffff;
  --card: #f6f7f9;
  --border: #e3e5e8;
  --chip-bg: #eef1f5;
  --chip-cat-bg: #d9e8f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --fg: #e8eaed;
    --muted: #a8adb3;
    --accent: #7cb7ff;
    --accent-fg: #0b0e12;
    --card: #1a1d22;
    --border: #2a2d33;
    --chip-bg: #23272d;
    --chip-cat-bg: #1e3550;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
  position: relative;
}

/* Logo lives in the left gutter outside the 960px container, right
   horizontally between the viewport edge and the container. Hidden on
   viewports too narrow to have a meaningful gutter. */
.site-logo {
  position: absolute;
  background: var(--card);
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: calc((100% - 960px) / 2);
  display: flex;
  justify-content: right;
  align-items: right;
  margin-right: 1rem;
}

/* Logo asset is square (700x700). Pinning to a fixed rem size avoids the
   percentage-height layout race that left it oversized until devtools
   forced a relayout. Sized to roughly the bar's natural content height. */
.site-logo img {
  width: 7rem;
  height: 7rem;
  display: block;
  background: var(--card);
}

@media (max-width: 1180px) {
  .site-logo {
    display: none;
  }
}

.site-header-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-top-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-brand {
  margin-top: 1rem;
  flex: 1 1 auto;
  min-width: 0;
}

.site-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 80%;
  color: var(--fg);
}

.site-title:hover {
  text-decoration: none;
}

.site-tagline {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  justify-content: center;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
}

.nav-list a {
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0.1rem;
}

.nav-list a:hover,
.nav-list a:focus {
  color: var(--accent);
  text-decoration: none;
}

.search-form {
  display: flex;
  gap: 0;
}

.search-form input[type="search"] {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font: inherit;
  min-width: 10rem;
}

.search-form input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-form button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.search-form button:hover {
  filter: brightness(1.08);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.static-page {
  max-width: 720px;
  margin: 1.5rem auto 0;
}

.static-page h1 {
  margin: 0 0 0.75rem;
  font-size: 1.8rem;
}

.static-page h2 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.2rem;
}

.static-page .lede {
  font-size: 1.1rem;
  color: var(--fg);
}

.static-page p {
  margin: 0 0 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.page-heading {
  margin: 1.5rem 0 1rem;
  font-size: 1.35rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Lists */
.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
}

.card-title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

.card-title a {
  color: var(--fg);
}

.card-meta {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-excerpt {
  margin: 0 0 0.65rem;
  color: var(--fg);
}

.chips {
  margin: 0;
}

.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  margin: 0.15rem 0.2rem 0.15rem 0;
  background: var(--chip-bg);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--fg);
}

.chip-cat {
  background: var(--chip-cat-bg);
}

.chip:hover {
  text-decoration: none;
  filter: brightness(1.07);
}

.pager {
  margin: 1.5rem 0;
  text-align: center;
}

.empty {
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}

/* Article detail */
.article {
  max-width: 720px;
  margin: 1.5rem auto 0;
}

.article-title {
  margin: 0 0 0.4rem;
  font-size: 1.9rem;
  line-height: 1.2;
}

.article-meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.65;
}

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  border-radius: 4px;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  color: var(--muted);
}

.article-body pre {
  background: var(--card);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.article-body code {
  background: var(--card);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.92em;
}

.article-body pre code {
  background: transparent;
  padding: 0;
}

.article-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

@media (max-width: 560px) {

  html,
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 0.75rem;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .site-title {
    font-size: 1.35rem;
  }

  .site-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav {
    justify-content: space-between;
  }

  .search-form {
    flex: 1 1 100%;
  }

  .search-form input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
  }
}