/*
Theme Name: REDLINE
Theme URI: https://example.com/redline
Author: REDLINE
Author URI: https://example.com
Description: A telemetry-styled automotive magazine theme — reviews, news, guides and tech. Generates instrument-panel cover art for every post automatically.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: redline
*/

/* ============================================================
   REDLINE — automotive magazine theme
   Design: telemetry / instrument panel
   ============================================================ */

:root {
  --ink: #0E1217;
  --surface: #161C24;
  --surface-2: #1C232D;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --paper: #EAEEF3;
  --muted: #8893A2;
  --muted-dim: #5C6675;
  --accent: #FF5A1F;     /* ignition orange */
  --accent-2: #46D6E6;   /* telemetry cyan  */
  --maxw: 1180px;
  --gut: clamp(20px, 5vw, 56px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* subtle instrument-grid backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
  z-index: 0;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); position: relative; z-index: 1; }

/* ---------- Type roles ---------- */
.eyebrow {
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0;
}
.display {
  font-family: "Saira Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  line-height: 0.95;
  margin: 0;
}

/* ---------- Header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 18, 23, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
}
.brand-name {
  font-family: "Saira Condensed", sans-serif;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.brand-name b { color: var(--accent); font-weight: 700; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a {
  font-family: "Space Mono", monospace;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 4px;
  transition: color 0.18s, background 0.18s;
}
.nav a:hover, .nav a:focus-visible { color: var(--paper); background: var(--surface-2); }
.nav a.active { color: var(--accent); }

.nav-toggle { display: none; }

/* ---------- Telemetry spec strip (signature) ---------- */
.specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.specs .cell {
  flex: 1 1 0;
  min-width: 88px;
  padding: 9px 13px;
  border-right: 1px solid var(--line);
}
.specs .cell:last-child { border-right: none; }
.specs .k {
  font-family: "Space Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  display: block;
}
.specs .v {
  font-family: "Saira Condensed", sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--accent-2);
  letter-spacing: 0.01em;
}

/* ---------- Hero (home) ---------- */
.hero { padding: clamp(28px, 5vw, 52px) 0 8px; }
.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(20px, 4vw, 44px);
  align-items: center;
}
.hero-media {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero-media .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* corner brackets */
.bracket { position: absolute; width: 22px; height: 22px; border: 2px solid var(--accent); pointer-events: none; }
.bracket.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.bracket.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.bracket.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.bracket.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.hero-body .eyebrow { margin-bottom: 16px; }
.hero-title {
  font-size: clamp(34px, 5.4vw, 62px);
  margin-bottom: 18px;
}
.hero-title a { background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.3s; }
.hero-title a:hover { background-size: 100% 2px; }
.hero-excerpt { color: var(--muted); font-size: 18px; margin: 0 0 22px; max-width: 46ch; }
.byline {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  text-transform: uppercase;
  margin-bottom: 22px;
}
.byline b { color: var(--paper); font-weight: 400; }

/* ---------- Section heading ---------- */
.section { padding: clamp(40px, 6vw, 68px) 0 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
  margin-bottom: 30px;
}
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); }
.section-head .count {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  color: var(--muted-dim);
  letter-spacing: 0.1em;
}

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.4vw, 28px);
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; }
.card-media .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-media .cover { transform: scale(1.04); }
.card-tag {
  position: absolute;
  top: 12px; left: 12px;
  font-family: "Space Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(14, 18, 23, 0.85);
  color: var(--accent-2);
  padding: 5px 9px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 23px; line-height: 1.02; margin-bottom: 11px; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--muted); font-size: 14.5px; margin: 0 0 16px; flex: 1; }
.card-meta {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-dim);
  display: flex; gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.card-meta .dot { color: var(--accent); }

/* ---------- Article page ---------- */
.article { padding: clamp(30px, 5vw, 56px) 0 0; }
.article-head { max-width: 760px; margin: 0 auto; text-align: center; }
.article-head .eyebrow { margin-bottom: 18px; }
.article-title { font-size: clamp(32px, 5.2vw, 58px); margin-bottom: 22px; }
.article-deck { color: var(--muted); font-size: 19px; max-width: 56ch; margin: 0 auto 24px; }
.article-byline { justify-content: center; display: flex; gap: 18px; flex-wrap: wrap; }

.article-media {
  position: relative;
  aspect-ratio: 16 / 8;
  max-width: 980px;
  margin: 38px auto 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.article-media .cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.article-specs { max-width: 760px; margin: 34px auto 0; }

.prose { max-width: 720px; margin: 0 auto; padding: 14px 0 0; }
.prose p { margin: 0 0 22px; color: #D2D9E2; }
.prose h2 {
  font-family: "Saira Condensed", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  font-size: 27px;
  margin: 40px 0 16px;
  padding-top: 6px;
  color: var(--paper);
}
.prose h2::before {
  content: "";
  display: block;
  width: 34px; height: 3px;
  background: var(--accent);
  margin-bottom: 14px;
}
.prose blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent-2);
  font-family: "Saira Condensed", sans-serif;
  font-weight: 600;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: 0.005em;
  color: var(--paper);
}

.tags { max-width: 720px; margin: 38px auto 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 11px;
}

/* ---------- Page intro (category / archive) ---------- */
.page-intro { padding: clamp(36px, 6vw, 64px) 0 8px; border-bottom: 1px solid var(--line); }
.page-intro .eyebrow { margin-bottom: 14px; }
.page-intro h1 { font-size: clamp(38px, 7vw, 78px); margin-bottom: 14px; }
.page-intro p { color: var(--muted); max-width: 54ch; margin: 0; font-size: 18px; }

/* ---------- Footer ---------- */
.site-foot {
  margin-top: clamp(60px, 9vw, 110px);
  border-top: 1px solid var(--line-strong);
  background: var(--surface);
}
.foot-row { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding: 44px 0; }
.foot-brand { max-width: 320px; }
.foot-brand .brand-name { font-size: 22px; }
.foot-brand p { color: var(--muted-dim); font-size: 14px; margin: 14px 0 0; }
.foot-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.foot-col h4 {
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin: 0 0 14px;
}
.foot-col a { display: block; color: var(--muted); font-size: 14px; padding: 4px 0; }
.foot-col a:hover { color: var(--accent); }
.foot-base {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  font-family: "Space Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
    padding: 10px var(--gut) 18px;
    gap: 2px;
  }
  .nav.open a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-toggle {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 18px; height: 2px; background: var(--paper); position: relative;
  }
  .nav-toggle span::before { position: absolute; top: -6px; }
  .nav-toggle span::after { position: absolute; top: 6px; }
  .grid { grid-template-columns: 1fr; }
  .specs .cell { min-width: 50%; }
}

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 3px; }

/* ============================================================
   WordPress integration additions
   ============================================================ */
.cover { display: block; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  font-family: "Space Mono", monospace;
  font-size: 14px;
}
.prose figure.wp-block-table { margin: 26px 0; }
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 9px 13px;
  text-align: left;
}
.prose th { color: var(--muted-dim); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; width: 40%; }
.prose td { color: var(--accent-2); font-family: "Saira Condensed", sans-serif; font-weight: 700; font-size: 18px; }
.prose img { border-radius: 8px; margin: 24px 0; }
.prose a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { color: #D2D9E2; margin: 0 0 22px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.wp-caption-text, .prose figcaption { font-family: "Space Mono", monospace; font-size: 12px; color: var(--muted-dim); text-align: center; margin-top: 8px; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 50px 0 0; }
.pagination .page-numbers {
  font-family: "Space Mono", monospace; font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 9px 14px;
}
.pagination .page-numbers.current { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.pagination a.page-numbers:hover { color: var(--paper); border-color: var(--line-strong); }
.admin-bar .site-head { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-head { top: 46px; } }

/* ============================================================
   v2 — premium magazine polish
   ============================================================ */

/* utility bar above masthead */
.util-bar { border-bottom: 1px solid var(--line); background: rgba(0,0,0,0.25); }
.util-row {
  display: flex; justify-content: space-between; align-items: center;
  height: 34px;
  font-family: "Space Mono", monospace;
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted-dim);
}
.util-mid { color: var(--accent); opacity: 0.8; }
@media (max-width: 640px){ .util-mid { display: none; } }

/* editorial serif accents */
.hero-excerpt, .article-deck {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: #C3CCD7;
  letter-spacing: 0.005em;
}
.hero-excerpt { font-size: 21px; line-height: 1.45; }

/* hero kicker */
.kicker {
  font-family: "Space Mono", monospace;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 10px; margin: 0 0 16px;
}
.kicker-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.hero-title { letter-spacing: -0.01em; }

/* bigger, tighter display weight */
.display { font-weight: 800; }

/* drop cap on article body */
.prose > p:first-of-type::first-letter {
  font-family: "Saira Condensed", sans-serif;
  font-weight: 800;
  float: left;
  font-size: 76px;
  line-height: 0.7;
  padding: 8px 14px 0 0;
  color: var(--accent);
}

/* pull-quote as editorial serif */
.prose blockquote {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 27px;
  line-height: 1.28;
  border-left: 0;
  padding: 10px 0 10px 0;
  margin: 38px 0;
  position: relative;
  padding-left: 30px;
}
.prose blockquote::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: linear-gradient(var(--accent), var(--accent-2));
  border-radius: 2px;
}

/* card refinements */
.card { background: linear-gradient(180deg, var(--surface) 0%, #12171E 100%); }
.card-title { letter-spacing: -0.005em; }
.card-tag { backdrop-filter: blur(4px); }

/* section head: add a hairline rule that fills remaining space */
.section-head { position: relative; }
.section-head h2 { letter-spacing: -0.01em; }

/* hero spec strip a touch more prominent */
.hero .specs { margin-top: 6px; }

/* refined focus + selection */
::selection { background: var(--accent); color: #0E1217; }

/* article deck size */
.article-deck { font-size: 22px; line-height: 1.4; }

/* make hero slightly larger on wide screens */
@media (min-width: 1100px){
  .hero-title { font-size: clamp(44px, 5.2vw, 66px); }
}
