/* News feature styles. Tokens (--navy, --surface, --r, --s-*) come from css/app.css.
   Mobile-first: one column of cards, thumbnail on top; side-by-side from 520px. */

/* ------------------------------------------------------------------ header */

.news-head {
  align-items: center;
  gap: var(--s-2);
}

.news-head-actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin-left: auto;
}

.news-source {
  font-size: .875rem;
  white-space: nowrap;
}

.news-refresh {
  width: 36px;
  height: 36px;
  font-size: 18px;
  color: var(--ink-2);
  flex: none;
}
.news-refresh[disabled] { opacity: .5; }
.news-refresh.spinning { animation: news-spin .9s linear infinite; }

@keyframes news-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .news-refresh.spinning { animation: none; opacity: .55; }
}

/* ------------------------------------------------------------------- list */

.news-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.news-card:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.news-card:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 55%, transparent); }

.news-card-main {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.news-card-main:focus-visible { outline: none; }

/* ---------------------------------------------------------------- thumbnail */

.news-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

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

.news-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 100%);
}

/* The cvta.org mark itself, white on navy like the site header. The selector has
   to out-specify `.news-thumb img` above or the cover rule stretches the logo. */
.news-thumb img.news-thumb-mark {
  position: relative;
  width: min(140px, 62%);
  height: auto;
  object-fit: contain;
  opacity: .94;
}

/* --------------------------------------------------------------- card body */

.news-body { padding: var(--s-4); }

.news-kicker {
  margin: 0 0 var(--s-1);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
  color: var(--ink);
}
.news-card-main:hover .news-title { color: var(--navy); }

.news-excerpt {
  margin: var(--s-2) 0 0;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: 10px var(--s-4);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.news-detail-btn {
  font-size: .82rem;
  min-height: 32px;
  cursor: pointer;
}

.news-card-when {
  font-size: .76rem;
  color: var(--muted);
  white-space: nowrap;
}

.news-foot-note {
  margin: var(--s-2) 0 0;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
}

/* Wider phones and up: image beside the text. */
@media (min-width: 520px) {
  .news-card-main { display: grid; grid-template-columns: 200px minmax(0, 1fr); align-items: stretch; }
  .news-thumb { height: 100%; aspect-ratio: auto; min-height: 140px; }
  .news-body { padding: var(--s-4) var(--s-5); }
  .news-title { font-size: 1.08rem; }
}

@media (min-width: 900px) {
  .news-card-main { grid-template-columns: 240px minmax(0, 1fr); }
}

/* ----------------------------------------------------------------- detail */

.news-back {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: var(--s-3);
  font-size: .9rem;
  cursor: pointer;
}

.news-article { padding: 0; overflow: hidden; }

.news-thumb-hero {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  min-height: 0;
}

.news-article-meta {
  margin: var(--s-4) var(--s-5) 0;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-article-title {
  margin: var(--s-2) var(--s-5) 0;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.02em;
}

.news-article-excerpt {
  margin: var(--s-3) var(--s-5) 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.news-article-note {
  margin: var(--s-3) var(--s-5) 0;
  padding: 10px var(--s-3);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  background: var(--blue-soft);
  font-size: .82rem;
  color: var(--ink-2);
}

.news-article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  padding: var(--s-5);
}
.news-article-actions .btn { flex: 1 1 180px; }

.news-detail-foot {
  display: flex;
  justify-content: center;
  padding: var(--s-4) 0 0;
  font-size: .85rem;
}

@media (min-width: 640px) {
  .news-article-title { font-size: 1.5rem; }
}
