/* =========================================================
   Hybrid Electronics — Hot Topic (/news) additions
   Loaded AFTER /assets/styles.v154.css so it inherits vars.
   ========================================================= */

/* Prevent nav items from wrapping onto two lines now that we've
   added a fourth nav link (Hot Topic). Scoped to pages that load
   news.v1.css so the rest of the site is unaffected. */
.site-nav a { white-space: nowrap; }
.site-nav { gap: 22px; }

/* ---- Hero variant ---- */
.news-hero { padding-top: 72px; padding-bottom: 48px; }
.news-hero .hero-title { max-width: 22ch; margin-left: auto; margin-right: auto; }
.news-hero .hero-sub { max-width: 62ch; margin-left: auto; margin-right: auto; }

/* ---- Filter pills row ---- */
.news-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
}
.news-filters .category-pill {
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: all .15s ease;
}
.news-filters .category-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.news-filters .category-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Article grid ---- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none;
  color: inherit;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--line-2);
}

.news-card__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a1a1a 0%, #131313 100%);
  background-size: cover;
  background-position: center;
  position: relative;
}
.news-card__media .news-card__topic {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-block !important;
  width: auto !important;
  max-width: calc(100% - 28px);
  background: rgba(232, 101, 36, 0.95);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  line-height: 1.2;
}

.news-card__body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-card__meta {
  font-size: 13px;
  color: var(--muted-2);
  margin-bottom: 10px;
}
.news-card__meta span + span::before { content: " · "; }
.news-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 12px;
}
.news-card__excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 18px;
  flex: 1;
}
.news-card__read {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.news-card__read::after {
  content: "→";
  transition: transform .15s ease;
}
.news-card:hover .news-card__read::after { transform: translateX(4px); }

.news-empty {
  text-align: center;
  color: var(--muted-2);
  font-size: 15px;
  padding: 40px 0;
}

/* ---- Article page ---- */
/* Article pages need an opaque background because the site's html
   element paints a fixed dark circuit-board photo that would otherwise
   show through and make body text unreadable. */
body:has(.article-hero) {
  background: #ffffff;
}
.article-body {
  background: #ffffff;
}

.article-hero {
  background: var(--navy);
  color: #fff;
  padding: 64px 0 56px;
  border-bottom: 1px solid #000;
}
.article-hero .container { max-width: 780px; }
.article-hero .article-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.article-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  margin: 0 0 20px;
  color: #fff;
}
.article-hero .article-meta {
  font-size: 14px;
  color: #b8bcc4;
}
.article-hero .article-meta span + span::before { content: " · "; color: #5a5a5a; }

.article-body {
  padding: 56px 0 40px;
}
.article-body .container { max-width: 720px; }
.article-body p,
.article-body ul,
.article-body ol {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 0 0 22px;
}
.article-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.25;
  color: var(--ink);
  margin: 44px 0 16px;
}
.article-body h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  margin: 32px 0 12px;
}
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--accent-hover); }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--ink);
}
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 24px 0;
}

.article-cta {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin: 40px 0 20px;
  text-align: center;
}
.article-cta h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0 0 8px;
  color: var(--ink);
}
.article-cta p {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 20px;
}

.article-back {
  padding: 32px 0 8px;
}
.article-back a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}
.article-back a:hover { color: var(--accent); }
.article-back a::before { content: "← "; }

/* ---- Related articles ---- */
.related-section {
  border-top: 1px solid var(--line);
  padding: 56px 0 24px;
}
.related-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  color: var(--ink);
  margin: 0 0 28px;
  text-align: center;
}

@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; gap: 20px; }
  .news-hero { padding-top: 48px; padding-bottom: 32px; }
  .article-hero { padding: 48px 0 40px; }
  .article-body { padding: 40px 0 24px; }
}
