/* ============================================================
   I Love Cars Today — site.css
   Editorial typography, restrained palette, mobile-first.
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding-left: 0; list-style-position: inside; }
img, picture { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- Color & type tokens ---------- */
:root {
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-dark: #0f1623;
  --ink: #14181f;
  --ink-soft: #3e4654;
  --ink-muted: #5b6472;
  --rule: #dfe3ea;
  --rule-strong: #aab2c0;
  --accent: #1d63d8;       /* news blue */
  --accent-soft: #dde8fb;
  --max-w: 1180px;
  --measure: 68ch;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --serif: 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
}

/* ---------- Base typography ---------- */
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.4vw, 3.4rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.05rem); margin: 1.6em 0 0.5em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 0.45em; font-weight: 600; }
h4 { font-size: 1rem; margin: 1em 0 0.3em; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); font-family: var(--sans); font-weight: 600; }

p { margin: 0 0 1em; }
p + p { margin-top: 0; }

a { color: var(--ink); text-decoration-line: underline; text-decoration-color: var(--rule-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color 0.15s ease; }
a:hover { text-decoration-color: var(--accent); }

small, .meta { font-size: 0.83rem; color: var(--ink-muted); }
em { font-style: italic; }
strong { font-weight: 600; }
blockquote { border-left: 3px solid var(--accent); margin: 1.4em 0; padding: 0.2em 0 0.2em 1.2em; font-family: var(--serif); font-style: italic; font-size: 1.12rem; color: var(--ink-soft); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.section { padding: 56px 0; }
.section--tight { padding: 36px 0; }
.section--dark { background: var(--bg-dark); color: #f0ede5; }
.section--dark a { color: #f0ede5; text-decoration-color: rgba(255,255,255,0.3); }
.section--dark a:hover { text-decoration-color: var(--accent); }

/* ---------- Site header / nav ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background-color: rgba(250, 248, 245, 0.92);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}
.site-header__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-header__brand-mark { width: 38px; height: 38px; flex: 0 0 38px; }
.site-header__brand-name {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}
.site-header__brand-tag { display: none; font-size: 0.82rem; color: var(--ink-muted); margin-top: 2px; }
@media (min-width: 768px) { .site-header__brand-tag { display: block; } }

.site-nav { display: none; }
@media (min-width: 900px) { .site-nav { display: flex; gap: 28px; align-items: center; } }
.site-nav a { font-size: 0.93rem; text-decoration: none; color: var(--ink-soft); padding: 8px 0; }
.site-nav a:hover { color: var(--ink); }

.menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: transparent; border: 1px solid var(--rule); border-radius: 4px; }
.menu-toggle svg { width: 22px; height: 22px; fill: var(--ink); }
@media (min-width: 900px) { .menu-toggle { display: none; } }

.mobile-nav { display: none; border-top: 1px solid var(--rule); background: var(--bg); padding: 16px 0; }
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav li { border-bottom: 1px solid var(--rule); }
.mobile-nav li:last-child { border-bottom: none; }
.mobile-nav a { display: block; padding: 14px 24px; font-size: 1rem; color: var(--ink); text-decoration: none; }

/* ---------- Eyebrow / kicker ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

/* ---------- Homepage hero (featured article) ---------- */
.hero {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--rule);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
}
.hero__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--rule);
}
.hero__image img { width: 100%; height: 100%; object-fit: cover; }
.hero__copy h1 {
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3rem);
  margin: 0 0 0.35em;
}
.hero__copy .dek {
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--ink-soft);
  margin-bottom: 1.2em;
  line-height: 1.55;
}
.hero__copy .meta { font-size: 0.86rem; }
.hero__copy a { text-decoration: none; }

/* ---------- Article feed grid ---------- */
.feed {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px 28px;
}
@media (min-width: 600px) { .feed { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .feed { grid-template-columns: 1fr 1fr 1fr; } }

.card { display: flex; flex-direction: column; }
.card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--rule);
}
.card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card__image img { transform: scale(1.03); }
.card__eyebrow { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.card__title { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; line-height: 1.25; margin: 0 0 8px; }
.card__title a { text-decoration: none; color: var(--ink); }
.card__title a:hover { color: var(--accent); }
.card__dek { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; margin-bottom: 10px; }
.card__byline { font-size: 0.82rem; color: var(--ink-muted); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.section-heading h2 { font-size: 1.45rem; margin: 0; }
.section-heading a { font-size: 0.88rem; color: var(--ink-muted); text-decoration: none; }
.section-heading a:hover { color: var(--accent); }

/* ---------- Article page ---------- */
.article-hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--rule);
}
.article-hero__breadcrumb {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-bottom: 16px;
}
.article-hero__breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.article-hero__breadcrumb a:hover { color: var(--accent); }
.article-hero h1 {
  max-width: 22ch;
  margin-bottom: 0.4em;
}
.article-hero .dek {
  max-width: var(--measure);
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 1.5em;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5em;
}
.article-byline__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--rule);
  overflow: hidden;
  flex: 0 0 48px;
}
.article-byline__avatar img { width: 100%; height: 100%; object-fit: cover; }
.article-byline__meta { font-size: 0.88rem; color: var(--ink-muted); line-height: 1.4; }
.article-byline__meta strong { color: var(--ink); font-weight: 600; }

.article-hero__image {
  margin: 0 calc(-1 * 24px);
  background: var(--rule);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
@media (min-width: 768px) { .article-hero__image { margin: 0 calc(-1 * 32px); } }
@media (min-width: 1240px) { .article-hero__image { margin: 0; border-radius: 2px; } }
.article-hero__image img { width: 100%; height: 100%; object-fit: cover; }
.article-hero__credit { display: block; font-size: 0.78rem; color: var(--ink-muted); padding: 8px 0 0; }

.article-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  padding: 48px 0;
  max-width: 100%;
}
@media (min-width: 1000px) {
  .article-body { grid-template-columns: minmax(0, 1fr) 280px; gap: 64px; }
}

.article-body__prose {
  max-width: var(--measure);
  font-size: 1.04rem;
  line-height: 1.7;
}
.article-body__prose p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.4em;
  float: left;
  line-height: 0.9;
  margin: 0.08em 0.08em 0 0;
  color: var(--accent);
  font-weight: 600;
}
.article-body__prose p { margin: 0 0 1.15em; }
.article-body__prose h2 { font-size: 1.55rem; margin-top: 1.6em; margin-bottom: 0.45em; }
.article-body__prose h3 { font-size: 1.18rem; margin-top: 1.4em; }
.article-body__prose img, .article-body__prose figure { margin: 1.6em 0; }
.article-body__prose figure { text-align: center; }
.article-body__prose figcaption { font-size: 0.85rem; color: var(--ink-muted); margin-top: 6px; }
.article-body__prose ul, .article-body__prose ol { margin: 0 0 1.2em 1.2em; list-style-position: outside; }
.article-body__prose li { margin-bottom: 0.5em; }

.article-aside { font-size: 0.95rem; }
.article-aside__box {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  padding: 22px 22px 20px;
  margin-bottom: 24px;
}
.article-aside__box h4 {
  margin-top: 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.article-aside__box ul { list-style: none; padding: 0; margin: 0; }
.article-aside__box li { padding: 10px 0; border-bottom: 1px solid var(--rule); font-family: var(--serif); font-size: 0.98rem; line-height: 1.35; }
.article-aside__box li:last-child { border-bottom: 0; }
.article-aside__box a { text-decoration: none; }
.article-aside__box a:hover { color: var(--accent); }

/* ---------- Author bio block (end of article) ---------- */
.author-bio {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 36px 0 0;
}
.author-bio__avatar { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--rule); }
.author-bio__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-bio__name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin: 0 0 6px; }
.author-bio__role { font-size: 0.83rem; color: var(--ink-muted); margin-bottom: 10px; }
.author-bio__copy { font-size: 0.95rem; color: var(--ink-soft); line-height: 1.55; }

/* ---------- Static content pages ---------- */
.page-hero { padding: 40px 0 16px; border-bottom: 1px solid var(--rule); }
.page-content {
  padding: 40px 0 80px;
  max-width: var(--measure);
}
.page-content h2 { font-size: 1.35rem; margin-top: 2em; }
.page-content h3 { font-size: 1.1rem; }
.page-content p { font-size: 1.02rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-dark);
  color: #d8d4c6;
  padding: 56px 0 32px;
  margin-top: 80px;
  font-size: 0.93rem;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px 40px;
  margin-bottom: 36px;
}
@media (min-width: 700px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
@media (min-width: 700px) { .site-footer__grid--two { grid-template-columns: 1.6fr 1fr; } }
.site-footer h4 { color: #f0ede5; font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.11em; text-transform: uppercase; margin: 0 0 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #d8d4c6; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer__about p { color: #b8b3a3; line-height: 1.55; margin-bottom: 1em; }

.site-footer__bottom {
  padding-top: 24px;
  border-top: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #918d80;
}

/* ---------- Misc utilities ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sr-only { @extend .visually-hidden; }

/* ---------- Forms (contact page) ---------- */
.form { display: grid; gap: 16px; max-width: 480px; }
.form label { display: block; font-size: 0.88rem; font-weight: 500; margin-bottom: 6px; color: var(--ink-soft); }
.form input, .form textarea { width: 100%; padding: 11px 14px; border: 1px solid var(--rule-strong); background: var(--bg-elev); font-family: var(--sans); font-size: 1rem; }
.form textarea { resize: vertical; min-height: 140px; }
.form button { background: var(--bg-dark); color: var(--bg); border: 0; padding: 12px 24px; font-weight: 500; letter-spacing: 0.03em; }
.form button:hover { background: var(--accent); }

/* ---------- Print hide (just for the footer / nav cleanup) ---------- */
@media print { .site-header, .site-footer { display: none; } }

/* ---------- Image fade-in (progressive enhancement) ----------
   Default state is VISIBLE. JS adds .is-visible which retriggers a
   subtle reveal animation. No-JS, broken-JS, and below-fold-at-load
   states all render visibly. */
.fade-in.is-visible { animation: bcgReveal 0.55s ease both; }
@keyframes bcgReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
