.news-page {
  --news-gap: 1.75rem;
}

.news-page .header {
  top: 0;
}

.news-main {
  max-width: min(92vw, 70rem);
  margin: 0 auto;
  padding: calc(var(--site-top-h, 0px) + 4.75rem) var(--pad-x) 4.5rem;
}

.news-masthead {
  display: grid;
  gap: var(--news-gap);
  margin-bottom: 2.75rem;
  padding: 1.75rem 1.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(212, 165, 116, 0.06) 0%, transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 820px) {
  .news-masthead {
    grid-template-columns: 1fr min(16rem, 34vw);
    align-items: end;
  }
}

.news-kicker {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.news-masthead h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: 0.75rem;
  line-height: 1.05;
}

.news-deck {
  color: var(--prose);
  max-width: 52ch;
  line-height: 1.6;
  font-size: 0.9375rem;
}

.weather--compact .weather-shell {
  min-height: 7.5rem;
}

.news-api-banner {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  color: var(--prose);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.news-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 960px) {
  .news-layout {
    grid-template-columns: 1fr min(20rem, 36vw);
    align-items: start;
  }

  .news-assistant {
    position: sticky;
    top: calc(var(--site-top-h, 2.75rem) + 3.5rem);
  }
}

.news-feed {
  padding: 1.35rem 1.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.news-feed__toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.news-feed h2 {
  font-size: 0.6875rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.news-tab {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.news-tab:hover {
  color: var(--text);
}

.news-tab.is-active {
  color: var(--text);
  border-color: rgba(212, 165, 116, 0.45);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px rgba(212, 165, 116, 0.12) inset;
}

.news-search {
  display: flex;
  gap: 0.5rem;
}

.news-search input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.news-search button {
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(212, 165, 116, 0.35);
  background: var(--accent-dim);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.news-search button:hover {
  border-color: rgba(212, 165, 116, 0.55);
  background: rgba(212, 165, 116, 0.22);
}

.news-feed__status {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.news-articles {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-article {
  padding: 1.35rem 0 1.35rem 0.85rem;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  margin-left: -0.35rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.news-article:hover {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.015);
}

.news-article__meta {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.news-article__title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 0.5rem;
}

.news-article__title a {
  color: var(--text);
  text-decoration: none;
}

.news-article__title a:hover {
  text-decoration: underline;
}

.news-article__deck {
  font-size: 0.8125rem;
  color: var(--prose);
  line-height: 1.55;
  margin-bottom: 0.65rem;
  max-width: 58ch;
}

.news-article__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.news-article__ask {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.news-article__ask:hover {
  color: var(--text);
}

.news-assistant__panel {
  position: relative;
  overflow: hidden;
  min-height: 22rem;
  padding: 0;
}

.news-assistant__under {
  padding: 1.25rem 1.35rem;
  filter: blur(2px) saturate(0.65);
  opacity: 0.38;
  pointer-events: none;
  user-select: none;
}

.ai-maintenance {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: rgba(7, 7, 8, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229, 72, 72, 0.25);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.ai-maintenance__icon {
  color: var(--danger);
  filter: drop-shadow(0 0 18px rgba(229, 72, 72, 0.45));
}

.ai-maintenance__icon svg {
  width: 4.25rem;
  height: 4.25rem;
  display: block;
}

.ai-maintenance__title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.ai-maintenance__sub {
  font-size: 0.8125rem;
  color: var(--prose);
  max-width: 26ch;
  line-height: 1.55;
}

.news-assistant h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.news-assistant__note {
  font-size: 0.8125rem;
  color: var(--prose);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.news-security {
  margin-bottom: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.news-security__title {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.news-security__list {
  font-size: 0.75rem;
  color: var(--prose);
  line-height: 1.5;
  padding-left: 1.1rem;
  margin-bottom: 0.5rem;
}

.news-security__meta {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--muted);
}

.news-ask label {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.news-ask textarea {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 5.5rem;
}

.news-ask__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.news-ask__submit {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: var(--radius);
  background: #ececec;
  color: #0a0a0a;
  cursor: pointer;
  font-weight: 500;
}

.news-ask__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.news-ask__topic {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--muted);
}

.news-result {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.news-result__label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.news-cred {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.news-cred[data-level="verified"] {
  border-color: rgba(120, 200, 140, 0.45);
  color: #9fd4a8;
}

.news-cred[data-level="mixed"] {
  border-color: rgba(200, 180, 100, 0.45);
  color: #d4c88a;
}

.news-cred[data-level="unverified"] {
  color: var(--muted);
}

.news-cred[data-level="likely_false"] {
  border-color: rgba(200, 100, 100, 0.45);
  color: #d49090;
}

.news-result__body {
  font-size: 0.875rem;
  color: var(--prose);
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
}

.news-result__rationale {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.news-sources {
  list-style: none;
  font-size: 0.75rem;
}

.news-sources li + li {
  margin-top: 0.35rem;
}

.news-sources a {
  color: var(--text);
}

.news-refusal {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: #d49090;
}

.news-other {
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.news-other__lead {
  font-size: 0.8125rem;
  color: var(--prose);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.news-other label {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.5rem 0 0.25rem;
}

.news-other input,
.news-other textarea {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.news-other__run {
  margin-top: 0.75rem;
  margin-right: 0.5rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.news-other__run--ai {
  background: #ececec;
  color: #0a0a0a;
  border-color: #ececec;
}

.news-subhead {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 1.25rem 0 0.35rem;
}

.news-badge {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
}

.news-ai-search__hint,
.news-auto__note {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.news-ai-search label,
.news-automations label {
  display: block;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0.35rem 0 0.25rem;
}

.news-ai-search input,
.news-automations input,
.news-automations select {
  width: 100%;
  font: inherit;
  font-size: 0.875rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.news-ai-search__btn,
.news-auto__save,
.news-auto__refresh {
  margin-top: 0.5rem;
  margin-right: 0.35rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.news-ai-hits,
.news-auto-list {
  list-style: none;
  margin-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--prose);
}

.news-ai-hits li + li,
.news-auto-list li + li {
  margin-top: 0.35rem;
}

.news-auto-item {
  padding: 0.65rem 0;
  border-top: 1px solid var(--border);
}

.news-auto-item__meta {
  font-family: var(--mono);
  font-size: 0.625rem;
  color: var(--muted);
}

.news-auto-item__del {
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
}

.news-automations {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Full-page rain / snow (synced with Peterborough weather) */
.ambient-weather {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-weather__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

body.news-page main {
  position: relative;
  z-index: 1;
}

.ambient-weather--storm::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
  animation: ambient-flash 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes ambient-flash {
  0%,
  92%,
  100% {
    opacity: 0;
  }
  93% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-weather--storm::after {
    animation: none;
  }
}
