/* Numpty News page styles. Inherits :root variables from /styles.css. */

:root {
  --news-cat-industry: #a64b29;
  --news-cat-deep-read: #2c5d8f;
  --news-cat-creator: #2f7a4f;
}

:root[data-theme="dark"], :root:not([data-theme="light"]) {
  /* Slightly brighter in dark mode for legibility */
}

.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.news-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.news-tabs {
  display: flex;
  gap: 0.4rem;
}

.chip {
  background: var(--card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.chip.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.chip .faint {
  opacity: 0.6;
}

#news-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 2rem;
}

.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  display: flex;
  gap: 0.75rem;
  position: relative;
  transition: opacity 0.18s;
}

.news-card.is-read {
  opacity: 0.45;
}

.news-thumb {
  flex-shrink: 0;
  width: 88px;
  height: 66px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
}

.news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.news-meta {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.news-cat {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.news-cat-industry { color: var(--news-cat-industry); }
.news-cat-deep_read { color: var(--news-cat-deep-read); }
.news-cat-creator { color: var(--news-cat-creator); }

.news-source-line {
  font-size: 0.7rem;
  color: var(--text-faint);
}

.news-title {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  text-decoration: none;
  display: block;
}

.news-title:hover {
  text-decoration: underline;
}

.news-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 0.1rem;
}

.news-bookmark {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-faint);
  cursor: pointer;
  align-self: flex-start;
  padding: 0;
  width: 28px;
  height: 28px;
}

.news-bookmark.is-saved {
  color: var(--text);
}

.news-empty-title {
  font-weight: 300;
  font-size: 1.3rem;
  margin: 2rem 0 1rem;
}

.empty-add {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0 0.5rem;
}

.empty-add input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.empty-add button {
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.small {
  font-size: 0.75rem;
}

.link {
  background: none;
  border: none;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* ===== /news/sources ===== */
.sources-page h1 { font-weight: 300; margin-bottom: 0.2rem; }
.sources-header { padding: 1rem 0 0.5rem; }
.sources-subheader { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.2rem; }

.add-source-box {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  margin-bottom: 1rem;
}

.add-source-row {
  display: flex;
  gap: 0.5rem;
}

.add-source-row input {
  flex: 1;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.add-source-row button {
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.discovery-result {
  margin-top: 0.7rem;
  padding: 0.7rem;
  background: var(--bg);
  border-radius: 4px;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.discovery-result select {
  padding: 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
}

.discovery-result button {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.discovery-info { flex: 1; min-width: 0; }
.discovery-name { font-size: 0.9rem; color: var(--text); }
.discovery-url { font-size: 0.72rem; color: var(--text-faint); }

.sources-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.source-row:last-child { border-bottom: none; }
.source-row.is-paused { opacity: 0.55; background: var(--bg); }
.source-row .source-cat { flex-shrink: 0; width: 70px; }
.source-row .source-info { flex: 1; min-width: 0; }
.source-row .source-name { font-size: 0.92rem; color: var(--text); }
.source-row .source-meta-line { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }
.source-row .source-meta-line.is-error { color: var(--news-cat-industry); }

.source-status {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.source-status.active { color: var(--news-cat-creator); background: rgba(47,122,79,0.15); }
.source-status.paused { color: var(--text-muted); background: var(--border); }
.source-status.stalled { color: var(--news-cat-industry); background: rgba(166,75,41,0.15); }

.source-actions { position: relative; }
.source-actions-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.3rem;
}

.source-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  z-index: 10;
  min-width: 180px;
  display: none;
}

.source-menu.open { display: block; }

.source-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.55rem 0.8rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.source-menu button:hover { background: var(--bg); }
.source-menu button.danger { color: var(--news-cat-industry); }

.menu-footer-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

/* ===== /news/article (reader view) ===== */
.article-frame {
  padding: 1rem 0 4rem;
}

.article-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.article-source-line {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.article-title {
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.article-byline {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text);
}

.article-body p { margin: 0.85rem 0; }
.article-body h2 { margin: 1.5rem 0 0.6rem; font-weight: 500; font-size: 1.25rem; }
.article-body h3 { margin: 1.2rem 0 0.5rem; font-weight: 500; font-size: 1.1rem; }
.article-body a { color: var(--news-cat-deep-read); }
.article-body img { max-width: 100%; height: auto; border-radius: 4px; margin: 1rem 0; }
.article-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}
.article-body pre, .article-body code {
  background: var(--card);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-size: 0.9em;
}
.article-body pre { padding: 0.7rem; overflow-x: auto; }

.article-actions {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.article-actions a, .article-actions button {
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

.article-actions .primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.article-fallback {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin: 2rem 0;
}

.article-fallback h2 { font-weight: 400; font-size: 1.1rem; margin-bottom: 0.5rem; }
.article-fallback p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }

/* ===== /news/sources/settings ===== */
.settings-page form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1rem 0;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.settings-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.settings-field .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-field input,
.settings-field select {
  padding: 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.split-row {
  display: flex;
  gap: 0.5rem;
}

.split-row input {
  flex: 1;
}

.settings-save {
  padding: 0.6rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  align-self: flex-start;
}

#settings-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}
