/* ==========================================================================
   Auto Advice Daily
   Layout system after the System1 publication pattern: full-bleed grid,
   post-module card variations, category strip, trending list.
   Palette and type are our own.
   ========================================================================== */

:root {
  --primary: #14477D;
  --primary-dark: #0E3459;
  --accent-1: #B3431C;
  --accent-2: #0E7490;
  --pastel-1: #F1F5F9;
  --pastel-2: #F4F1ED;
  --pastel-3: #EEF3F7;
  --black: #232529;
  --white: #FFFFFF;
  --dark-gray-1: #5A6068;
  --dark-gray-2: #767C85;
  --light-gray-1: #E3E6EA;
  --light-gray-2: #EDEFF2;

  --heading-font: "Bitter", Georgia, "Times New Roman", serif;
  --body-font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container-width: 75rem;
  --gutter: 1rem;
  --header-height: 3.625rem;
  --box-shadow: 0 0.1875rem 0.375rem rgba(35, 37, 41, .12);
  --radius: 0.375rem;
}

@media (min-width: 62rem) {
  :root { --gutter: 5%; --header-height: 4.75rem; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--heading-font);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

.screen-reader-text {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* full-bleed grid: content sits in the centre track */
.bleed {
  display: grid;
  grid-template-columns: minmax(var(--gutter), 1fr) minmax(0, var(--container-width)) minmax(var(--gutter), 1fr);
}
.bleed > * { grid-column: 2 / -2; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--white);
  border-bottom: 1px solid var(--light-gray-1);
}

.header__inner {
  display: flex; align-items: center; gap: 1.25rem;
  height: var(--header-height);
}

.logo {
  font-family: var(--heading-font);
  font-weight: 700; font-size: 1.35rem;
  letter-spacing: -0.01em; white-space: nowrap;
  color: var(--primary);
}
.logo span { color: var(--accent-1); }

.nav { display: none; gap: 1.75rem; margin-left: 1rem; flex: 1; }
.nav__link {
  font-size: 0.95rem; font-weight: 500; color: var(--black);
  padding: 0.35rem 0; border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav__link:hover { color: var(--primary); }
.nav__link[aria-current="page"] { border-bottom-color: var(--accent-1); color: var(--primary); }

.header__search {
  margin-left: auto; display: inline-flex; align-items: center;
  gap: 0.6rem; height: 2.5rem; padding: 0 1.1rem;
  border: 1px solid var(--light-gray-1); border-radius: 999px;
  font-size: 0.875rem; font-weight: 500; color: var(--dark-gray-1);
  transition: border-color .15s, color .15s;
}
.header__search:hover { border-color: var(--primary); color: var(--primary); }
.header__search svg { width: 0.9rem; height: 0.9rem; }

.hamburger {
  margin-left: auto; display: inline-flex; flex-direction: column;
  justify-content: space-between; width: 1.7rem; height: 1.1rem;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.hamburger span { height: 2px; border-radius: 2px; background: var(--black); transition: transform .2s, opacity .2s; }
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(.53rem) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-.53rem) rotate(-45deg); }

.popout-nav {
  display: none; background: var(--white);
  border-bottom: 1px solid var(--light-gray-1);
  box-shadow: var(--box-shadow);
}
.popout-nav.open { display: grid; }
.popout-nav__link {
  padding: 0.95rem 0; border-bottom: 1px solid var(--light-gray-2);
  font-size: 1rem; font-weight: 500;
}
.popout-nav__link:last-child { border-bottom: 0; }
.popout-nav__link[aria-current="page"] { color: var(--primary); }

/* ---------- category strip ---------- */

.category-strip { background: var(--pastel-1); padding: 1.5rem 0; }
.category-strip__container {
  display: grid; gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}
.category-strip__item {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  background: var(--white); border: 1px solid var(--light-gray-1);
  border-radius: var(--radius); padding: 1rem 0.6rem;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.category-strip__item:hover {
  border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--box-shadow);
}
.category-strip__icon { width: 1.75rem; height: 1.75rem; color: var(--primary); }
.category-strip__heading {
  font-family: var(--heading-font); font-weight: 700;
  font-size: 0.875rem; text-align: center; line-height: 1.3;
}

/* ---------- section headings ---------- */

.section-heading {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.35rem 1rem; margin: 2.75rem 0 1.25rem;
  padding-bottom: 0.6rem; border-bottom: 2px solid var(--black);
}
.section-heading h2 { font-size: 1.5rem; margin: 0; }
.section-heading a { font-size: 0.9rem; font-weight: 700; color: var(--primary); }
.section-heading a:hover { color: var(--accent-1); }

/* ---------- post module ---------- */

.post-module { display: grid; gap: 1rem; }

.post-module__item { display: grid; align-content: start; gap: 0.5rem 0.25rem; position: relative; }
.post-module__thumb-link { position: relative; display: block; }
.post-module__thumb {
  width: 100%; height: 11.25rem; object-fit: cover;
  border-radius: var(--radius); background: var(--pastel-1);
}
.post-module__category { font-size: 0.9375rem; font-weight: 700; color: var(--accent-1); }
.post-module__heading { font-size: 1.125rem; margin: 0; }
.post-module__heading-link:hover { color: var(--primary); }
.post-module__description {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden; margin: 0;
}
.post-module__description p { font-size: 0.875rem; line-height: 1.45; color: var(--dark-gray-1); margin: 0; }
.post-module__read-time { font-size: 0.8125rem; color: var(--dark-gray-2); }
.post-module__button {
  justify-self: start; margin-top: 0.35rem;
  background: var(--primary); color: var(--white);
  font-size: 0.8125rem; font-weight: 700; letter-spacing: .02em;
  padding: 0.55rem 1.1rem; border-radius: var(--radius);
  transition: background .15s;
}
.post-module__button:hover { background: var(--accent-1); }

/* variation 1 — grid of cards with thumbs */
.post-module--variation-1 { gap: 1.5rem 3%; }
.post-module--variation-1 .post-module__button { display: none; }

/* variation 2 — lead item with thumb, rest as a compact text list */
.post-module--variation-2 .post-module__item:nth-child(n+2) .post-module__thumb-link { display: none; }
.post-module--variation-2 .post-module__item:nth-child(n+2) .post-module__description,
.post-module--variation-2 .post-module__item:nth-child(n+2) .post-module__button { display: none; }
.post-module--variation-2 .post-module__item:nth-child(n+2) {
  border-top: 1px solid var(--light-gray-1); padding-top: 0.85rem;
}
.post-module--variation-2 .post-module__item:first-child .post-module__thumb { height: 17rem; }
.post-module--variation-2 .post-module__item:first-child .post-module__heading { font-size: 1.5rem; }

/* variation 3 — horizontal row, small thumb beside text */
.post-module--variation-3 .post-module__item {
  grid-template-columns: 7.5rem 1fr; gap: 0.25rem 1rem;
}
.post-module--variation-3 .post-module__thumb-link { grid-row: 1 / span 3; }
.post-module--variation-3 .post-module__thumb { height: 5.25rem; }
.post-module--variation-3 .post-module__heading { font-size: 1rem; }
.post-module--variation-3 .post-module__description,
.post-module--variation-3 .post-module__button { display: none; }

/* ---------- trending ---------- */

.trending { background: var(--pastel-3); border-radius: var(--radius); padding: 1.5rem; margin-top: 2.5rem; }
.trending h2 { font-size: 1.25rem; }
.trending__list { display: grid; gap: 0; }
.trending__item {
  display: flex; gap: 0.9rem; align-items: baseline;
  padding: 0.7rem 0; border-bottom: 1px solid var(--light-gray-1);
  font-size: 0.95rem; font-weight: 500;
}
.trending__item:last-child { border-bottom: 0; }
.trending__item:hover { color: var(--primary); }
.trending__rank { font-family: var(--heading-font); font-weight: 700; color: var(--accent-1); min-width: 1.5rem; }

/* ---------- article ---------- */

main { padding-bottom: 2rem; }

.breadcrumb { font-size: 0.8125rem; color: var(--dark-gray-2); padding: 1.1rem 0 0; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 0.4rem; }

.post-header { padding-top: 0.75rem; max-width: 48rem; }
.post-category { font-size: 0.9375rem; font-weight: 700; color: var(--accent-1); }
.post-title { font-size: 2rem; margin: 0.4rem 0 0.75rem; }
.post-standfirst { font-size: 1.125rem; color: var(--dark-gray-1); margin: 0 0 1rem; line-height: 1.55; }

.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  font-size: 0.875rem; color: var(--dark-gray-2);
  border-top: 1px solid var(--light-gray-1);
  border-bottom: 1px solid var(--light-gray-1);
  padding: 0.75rem 0; margin-bottom: 1.5rem;
}
.byline { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--black); }
.byline__mark {
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--primary); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--heading-font); font-size: 0.7rem; font-weight: 700;
}

.post-layout { display: grid; gap: 2.5rem; align-items: start; }

.post-figure { border-radius: var(--radius); overflow: hidden; margin: 0 0 1.5rem; }

.toc { background: var(--pastel-2); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.75rem; }
.toc__label { font-size: 0.75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dark-gray-2); margin-bottom: 0.5rem; }
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin: 0.35rem 0; font-size: 0.9rem; }
.toc a { font-weight: 500; }
.toc a:hover { color: var(--primary); }

.post-body { max-width: 44rem; font-size: 1.0625rem; }
.post-body h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.post-body p { margin: 0 0 1.1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body a { color: var(--primary); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.post-body a:hover { color: var(--accent-1); }

.spec-table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: 0.9375rem;
  border: 1px solid var(--light-gray-1); border-radius: var(--radius); overflow: hidden;
}
.spec-table th, .spec-table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--light-gray-1); }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table thead th { background: var(--pastel-1); font-family: var(--heading-font); font-size: 0.875rem; }
.spec-table tbody th { font-weight: 500; width: 40%; }

.callout {
  background: var(--pastel-2); border-left: 4px solid var(--accent-1);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem; margin: 0 0 1.4rem; font-size: 0.9688rem;
}
.callout__label {
  display: block; font-family: var(--heading-font); font-weight: 700;
  font-size: 0.8125rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-1); margin-bottom: 0.3rem;
}

.ai-notice {
  border: 1px solid var(--light-gray-1); border-radius: var(--radius);
  background: var(--pastel-1); padding: 1rem 1.25rem; margin-top: 2rem;
  font-size: 0.9rem; color: var(--dark-gray-1);
}
.ai-notice strong { color: var(--black); }

.sidebar { display: grid; gap: 1.75rem; }
.widget { border: 1px solid var(--light-gray-1); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.widget h3 { font-size: 1rem; margin-bottom: 0.75rem; }

/* ---------- archive ---------- */

.archive-header { padding: 1.75rem 0 0.5rem; max-width: 46rem; }
.archive-header h1 { font-size: 2rem; }
.archive-header p { color: var(--dark-gray-1); margin: 0; }

/* ---------- search ---------- */

.search-field {
  width: 100%; max-width: 34rem; font-family: var(--body-font);
  font-size: 1rem; padding: 0.75rem 1rem;
  border: 1.5px solid var(--light-gray-1); border-radius: var(--radius);
  margin: 0.5rem 0 1.5rem;
}
.search-field:focus { outline: none; border-color: var(--primary); }
.no-results { color: var(--dark-gray-1); }

/* ---------- footer ---------- */

.site-footer { background: var(--black); color: #C7CBD1; margin-top: 3rem; padding: 2.5rem 0 2rem; font-size: 0.9rem; }
.footer__grid { display: grid; gap: 1.75rem; }
.site-footer .logo { color: var(--white); font-size: 1.2rem; }
.site-footer .logo span { color: var(--accent-1); }
.footer__tagline { margin: 0.6rem 0 0; max-width: 20rem; line-height: 1.6; }
.footer-col h4 { color: var(--white); font-size: 0.9rem; margin-bottom: 0.6rem; }
.footer-col a { display: block; padding: 0.22rem 0; color: #C7CBD1; font-size: 0.875rem; }
.footer-col a:hover { color: var(--accent-1); }
.footer__legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 1.75rem; padding-top: 1.25rem; font-size: 0.8125rem; line-height: 1.7; }
.footer__legal a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ==========================================================================
   RESPONSIVE — must remain the LAST block in this file
   ========================================================================== */

@media (min-width: 36rem) {
  .category-strip__container { grid-template-columns: repeat(4, 1fr); }
  .post-module--variation-1 { grid-template-columns: repeat(2, 1fr); }
  .trending__list { grid-template-columns: repeat(2, 1fr); column-gap: 2.5rem; }
}

@media (min-width: 62rem) {
  .nav { display: flex; }
  .hamburger { display: none; }
  .popout-nav { display: none !important; }

  .post-module--variation-1 { grid-template-columns: repeat(4, 1fr); }
  .post-module--variation-2 { grid-template-columns: 1.6fr 1fr; align-items: start; }
  .post-module--variation-2 .post-module__item:first-child { grid-row: 1 / span 4; }
  .post-module--variation-2 .post-module__item:first-child .post-module__thumb { height: 21rem; }
  .post-module--variation-2 .post-module__item:first-child .post-module__heading { font-size: 1.75rem; }

  .post-layout { grid-template-columns: minmax(0, 1fr) 18rem; }
  .sidebar { position: sticky; top: 6rem; }

  .post-title { font-size: 2.5rem; }
  .archive-header h1 { font-size: 2.5rem; }
  .section-heading h2 { font-size: 1.75rem; }
  .section-heading a { white-space: nowrap; }
  .category-strip__heading { font-size: 0.9375rem; }

  .footer__grid { grid-template-columns: 1.5fr repeat(4, 1fr); }
}
