/* ── News page ───────────────────────────────────────────────────────── */

/* Public filter bar */
.pub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.pub-filter-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 6px;
  padding: 6px 14px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pub-filter-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

.pub-filter-btn.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.3);
  color: var(--fg);
}

.pub-filter-btn__count {
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 1px 7px;
}

.pub-filter-btn .tag { pointer-events: none; }

/* News list wrapper */
.news-list {
  display: grid;
  gap: 20px;
}

/* Featured card — newest post */
.news-card--featured {
  border-color: rgba(56,189,248,0.22);
  background: rgba(17, 28, 49, 0.95);
}

.news-card--featured .news-card__title {
  font-size: 1.5rem;
}

.tag--latest {
  background: rgba(56,189,248,0.18);
  color: var(--accent);
}

/* No-results message */
.news-empty {
  color: var(--muted);
}

.news-no-results {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 40px 0;
  text-align: center;
}

.news-no-results__clear {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.news-grid {
  display: grid;
  gap: 20px;
}

.news-card {
  background: rgba(17, 28, 49, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 10px;
  padding: 24px 28px;
  scroll-margin-top: 72px;
  transition: border-color 0.18s;
}

.news-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.news-card__meta {
  align-items: center;
  display: flex;
  gap: 10px;
}

.news-card__date {
  color: var(--muted);
  font-size: 0.82rem;
}

.news-card__title {
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.news-card__excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.news-card__body {
  border-top: 1px solid var(--line);
  color: #cbd5e1;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-top: 6px;
  padding-top: 16px;
}

.news-card__body p { margin: 0 0 10px; }
.news-card__body ul { margin: 0 0 10px; padding-left: 20px; }

/* Public patch details: enough story to be useful, still tidy enough for release notes. */
.news-card__body .planned-patch-list,
.news-card__body .patch-content-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.planned-patch-list {
  display: grid;
  gap: 22px;
}

.planned-patch {
  border-left: 3px solid rgba(251, 191, 36, 0.7);
  padding-left: 18px;
}

.planned-patch__heading,
.patch-content-item__heading,
.planned-patch__content-heading {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
}

.planned-patch__title {
  color: #fff7ed;
  font-size: 1.08rem;
}

.planned-patch__status,
.planned-patch__content-heading span,
.planned-patch__empty {
  color: var(--muted);
  font-size: 0.78rem;
}

.planned-patch__description {
  color: #cbd5e1;
  margin: 7px 0 14px !important;
}

.planned-patch__content-heading {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  margin-top: 14px;
  padding-top: 13px;
}

.planned-patch__content-heading h3 {
  color: #fde68a;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.patch-content-list {
  display: grid;
  gap: 0;
  margin-top: 7px !important;
}

.patch-content-item {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding: 12px 0;
}

.patch-content-item:first-child { border-top: 0; }

.patch-content-item__heading > strong {
  color: #f8fafc;
  font-size: 0.93rem;
}

.patch-content-item__tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.patch-content-item__tags span {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  color: #bae6fd;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
}

.patch-content-item p {
  color: #b9c7d8;
  line-height: 1.55;
  margin: 6px 0 3px !important;
}

.patch-content-item small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .planned-patch { padding-left: 13px; }
  .planned-patch__heading,
  .patch-content-item__heading,
  .planned-patch__content-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* ── News admin — filter bar ─────────────────────────────────────────── */
.news-list-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.news-filter-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.news-filter-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

.news-filter-btn.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.3);
  color: var(--fg);
}

.news-filter-btn .tag {
  pointer-events: none;
}

.news-filter-count {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.td--title {
  font-weight: 600;
  max-width: 320px;
}

.td--empty {
  color: var(--muted);
  padding: 32px !important;
  text-align: center;
}

/* ── News admin — edit + preview layout ──────────────────────────────── */
.news-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: 28px;
  align-items: start;
}

.news-edit-pane { }

/* Mobile tab strip — hidden on wide screens */
.news-edit-tabs {
  display: none;
  gap: 4px;
  margin-bottom: 18px;
}

.news-edit-tab {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  flex: 1;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 9px 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.news-edit-tab.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.28);
  color: var(--fg);
}

/* Preview pane */
.news-preview-pane {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.news-preview-header__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.news-preview-header__title span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-preview-header__title small {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.7;
}

/* Viewport toggle buttons */
.news-preview-viewports {
  display: flex;
  gap: 4px;
}

.news-vp-btn {
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  height: 30px;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  width: 34px;
}

.news-vp-btn:hover {
  border-color: rgba(255,255,255,0.25);
  color: var(--fg);
}

.news-vp-btn.is-active {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.28);
  color: var(--fg);
}

/* Preview wrap — switches between full-width and phone-width */
.news-preview-wrap {
  transition: max-width 0.25s ease;
}

.news-preview-wrap.is-mobile {
  max-width: 375px;
  margin: 0 auto;
}

.news-preview-card {
  /* inherits .news-card styles — no extra style needed */
}

/* Field row: two inputs side by side */
.admin-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Responsive: collapse to tabs on small screens ──────────── */
@media (max-width: 920px) {
  .news-edit-layout {
    grid-template-columns: 1fr;
  }

  .news-edit-tabs {
    display: flex;
  }

  .news-preview-pane {
    position: static;
    max-height: none;
  }
}
