/* ── News Station v2: Magazine Layout ───────────────────────── */

/* Tabs for switching between News and Trending */
.news-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

/* Trending tweets: 2-column embed-like cards */
.news-tweets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 820px) {
  .news-tweets-grid { grid-template-columns: 1fr; }
}
.tweet-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tweet-embed {
  min-height: 120px;
  width: 100%;
}
.tweet-embed .muted {
  color: var(--text-muted);
  font-size: 12px;
}
.news-tab {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-weight: 600;
}
.news-tab:hover { border-color: var(--accent); }
.news-tab.active {
  background: var(--accent);
  color: #0b1020;
  border-color: var(--accent);
}

/* Social engagement stats */
.news-social-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.news-social-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Hero card — full-width featured story */
.news-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.news-hero:hover { border-color: var(--accent); }
.news-hero .news-hero-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}
.news-hero .news-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px 20px 20px;
  background: linear-gradient(transparent, rgba(11,16,32,0.92) 60%);
  transition: opacity 0.3s ease;
}
.news-hero.expanded .news-hero-overlay { opacity: 0.6; }
/* When expanded, hide hero title/meta overlay to avoid collision with detail panel */
.news-hero.expanded .news-hero-overlay h2,
.news-hero.expanded .news-hero-meta {
  display: none;
}
.news-hero .news-hero-overlay h2 {
  margin: 0 0 6px;
  font-size: 1.35em;
  line-height: 1.3;
  color: #fff;
}
.news-hero .news-hero-meta {
  font-size: 13px;
  color: var(--text-muted);
}

/* Hero expand panel */
.news-hero-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.news-hero.expanded .news-hero-expand {
  max-height: 600px;
}
.news-hero.expanded .news-hero-img {
  height: 220px;
}

/* Featured grid — 3 cards with images */
.news-featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .news-featured-grid { grid-template-columns: 1fr; }
}
@media (min-width: 721px) and (max-width: 900px) {
  .news-featured-grid { grid-template-columns: repeat(2, 1fr); }
}

.news-feat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elev);
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.news-feat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.news-feat-card .news-feat-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.news-feat-card .news-feat-body {
  padding: 12px 14px 14px;
}
.news-feat-card .news-feat-body h3 {
  margin: 0 0 6px;
  font-size: 0.95em;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-feat-card .news-feat-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* Featured card expand panel */
.news-feat-expand {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.news-feat-card.expanded .news-feat-expand {
  max-height: 500px;
}
.news-feat-card.expanded .news-feat-body h3 {
  -webkit-line-clamp: unset;
  display: block;
}
/* Keep title visible, hide source/time meta when expanded to reduce overlap */
.news-feat-card.expanded .news-feat-meta {
  display: none;
}
.news-feat-card.expanded {
  transform: none;
}

/* Shared expand content styles */
.news-expand-content {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
}
.news-expand-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  display: block;
}
/* Hide expand img in hero (already visible) and featured (already visible) */
.news-hero-expand .news-expand-img,
.news-feat-expand .news-expand-img { display: none; }
.news-expand-text {
  font-size: 0.9em;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 12px;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  word-break: break-word;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.news-expand-text::-webkit-scrollbar {
  width: 8px;
  height: 0;
}
.news-expand-text::-webkit-scrollbar-track {
  background: transparent;
}
.news-expand-text::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}
.news-expand-text::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}
/* Style HTML content from RSS feeds */
.news-expand-text p { margin: 0 0 10px; }
.news-expand-text p:last-child { margin-bottom: 0; }
.news-expand-text a { color: var(--accent); text-decoration: underline; }
.news-expand-text img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.news-expand-text ul, .news-expand-text ol { padding-left: 20px; margin: 8px 0; }
.news-expand-text blockquote { border-left: 3px solid var(--accent); padding-left: 12px; margin: 8px 0; color: var(--text-muted); }
.news-expand-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.news-expand-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.news-expand-link {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.82em;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--accent);
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.news-expand-link:hover {
  background: var(--accent);
  color: #0b1020;
}

/* Source tag styling */
.news-source-tag {
  color: var(--accent);
  font-weight: 600;
}

/* Section header */
.news-section-header {
  font-size: 0.85em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Compact headline rows */
.news-headlines { margin-bottom: 20px; }

.news-headline-row {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(34,48,86,0.5);
  cursor: pointer;
  transition: background 0.15s ease;
  border-radius: 6px;
}
.news-headline-row:hover { background: rgba(18,26,48,0.7); }
.news-headline-row:last-child { border-bottom: none; }

.news-hl-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.news-hl-title {
  flex: 1;
  font-size: 0.92em;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.news-hl-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Headline expand detail */
.news-hl-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.news-headline-row.expanded .news-hl-detail {
  max-height: 500px;
}
.news-headline-row.expanded {
  background: rgba(18,26,48,0.5);
}
/* Keep headline title visible, hide source/time meta when expanded */
.news-headline-row.expanded .news-hl-meta {
  display: none;
}

/* Load more button */
.news-load-more {
  display: block;
  margin: 16px auto;
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s ease;
}
.news-load-more:hover { border-color: var(--accent); color: var(--accent); }

/* Loading skeleton */
@keyframes news-shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.news-skeleton {
  background: linear-gradient(90deg, var(--bg-elev) 25%, #1a2441 50%, var(--bg-elev) 75%);
  background-size: 800px 100%;
  animation: news-shimmer 1.5s infinite linear;
  border-radius: 8px;
}
.news-skeleton-hero { height: 320px; border-radius: 14px; margin-bottom: 20px; }
.news-skeleton-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.news-skeleton-card { height: 240px; border-radius: 12px; }
.news-skeleton-row { height: 44px; margin-bottom: 6px; }

/* Mobile responsive */
@media (max-width: 720px) {
  .news-skeleton-grid { grid-template-columns: 1fr; }
  .news-hero .news-hero-img { height: 200px; }
  .news-hero .news-hero-overlay h2 { font-size: 1.1em; }
  .news-hl-top { flex-direction: column; gap: 4px; }
  .news-hl-meta { white-space: normal; }
}
