/*
Theme Name: PLR Automotive
Theme URI: https://www.plrautomotive.com
Author: PLR Automotive
Description: Premium automotive specifications theme — vehicle specs, reviews, comparisons, buying & maintenance guides. Requires the ACF plugin; import acf-field-groups.json via ACF > Tools.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: plr-automotive
*/

:root {
  --bg: #F8FAFC; --bg-alt: #EEF2F9; --surface: #FFFFFF; --surface-alt: #F1F5F9;
  --text: #111827; --text-muted: #5B6472; --border: rgba(15,23,42,0.08);
  --primary: #2563EB; --primary-deep: #1D4ED8; --accent: #10B981; --accent-deep: #059669;
  --secondary: #0F172A; --nav-bg: rgba(248,250,252,0.78);
  --shadow-soft: rgba(15,23,42,0.08); --shadow-strong: rgba(15,23,42,0.16);
  --primary-shadow: rgba(37,99,235,0.28);
  --font-display: 'Sora', sans-serif; --font-body: 'Inter', sans-serif;
}
[data-theme="dark"] {
  --bg: #0B1220; --bg-alt: #0F1B30; --surface: #111C31; --surface-alt: #16223B;
  --text: #F1F5F9; --text-muted: #94A3B8; --border: rgba(255,255,255,0.08);
  --primary: #3B82F6; --primary-deep: #2563EB; --secondary: #070C16;
  --nav-bg: rgba(11,18,32,0.72);
  --shadow-soft: rgba(0,0,0,0.35); --shadow-strong: rgba(0,0,0,0.55);
  --primary-shadow: rgba(59,130,246,0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--text); transition: background .35s ease, color .35s ease; overflow-x: hidden; }
::selection { background: var(--primary); color: #fff; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }
h1,h2,h3,h4 { font-family: var(--font-display); letter-spacing: -0.02em; color: var(--text); }
h2 { font-size: 26px; font-weight: 700; }
img { max-width: 100%; height: auto; }
input, textarea, button { font-family: var(--font-body); }

.container { max-width: 1360px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 860px; }

/* ============ Header ============ */
.site-header { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: var(--nav-bg); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--text) !important; flex-shrink: 0; }
.site-logo img, .site-logo .custom-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }

.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.main-nav a:hover { background: var(--surface-alt); color: var(--text); }
.main-nav li { position: relative; }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 24px 48px var(--shadow-strong); padding: 14px; min-width: 240px; animation: plrFadeUp .18s ease; z-index: 50; }
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { border-radius: 8px; font-size: 13.5px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn-primary { display: inline-block; padding: 10px 20px; border-radius: 10px; background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: #fff !important; font-size: 14px; font-weight: 700; box-shadow: 0 8px 20px var(--primary-shadow); white-space: nowrap; border: none; cursor: pointer; }
.btn-accent { display: inline-block; padding: 12px 22px; border-radius: 11px; background: var(--accent); color: var(--secondary) !important; font-weight: 700; font-size: 14px; }
.theme-toggle { width: 38px; height: 38px; border-radius: 10px; border: none; background: var(--surface-alt); cursor: pointer; font-size: 15px; color: var(--text); }

/* ============ Hero ============ */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 40px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 100px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--primary); margin-bottom: 22px; }
.hero-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 { font-size: 56px; line-height: 1.06; font-weight: 800; margin: 0 0 20px; }
.hero h1 .grad { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 17px; line-height: 1.6; color: var(--text-muted); max-width: 480px; margin: 0 0 32px; }
.hero-visual { position: relative; }
.hero-visual::before { content: ''; position: absolute; inset: -40px; background: radial-gradient(circle at 60% 40%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 70%); }
.hero-visual .frame { position: relative; aspect-ratio: 4/3; border-radius: 28px; border: 1px solid var(--border); box-shadow: 0 30px 60px var(--shadow-strong); overflow: hidden; animation: plrFloat 6s ease-in-out infinite; background: var(--surface-alt); }
.hero-visual .frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-stats { display: flex; gap: 36px; margin-top: 44px; }
.hero-stats .num { font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.hero-stats .lbl { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Search bar */
.search-bar, .search-form { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: 0 12px 32px var(--shadow-soft); max-width: 520px; }
.search-bar input, .search-form input[type="search"] { border: none; outline: none; background: transparent; flex: 1; font-size: 14.5px; color: var(--text); padding: 0 10px; min-width: 0; }
.search-form .btn-primary { padding: 11px 22px; border-radius: 11px; }

/* ============ Section headers ============ */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head .more { font-size: 14px; font-weight: 600; }

/* ============ Cards ============ */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); gap: 16px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); gap: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; display: block; color: var(--text) !important; }
a.card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px var(--shadow-soft); }
.card .thumb { aspect-ratio: 16/10; background: repeating-linear-gradient(120deg, var(--surface-alt), var(--surface-alt) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px); position: relative; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.card .tag { position: absolute; top: 12px; left: 12px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 100px; z-index: 2; }
.card-body { padding: 16px; }
.card-meta { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.card-specs { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 10px; }

.brand-card { text-align: center; padding: 20px 12px; }
.brand-card .logo-box { width: 48px; height: 48px; border-radius: 12px; background: var(--bg-alt); margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text-muted); overflow: hidden; }
.brand-card .logo-box img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand-card .name { font-size: 13px; font-weight: 600; }

/* ============ Spec tables ============ */
.spec-table { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 32px; }
.spec-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
.spec-row:last-child { border-bottom: none; }
.spec-row .label { color: var(--text-muted); }
.spec-row .value { font-weight: 600; text-align: right; }

/* Quick specs */
.quick-specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.quick-specs .qs { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.quick-specs .qs .l { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.quick-specs .qs .v { font-size: 15px; font-weight: 700; }

/* Sidebar */
.vehicle-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 16px; }
.sidebar-sticky { position: sticky; top: 96px; }

/* ============ Comparison ============ */
.compare-table { display: grid; grid-template-columns: 220px repeat(var(--cols, 3), 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.compare-table > div { padding: 15px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; display: flex; align-items: center; justify-content: center; text-align: center; border-left: 1px solid var(--border); }
.compare-table .row-label { justify-content: flex-start; text-align: left; font-weight: 700; color: var(--text-muted); border-left: none; }
.compare-table .head { flex-direction: column; gap: 8px; font-weight: 700; }
.compare-table .head img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }

.verdict-card { background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 8%, var(--surface)), color-mix(in srgb, var(--accent) 8%, var(--surface))); border: 1px solid var(--border); border-radius: 18px; padding: 28px; }

/* ============ Dark band sections (EV spotlight) ============ */
.band-dark { background: var(--secondary); position: relative; overflow: hidden; padding: 64px 0; }
.band-dark::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%); }
.band-dark .container { position: relative; }
.band-dark h2 { color: #fff; font-size: 30px; font-weight: 800; }
.band-dark p { color: #CBD5E1; }
.band-pill { display: inline-flex; padding: 6px 14px; border-radius: 100px; background: rgba(255,255,255,.08); font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 16px; letter-spacing: .04em; }

/* ============ Newsletter CTA ============ */
.newsletter { background: linear-gradient(135deg, var(--primary), var(--accent-deep)); border-radius: 24px; padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.newsletter h3 { color: #fff; font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.newsletter p { color: #EFF6FF; font-size: 14.5px; margin: 0; }
.newsletter form { display: flex; gap: 10px; background: #fff; border-radius: 12px; padding: 6px; }
.newsletter input { border: none; outline: none; padding: 10px 14px; font-size: 14px; width: 220px; }
.newsletter button { padding: 10px 20px; border-radius: 8px; background: var(--secondary); color: #fff; font-size: 14px; font-weight: 700; border: none; cursor: pointer; }

/* ============ Ads ============ */
.ad-slot { background: var(--bg-alt); border: 1px dashed var(--border); border-radius: 14px; display: flex; align-items: center; justify-content: center; min-height: 90px; color: var(--text-muted); font-size: 11.5px; font-family: monospace; margin: 24px 0; }

/* ============ Pills / badges ============ */
.pill { display: inline-flex; padding: 4px 12px; border-radius: 100px; background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); font-size: 11.5px; font-weight: 700; }

/* ============ Footer ============ */
.site-footer { background: var(--secondary); color: #94A3B8; padding: 56px 0 28px; margin-top: 40px; }
.site-footer .site-logo, .site-footer .site-logo span { color: #fff !important; font-size: 16px; }
.site-footer h4, .site-footer .menu > li > a:first-child { color: #fff; font-size: 13px; font-weight: 700; margin: 0 0 14px; font-family: var(--font-body); }
.site-footer a { color: #94A3B8; font-size: 13px; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li a { display: block; padding: 6px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 12.5px; color: #64748B; flex-wrap: wrap; gap: 12px; }
.footer-bottom a { color: #64748B; display: inline; padding-right: 16px; font-size: 12.5px; }

/* ============ Animations ============ */
@keyframes plrFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes plrFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.fade-up { animation: plrFadeUp .6s ease both; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 42px; }
  .grid-4, .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .vehicle-layout { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .hero h1 { font-size: 34px; }
  .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .quick-specs { grid-template-columns: repeat(2, 1fr); }
  .compare-table { grid-template-columns: 120px repeat(var(--cols, 3), 1fr); font-size: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .newsletter { padding: 28px; }
}
