/* ============================================================
   Car News — Complete Site Stylesheet
   ============================================================ */

/* ─── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink: #11131a;
  --muted: #626a75;
  --line: #dce0e7;
  --paper: #f7f8fa;
  --white: #ffffff;
  --red: #d71920;
  --blue: #1554ff;
  --gold: #d4a843;
  --gold-light: #f5e6b8;
  --cream: #fdf8ee;
  --charcoal: #1a1f2e;
  --yellow: #ffbf1f;
  --green: #0e8f68;
  --purple: #8b5cf6;
  --orange: #ff6b00;
  --teal: #06b6d4;
  --amber: #f59e0b;
  --radius: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }

/* ─── Site Header ─────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  font-size: 1.15rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.brand:hover { color: var(--gold); text-decoration: none; }

.site-header nav {
  display: flex; gap: 18px;
  font-size: 0.9rem;
  font-weight: 600;
}
.site-header nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-header nav a:hover { color: var(--ink); }

/* ─── Homepage Hero ───────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  min-height: 440px;
  display: flex; align-items: stretch;
  background: var(--charcoal);
  overflow: hidden;
}

.hero-media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.5) saturate(1.2);
}

.hero-shine {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, transparent 50%, rgba(0,0,0,0.3) 100%);
  z-index: 1;
}

.hero-copy {
  position: relative; z-index: 2;
  flex: 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 32px 28px;
  color: #fff;
  max-width: 680px;
}

.hero-copy .eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin-bottom: 8px;
}

.hero-panel { display: grid; gap: 10px; }

.hero-kicker {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--gold);
  background: rgba(212,168,67,0.15);
  color: var(--gold-light);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: fit-content;
  border-radius: var(--radius-sm);
}

.hero-copy h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.1;
  font-weight: 900;
}

.hero-summary {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.55;
  max-width: 580px;
}

.hero-cta {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 22px;
  background: var(--gold);
  color: var(--charcoal) !important;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  width: fit-content;
  text-decoration: none !important;
  transition: background 180ms ease;
}
.hero-cta:hover { background: #c49530; }

/* Viral stack (homepage sidebar) */
.viral-stack {
  position: relative; z-index: 2;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  padding: 24px 20px;
  width: 320px;
  flex-shrink: 0;
}

.viral-card {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: background 180ms ease;
  backdrop-filter: blur(4px);
}
.viral-card:hover { background: rgba(255,255,255,0.15); }
.viral-card.is-active {
  background: rgba(212,168,67,0.18);
  border-color: rgba(212,168,67,0.3);
}

.rank {
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--gold);
  min-width: 22px;
  text-align: right;
  opacity: 0.7;
}

.viral-copy { display: grid; gap: 2px; }
.viral-title { font-size: 0.82rem; font-weight: 700; color: #fff; line-height: 1.25; }
.viral-meta { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; }

/* ─── Sections ────────────────────────────────────────── */
.section-heading {
  max-width: 1200px;
  margin: 36px auto 0;
  padding: 0 24px;
}
.section-heading .eyebrow {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ─── Story Grid ──────────────────────────────────────── */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 20px auto 48px;
  padding: 0 24px;
}

.story-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.story-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.07);
}
.story-card a { text-decoration: none !important; color: inherit; display: block; }
.story-card a:hover { color: inherit; }

.thumb-frame {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--paper);
}
.thumb-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}
.story-card:hover .thumb-frame img { transform: scale(1.04); }

.story-body { padding: 16px 18px; display: grid; gap: 6px; }

.story-body .tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.story-body h3 {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.story-body p:not(.tag) {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Article Hero (Premium) ──────────────────────────── */
.hero-premium {
  position: relative;
  width: 100%;
  height: clamp(320px, 50vh, 480px);
  overflow: hidden;
  background: linear-gradient(135deg, #0b0e14 0%, var(--charcoal) 100%);
  display: flex;
  align-items: center;
}

.hero-premium-bg {
  position: absolute; inset: 0;
}
.hero-premium-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.45) saturate(1.1);
}

.hero-premium-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.3) 50%,
    rgba(0,0,0,0.5) 100%
  );
}

.hero-premium-content {
  position: relative; z-index: 2;
  max-width: 860px;
  padding: 0 28px;
  margin: 0 auto;
  color: #fff;
  width: 100%;
}

.hero-premium-kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 12px;
  border: 1px solid;
  background: rgba(255,255,255,0.08);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: var(--radius-sm);
}

.hero-premium-content h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.06;
  margin-bottom: 14px;
  font-weight: 900;
}

.hero-premium-summary {
  font-size: 1.08rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.55;
  max-width: 700px;
}

.hero-premium-meta {
  display: flex;
  gap: 16px;
  margin-top: 18px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}
.hero-premium-meta span:not(:last-child)::after {
  content: '·';
  margin-left: 16px;
  color: rgba(255,255,255,0.3);
}

/* ─── Article Body ────────────────────────────────────── */
.article-body {
  width: min(900px, calc(100% - 48px));
  margin: -60px auto 40px;
  padding: 40px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  position: relative;
  z-index: 5;
}

.article-body h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.12;
  margin: 0 0 8px;
}
.article-body h1:first-child {
  margin-top: 0;
}

/* ─── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); font-weight: 600; text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumb span[aria-current] { font-weight: 700; color: var(--ink); }

/* ─── Article Meta ────────────────────────────────────── */
.article-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ─── Featured Image ──────────────────────────────────── */
.featured-image {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
}
.featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ─── Article Content ─────────────────────────────────── */
.article-content {
  font-size: 1.05rem;
  color: #222;
}

.article-content h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  margin: 38px 0 14px;
  line-height: 1.2;
  scroll-margin-top: 80px;
}

.article-content h3 {
  font-size: clamp(1.12rem, 1.5vw, 1.35rem);
  margin: 28px 0 10px;
  line-height: 1.25;
  scroll-margin-top: 80px;
}

.article-content p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin: 0 0 18px;
}

.article-content a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-content a:hover { color: var(--ink); }

.article-content ul,
.article-content ol {
  margin: 0 0 18px;
  padding-left: 26px;
}
.article-content li {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 6px;
}
.article-content li::marker { color: var(--gold); }

.article-content strong { font-weight: 800; color: #000; }
.article-content hr {
  margin: 30px 0;
  border: none;
  border-top: 2px solid var(--line);
}

/* ─── Blockquote ──────────────────────────────────────── */
.article-content blockquote {
  margin: 24px 0;
  padding: 18px 24px;
  border-left: 4px solid var(--gold);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(135deg, var(--cream), rgba(245,230,184,0.2));
}
.article-content blockquote p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  font-style: italic;
}

/* ─── Callout Boxes ───────────────────────────────────── */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid;
}
.callout .callout-icon { font-size: 1.3rem; line-height: 1.4; flex-shrink: 0; }
.callout p { margin: 0 !important; font-size: 0.97rem !important; line-height: 1.55 !important; }
.callout-highlight {
  border-color: #ffd51a;
  background: linear-gradient(135deg, rgba(255,213,26,0.08), rgba(255,213,26,0.02));
}
.callout-warning {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(239,68,68,0.02));
}
.callout-info {
  border-color: var(--blue);
  background: linear-gradient(135deg, rgba(21,84,255,0.06), rgba(21,84,255,0.02));
}
.callout-default {
  border-color: var(--line);
  background: var(--paper);
}

/* ─── TABLES (Premium Styling) ─────────────────────────── */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 480px;
}

.article-content thead {
  border-bottom: 2px solid var(--gold);
}

.article-content th {
  padding: 13px 16px;
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.article-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.article-content td:first-child {
  font-weight: 600;
  color: var(--ink);
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

.article-content tbody tr:hover td {
  background: rgba(212,168,67,0.04);
}

/* Table type variants */
.pricing-table td:last-child {
  font-weight: 800;
  font-size: 1rem;
  color: var(--green);
}

.spec-table th:first-child {
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.92rem;
  width: 35%;
  white-space: nowrap;
}

.comparison-table td:first-child {
  font-weight: 700;
  color: var(--ink);
}

.content-table th {
  background: var(--charcoal);
  color: #fff;
  border-color: rgba(255,255,255,0.1);
}

/* ─── Inline Code ─────────────────────────────────────── */
code {
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.85em;
  border: 1px solid var(--line);
}

/* ─── Source List ─────────────────────────────────────── */
.source-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.source-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.source-list li:last-child { border-bottom: none; }
.source-list a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.source-list a:hover { color: var(--blue); text-decoration: underline; }

/* ─── Tag List ────────────────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.tag-list a,
.tag-list span {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}
.tag-list a:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--cream);
}

/* ─── Prev / Next Navigation ──────────────────────────── */
.prev-next-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(900px, calc(100% - 48px));
  margin: 0 auto 36px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
}
.prev-next-link {
  flex: 1;
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none !important;
  transition: border-color 180ms ease, background 180ms ease;
}
.prev-next-link:hover {
  border-color: var(--gold);
  background: var(--cream);
}
.prev-next-link.disabled {
  opacity: 0.3;
  pointer-events: none;
  display: none;
}
.prev-next-direction {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.prev-next-title {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.prev-next-link:hover .prev-next-title { color: var(--blue); }

/* ─── Related Section ─────────────────────────────────── */
.related-section {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto 48px;
}
.related-section .eyebrow {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 16px;
}
.related-section h2 {
  font-size: 1.35rem;
  margin-bottom: 20px;
}

/* ─── Site Footer ─────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 28px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

/* ─── Admin ───────────────────────────────────────────── */
.admin-dashboard { max-width: 1200px; margin: 40px auto; padding: 0 24px; }
.admin-dashboard h1 { font-size: 1.8rem; margin-bottom: 24px; }
.admin-hint { font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
}
.admin-table th { font-weight: 800; text-transform: uppercase; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; background: var(--paper); }
.admin-table tr:hover td { background: rgba(212,168,67,0.04); }
.admin-form label { display: block; font-weight: 700; margin: 16px 0 4px; }
.admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
}
.admin-form textarea { min-height: 200px; resize: vertical; }
.admin-form button {
  padding: 10px 24px;
  background: var(--gold);
  color: var(--charcoal);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
}
.admin-form button:hover { background: #c49530; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 900px) {
  .viral-stack { display: none; }
  .hero { min-height: 360px; }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px;
  }
  .site-header nav { gap: 12px; font-size: 0.85rem; }

  .article-body {
    width: calc(100% - 20px);
    padding: 20px;
    margin-top: -40px;
  }

  .hero-premium { height: clamp(280px, 45vh, 380px); }
  .hero-premium-content h1 { font-size: 1.6rem; }
  .hero-premium-summary { font-size: 0.95rem; }

  .hero-copy { padding: 24px 18px; }
  .hero-copy h1 { font-size: 1.4rem; }

  .story-grid {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 14px;
  }

  .article-content table { font-size: 0.85rem; }
  .article-content th,
  .article-content td { padding: 9px 10px; }

  .prev-next-nav { flex-direction: column; }
}

@media (max-width: 480px) {
  .article-body { padding: 16px; width: calc(100% - 12px); }
  .hero-premium-content { padding: 0 16px; }
  .hero-premium-content h1 { font-size: 1.35rem; }
}
