/* Home page: the car news wire. Builds on style.css (palette, masthead, panels, buttons). */

.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.home-cta .btn { text-decoration: none; display: inline-block; }

/* ---- Topic tabs ---------------------------------------------------------- */

.news-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.news-tab {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--carbon);
  border: 1px solid var(--rule);
  padding: 7px 14px;
  cursor: pointer;
  transform: skewX(-10deg);
}

.news-tab:hover { color: var(--ink); border-color: var(--ink-soft); }

.news-tab[aria-pressed="true"] {
  color: var(--hazard-ink);
  background: var(--hazard);
  border-color: var(--hazard);
}

.news-tab:focus-visible, .news-link:focus-visible {
  outline: 2px solid var(--hazard);
  outline-offset: 3px;
}

/* ---- Top story ------------------------------------------------------------- */

.news-lead {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--carbon);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--hazard);
  margin-bottom: 26px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  overflow: hidden;
}

.news-lead.has-thumb { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

.news-lead-img {
  width: 100%;
  height: 100%;
  min-height: 240px;
  max-height: 360px;
  object-fit: cover;
  display: block;
  background: var(--carbon-2);
}

.news-lead-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.news-lead-body .eyebrow { margin: 0; color: var(--hazard); }

.news-lead-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.05;
  text-transform: uppercase;
  margin: 0;
  text-wrap: balance;
}

/* ---- Lists ----------------------------------------------------------------- */

.news-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 26px;
}

.news-section { margin-bottom: 26px; }
.news-columns .news-section { margin-bottom: 0; }

.news-list, .news-grid { list-style: none; margin: 0; padding: 0; }

.news-list {
  background: var(--carbon);
  border: 1px solid var(--rule);
}

.news-list .news-card {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
}

.news-list .news-card:last-child { border-bottom: none; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.news-grid .news-card {
  background: var(--carbon);
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
}

.news-grid .news-body { padding: 14px 16px 16px; }

.news-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--carbon-2);
}

/* While a picture loads, or when it fails, the box shows a quiet news icon instead of bare grey. */
.news-thumb, .news-lead-img, .news-thumb-blank {
  background: var(--carbon-2) url("/static/art/news-placeholder.svg") center / 56px auto no-repeat;
}

.news-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
  margin: 4px 0 0;
  text-wrap: pretty;
}

.news-link { color: var(--ink); text-decoration: none; }
.news-link:hover { color: var(--hazard); text-decoration: underline; text-underline-offset: 3px; }
.news-link:visited { color: #c9d0d8; }

.news-teaser {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 6px 0 0;
  text-wrap: pretty;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.news-source { color: var(--ink); font-weight: 500; }

.news-topic {
  padding: 1px 6px;
  border: 1px solid var(--rule);
}

.news-topic.topic-new { color: var(--hazard); border-color: color-mix(in srgb, var(--hazard) 45%, transparent); }
.news-topic.topic-recalls { color: var(--signal); border-color: color-mix(in srgb, var(--signal) 45%, transparent); }
.news-topic.topic-ev { color: #5fd3a6; border-color: color-mix(in srgb, #5fd3a6 45%, transparent); }

.news-empty { padding: 14px 18px; margin: 0; }

#news-status { margin: 0 0 18px; }

/* ---- Credits --------------------------------------------------------------- */

.news-credits {
  border-top: 1px solid var(--rule);
  padding-top: 16px;
  margin-top: 10px;
}

.news-credits .note { margin-bottom: 10px; }

.news-sources {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
}

.news-sources a { color: var(--ink-soft); }
.news-sources li.down a { text-decoration: line-through; opacity: 0.6; }

@media (max-width: 820px) {
  .news-columns { grid-template-columns: 1fr; }
  .news-lead.has-thumb { grid-template-columns: 1fr; }
  .news-lead-img { min-height: 0; aspect-ratio: 16 / 9; max-height: none; }
}

.news-lead[hidden], .news-columns[hidden], .news-section[hidden], #news-status[hidden] { display: none; }

/* ---- Start here ---------------------------------------------------------- */

.start-here { margin: 0 0 22px; }
.start-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.start-card {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
  background: var(--carbon);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--marker);
}
.start-card:hover { border-color: var(--hazard); }
.start-card:focus-visible { outline: 2px solid var(--hazard); outline-offset: 2px; }
.start-card strong { font: italic 800 19px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; }
.start-card span { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.start-continue { border-left-color: var(--hazard); }
.start-card[hidden] { display: none; }
