/*
Theme Name: Tech in the Car Modern
Theme URI: https://techinthecar.com
Author: Tech in the Car
Description: Ultra-fast "The Verge for Cars" dark automotive-tech editorial WordPress theme. Features asymmetric cover hero, numbered live stream rail, Infotainment Guides hub, review scorecards, zero jQuery bloat, and native click-to-play YouTube embeds.
Version: 2.2.0
Requires at least: 6.4
Tested up to: 7.1.5
Requires PHP: 7.4
Text Domain: techinthecar
License: GNU General Public License v2 or later
*/

:root {
  --bg: #09090d;
  --bg-elevated: #11121a;
  --bg-card: #151722;
  --bg-card-hover: #1c1f2e;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f8fafc;
  --text-muted: #a1a7bb;
  --text-dim: #6f768d;
  --cyan: #00e5ff;
  --blue: #2589ff;
  --pink: #ff1f6d;
  --purple: #7c3aed;
  --red: #ff2e4c;
  --lime: #34d399;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --max-w: 1320px;
  --prose-w: 780px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --transition: 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(920px 380px at 8% -4%, rgba(0, 229, 255, 0.12), transparent 58%),
    radial-gradient(840px 380px at 92% -4%, rgba(255, 31, 109, 0.12), transparent 58%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: all var(--transition); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.site-main { flex: 1 0 auto; padding: 28px 0 80px; }

/* ================= Top Live Ticker ================= */
.top-ticker {
  background: linear-gradient(90deg, #0d1528, #1a0f29 50%, #240c1d);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.76rem;
  font-weight: 600;
}

.ticker-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
  overflow: hidden;
}

.ticker-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ticker-pill {
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.ticker-link {
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-link:hover { color: var(--cyan); }

.ticker-right {
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

/* ================= Masthead Header ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(9, 9, 13, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--blue), var(--pink)) 1;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 24px rgba(0, 174, 255, 0.35);
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-accent {
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-nav a {
  display: inline-block;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover { color: var(--text); border-color: var(--cyan); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.btn-youtube {
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 22px -6px rgba(255, 46, 76, 0.65);
}
.btn-youtube:hover { background: #ff4765; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #050810;
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.13); border-color: var(--cyan); }

.menu-toggle { display: none; }

/* Search Drawer */
.search-bar-wrap { display: none; border-top: 1px solid var(--border); background: var(--bg-elevated); padding: 14px 0; }
.search-bar-wrap.is-open { display: block; }
.search-form { display: flex; gap: 10px; max-width: 720px; margin: 0 auto; }
.search-form input[type="search"] {
  flex: 1; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 10px 14px; color: var(--text); font-size: 0.95rem; outline: none;
}
.search-form input[type="search"]:focus { border-color: var(--cyan); }

/* ================= Category Strip ================= */
.category-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 22px;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.filter-pill:hover, .filter-pill.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ================= Verge-Style Split Cover + Stream ================= */
.verge-front {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
  gap: 24px;
  margin-bottom: 48px;
  align-items: start;
}

.cover-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: 0 24px 54px -20px rgba(0, 0, 0, 0.85);
}

.cover-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05070c;
}

.cover-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms ease;
}

.cover-hero:hover .cover-media img { transform: scale(1.03); }

.cover-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9,9,13,0.05) 35%, rgba(9,9,13,0.92) 100%);
  pointer-events: none;
}

.cover-body {
  padding: 26px 30px 30px;
  position: relative;
  z-index: 2;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--pink);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kicker-cyan {
  background: rgba(0, 229, 255, 0.14);
  border: 1px solid rgba(0, 229, 255, 0.38);
  color: var(--cyan);
}

.cover-title {
  margin: 12px 0 10px;
  font-size: clamp(1.7rem, 3.2vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 900;
}

.cover-title a:hover { color: var(--cyan); }

.cover-deck {
  margin: 0 0 18px;
  color: #cbd5e1;
  font-size: 1rem;
  max-width: 64ch;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
}

.play-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(9, 9, 13, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.play-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* Right-Hand "THE STREAM" Rail (Verge Signature) */
.stream-rail {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-top: 3px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.stream-heading {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cyan);
}

.stream-item {
  display: grid;
  grid-template-columns: 26px 1fr 82px;
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}

.stream-item:last-child { border-bottom: 0; padding-bottom: 4px; }

.stream-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--pink);
  line-height: 1.2;
}

.stream-title {
  margin: 3px 0 4px;
  font-size: 0.9rem;
  line-height: 1.28;
  font-weight: 800;
}

.stream-title a:hover { color: var(--cyan); }

.stream-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.stream-thumb {
  width: 82px;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  overflow: hidden;
  background: #07090e;
  border: 1px solid var(--border);
}

.stream-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ================= Color-Blocked Editorial Hubs ================= */
.editorial-hub {
  margin: 52px 0;
  padding: 30px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(0, 229, 255, 0.08) 55%, rgba(255, 31, 109, 0.12));
  border: 1px solid rgba(124, 58, 237, 0.35);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.section-sub {
  font-size: 0.82rem;
  color: var(--cyan);
  font-weight: 700;
}

/* ================= Post Grid ================= */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

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

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), border-color var(--transition), background var(--transition);
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 229, 255, 0.45);
  background: var(--bg-card-hover);
}

.card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #07090e;
  overflow: hidden;
}

.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 360ms ease; }
.post-card:hover .card-thumb img { transform: scale(1.04); }

.card-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, #101729, #18233a); color: var(--text-dim); font-weight: 800;
}

.card-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { margin: 0; font-size: 1.08rem; line-height: 1.28; font-weight: 800; letter-spacing: -0.015em; }
.card-title a:hover { color: var(--cyan); }
.card-excerpt {
  margin: 0; font-size: 0.87rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono);
}

.cat-pill {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 4px;
  background: rgba(0, 229, 255, 0.12); border: 1px solid rgba(0, 229, 255, 0.30);
  color: var(--cyan); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
}

/* ================= Promo Banner ================= */
.promo-banner {
  margin-top: 52px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.14), rgba(255, 31, 109, 0.12));
  border: 1px solid rgba(0, 229, 255, 0.30);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.promo-banner h2 { margin: 0 0 6px; font-size: 1.35rem; font-weight: 900; }
.promo-banner p { margin: 0; color: var(--text-muted); max-width: 620px; }

/* ================= Pagination ================= */
.pagination { margin-top: 44px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px;
  padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text-muted); font-weight: 700; font-size: 0.88rem;
}
.pagination .page-numbers.current, .pagination .page-numbers:hover {
  background: var(--cyan); color: #050810; border-color: var(--cyan);
}

/* ================= Single Article & Verge Scorecard ================= */
.article-wrap { max-width: var(--prose-w); margin: 0 auto; }
.article-header { margin-bottom: 26px; }
.article-title {
  margin: 12px 0 14px; font-size: clamp(1.85rem, 3.8vw, 2.8rem);
  line-height: 1.1; letter-spacing: -0.035em; font-weight: 900;
}
.article-hero-media {
  margin: 0 auto 30px; max-width: 980px; border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16 / 9;
}
.article-hero-media img { width: 100%; height: 100%; object-fit: cover; }

.entry-content { font-size: 1.07rem; line-height: 1.82; color: #e2e8f0; }
.entry-content h2 { margin: 2em 0 0.65em; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.025em; font-weight: 900; color: var(--text); }
.entry-content h3 { margin: 1.6em 0 0.55em; font-size: 1.25rem; font-weight: 800; color: var(--text); }
.entry-content p { margin: 0 0 1.25em; }
.entry-content a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.45em; }

/* AI Video Summary Box */
.titc-summary-box {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.10), rgba(21, 23, 34, 0.96));
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-left: 4px solid var(--cyan);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 24px 0 28px;
}
.titc-summary-box h2, .titc-summary-box h3 {
  margin: 0 0 12px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cyan);
}
.titc-summary-box ul { margin: 0; padding-left: 1.25em; }

/* Verge-style Review Scorecard (The Good / The Bad + Tech Score) */
.titc-scorecard {
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 31, 109, 0.35);
  border-top: 3px solid var(--pink);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin: 28px 0;
}
.titc-scorecard-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.titc-scorecard-title { margin: 0; font-size: 1rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; }
.titc-score-badge {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff; font-family: var(--font-mono); font-size: 1.15rem; font-weight: 900;
  padding: 6px 14px; border-radius: 8px;
}
.titc-scorecard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.titc-good h3 { color: var(--lime); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.titc-bad h3 { color: var(--pink); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.titc-scorecard ul { margin: 0; padding-left: 1.15em; font-size: 0.93rem; }

/* Click-to-Play YouTube Facade */
.titc-yt-facade, .wp-block-embed-youtube .wp-block-embed__wrapper {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius-md);
  overflow: hidden; background: #000; border: 1px solid var(--border-strong); margin: 24px 0;
}
.titc-yt-facade { cursor: pointer; }
.titc-yt-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; transition: all 320ms ease; }
.titc-yt-facade:hover img { opacity: 1; transform: scale(1.02); }
.titc-yt-play {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 52px; border-radius: 14px;
  background: rgba(255, 46, 76, 0.94); border: 0; display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65); transition: transform var(--transition);
}
.titc-yt-facade:hover .titc-yt-play { transform: scale(1.08); }
.titc-yt-facade iframe, .wp-block-embed-youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.related-section { margin-top: 64px; padding-top: 36px; border-top: 1px solid var(--border); }

/* ================= Footer ================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: #060609;
  padding: 46px 0 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; font-weight: 600; font-size: 0.85rem; }
.footer-links a:hover { color: var(--cyan); }
.footer-bottom { padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 0.8rem; color: var(--text-dim); }

/* ================= Responsive ================= */
@media (max-width: 1080px) {
  .verge-front { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .ticker-right { display: none; }
  .primary-nav {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border); padding: 14px 20px 20px;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; align-items: stretch; }
  .menu-toggle { display: grid; }
  .btn-youtube span { display: none; }
  .post-grid, .post-grid-2, .titc-scorecard-cols { grid-template-columns: 1fr; }
  .cover-body { padding: 20px; }
  .editorial-hub { padding: 20px; }
}

/* ================= AdSense Auto-Ads Safe Containment ================= */
/* Keeps Google Auto Ads strictly in normal document flow (100% policy-safe, no overlapping text/cards). */
.google-auto-placed,
ins.adsbygoogle {
  position: relative !important;
  z-index: 1;
  clear: both;
  max-width: 100% !important;
  overflow: hidden;
  margin: 24px auto !important;
  box-sizing: border-box;
}

.verge-front > .google-auto-placed,
.post-grid > .google-auto-placed,
.post-grid-2 > .google-auto-placed,
.editorial-hub > .google-auto-placed,
.entry-content > .google-auto-placed {
  grid-column: 1 / -1;
  width: 100% !important;
}

.entry-content .google-auto-placed,
.entry-content ins.adsbygoogle {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

