/* =========================================================================
   AutoSpecs — mobile-first responsive stylesheet (no framework), light theme
   ========================================================================= */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f6f9;
    --border: #e2e6ec;
    --text: #1a1d24;
    --muted: #5b6472;
    --primary: #2563eb;
    --primary-600: #1d4ed8;
    --accent: #d97706;
    --radius: 12px;
    --maxw: 1160px;
    --shadow: 0 4px 18px rgba(20, 30, 60, .06);
    --shadow-hover: 0 10px 28px rgba(20, 30, 60, .10);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: #0f1420; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); }
h3 { font-size: 1.15rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.main-content { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.section { margin: 40px 0; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { display: block; width: 100%; margin-top: 14px; }

/* ---- Header / nav ----------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { font-size: 1.35rem; font-weight: 800; letter-spacing: -.5px; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--text); }
.brand-mark-alt { color: var(--primary); }

.site-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.site-nav > a { color: var(--text); font-weight: 600; }
.site-nav > a:hover { color: var(--primary); text-decoration: none; }
.nav-search { display: flex; }
.nav-search input {
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); padding: 8px 12px; border-radius: 10px 0 0 10px; width: 180px;
}
.nav-search button {
    background: var(--primary); color: #fff; border: none;
    padding: 0 14px; border-radius: 0 10px 10px 0; cursor: pointer;
}

.nav-toggle {
    display: none; margin-left: auto; background: none; border: 0;
    width: 42px; height: 42px; cursor: pointer; flex-direction: column;
    justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; }

/* ---- Hero ------------------------------------------------------------- */
.hero {
    text-align: center; padding: 56px 16px 44px;
    background: radial-gradient(1200px 420px at 50% -20%, rgba(37,99,235,.10), transparent 70%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 640px; margin: 0 auto 24px; }
.hero-search { display: flex; gap: 8px; max-width: 560px; margin: 0 auto; }
.hero-search input {
    flex: 1; background: #fff; border: 1px solid var(--border);
    color: var(--text); padding: 14px 16px; border-radius: 10px; font-size: 1rem;
    box-shadow: var(--shadow);
}
.hero-links { margin-top: 16px; color: var(--muted); }

/* ---- Grids ------------------------------------------------------------ */
.brand-grid, .car-grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.brand-grid { grid-template-columns: repeat(2, 1fr); }
.car-grid { grid-template-columns: repeat(1, 1fr); }

.brand-card {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px; color: var(--text);
    box-shadow: var(--shadow);
}
.brand-card:hover { border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow-hover); }
.brand-card-name { font-weight: 700; }
.brand-card-count { color: var(--muted); font-size: .85rem; }

.car-card {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden; color: var(--text);
    box-shadow: var(--shadow);
    transition: transform .12s ease, border-color .12s ease, box-shadow .15s ease;
}
.car-card:hover { transform: translateY(-3px); border-color: var(--primary); text-decoration: none; box-shadow: var(--shadow-hover); }
.car-card-media { aspect-ratio: 16 / 10; background: var(--surface-2); }
.car-card-media img { width: 100%; height: 100%; object-fit: cover; }
.car-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.car-card-brand { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; }
.car-card-title { font-weight: 700; }
.car-card-class { color: var(--muted); font-size: .85rem; }

/* ---- Breadcrumbs ------------------------------------------------------ */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; font-size: .9rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border); }

.page-head { margin-bottom: 18px; }

/* ---- Car detail ------------------------------------------------------- */
.car-detail-head .eyebrow { text-transform: uppercase; letter-spacing: .5px; font-size: .8rem; margin: 0 0 4px; }
.car-layout { display: grid; grid-template-columns: 1fr; gap: 24px; margin: 20px 0; align-items: start; }
.car-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.car-figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.car-figure img { width: 100%; height: auto; object-fit: cover; background: var(--surface-2); }
.car-figure figcaption { padding: 10px 14px; color: var(--muted); font-size: .9rem; }

/* Specs card sits directly beneath the image */
.car-specs { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.car-specs h2 { font-size: 1.2rem; margin-bottom: 12px; }
.specs-empty { margin: 0; }

.car-aside { min-width: 0; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: sticky; top: 78px; }
.info-card h2 { font-size: 1.1rem; margin-bottom: 10px; }
.info-card .btn-block { margin-top: 10px; }

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table th, .specs-table td { text-align: left; vertical-align: top; padding: 9px 8px; border-bottom: 1px solid var(--border); font-size: .93rem; }
.specs-table th { width: 38%; color: var(--muted); font-weight: 600; }
.specs-table tr:last-child th, .specs-table tr:last-child td { border-bottom: 0; }

/* ---- Comments --------------------------------------------------------- */
.car-comments { margin-top: 36px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 14px; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.comment-author { font-weight: 700; }
.comment-badge { background: var(--surface-2); color: var(--muted); font-size: .75rem; padding: 2px 8px; border-radius: 999px; }
.comment-date { color: var(--muted); font-size: .8rem; margin-left: auto; }
.comment-body { margin: 0; }

.comment-form-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; max-width: 640px; box-shadow: var(--shadow); }
.comment-form .form-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.comment-form label { font-weight: 600; font-size: .9rem; }
.comment-form label small { color: var(--muted); font-weight: 400; }
.comment-form .req { color: var(--accent); }
.comment-form input, .comment-form textarea {
    background: #fff; border: 1px solid var(--border); color: var(--text);
    padding: 11px 12px; border-radius: 10px; font: inherit; width: 100%;
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid rgba(37,99,235,.35); border-color: var(--primary); }
.comment-form textarea { resize: vertical; }
.captcha-row { background: var(--surface-2); padding: 12px; border-radius: 10px; }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.alert p { margin: 2px 0; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ---- Ratings / reviews ------------------------------------------------ */
.rating-summary { margin: 0 0 16px; color: #333a46; }
.rating-summary .stars { color: #f5a623; letter-spacing: 2px; margin-right: 6px; font-size: 1.05rem; }
.comment-head .stars { color: #f5a623; letter-spacing: 1px; font-size: .9rem; }

/* Interactive CSS-only star picker (radios rendered 5..1 in DOM order). */
.star-input { display: inline-block; }
.star-input::after { content: ''; display: block; clear: both; }
.star-input input { position: absolute; left: -9999px; }
.star-input label {
    float: right; font-size: 1.7rem; line-height: 1; color: #cbd2dc;
    cursor: pointer; padding: 0 2px; transition: color .12s;
}
.star-input label:hover,
.star-input label:hover ~ label,
.star-input input:checked ~ label { color: #f5a623; }
.star-input input:focus-visible + label { outline: 2px solid rgba(37,99,235,.4); border-radius: 4px; }

/* ---- Compare ---------------------------------------------------------- */
.compare-pickers { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 16px 0; }
.compare-picker { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.compare-picker h2 { font-size: 1.1rem; }
.compare-picker label { display: block; margin-top: 10px; font-weight: 600; font-size: .9rem; }
.compare-picker select {
    width: 100%; margin-top: 6px; background: #fff; color: var(--text);
    border: 1px solid var(--border); padding: 10px 12px; border-radius: 10px; font: inherit;
}
.compare-actions { text-align: center; margin: 8px 0 4px; }
.compare-empty { text-align: center; padding: 28px; }

.compare-table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.compare-table th, .compare-table td { padding: 12px; border: 1px solid var(--border); vertical-align: top; text-align: left; font-size: .92rem; }
.compare-table thead th { background: var(--surface-2); text-align: center; }
.compare-table thead img { margin: 0 auto 8px; border-radius: 8px; object-fit: cover; }
.compare-table tbody th { width: 20%; color: var(--muted); background: var(--surface-2); }
.compare-table tr.diff td { background: #fffbeb; }

/* ---- Brand SEO article (brand pages only) ----------------------------- */
.brand-article {
    margin: 44px 0 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 40px);
    box-shadow: var(--shadow);
}
.brand-article h2 { margin-top: 1.6em; scroll-margin-top: 80px; }
.brand-article h2:first-of-type { margin-top: .2em; }
.brand-article p { margin: 0 0 1em; max-width: 72ch; }
.brand-article .lead { font-size: 1.08rem; color: #333a46; }

.brand-facts {
    list-style: none; padding: 0; margin: 0 0 8px;
    display: grid; grid-template-columns: 1fr; gap: 10px;
}
.brand-facts li {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
}
.brand-facts strong { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 2px; }

.toc {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 18px; margin: 8px 0 28px;
}
.toc h2 { margin: 0 0 8px; font-size: 1.05rem; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin: 4px 0; }

/* Static / legal pages */
.static-page { max-width: 820px; margin: 0 auto; }
.static-page section { margin-bottom: 26px; }
.static-page h2 { margin: 0 0 10px; font-size: 1.35rem; }
.static-page p { margin: 0 0 12px; color: #333a46; line-height: 1.7; }
.static-page ul, .static-page ol { margin: 0 0 12px; padding-left: 22px; color: #333a46; line-height: 1.7; }
.static-page li { margin: 6px 0; }
.static-page a { color: var(--primary); }
.legal-page .toc ol { columns: 1; }
.contact-form-wrap { margin-top: 8px; }
.contact-form-wrap .comment-form { max-width: 100%; }

.brand-keywords { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.brand-keywords li { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: .82rem; padding: 4px 10px; border-radius: 999px; }

.faq-item { border-top: 1px solid var(--border); padding: 14px 0; }
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item h3 { margin: 0 0 6px; font-size: 1.05rem; }
.faq-item p { margin: 0; color: #333a46; }

.lineup-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 0 0 1em; }
.lineup-links a { background: var(--surface-2); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; font-size: .9rem; }

/* ---- Error page ------------------------------------------------------- */
.error-page { text-align: center; padding: 60px 16px; }

/* ---- Footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 30px 16px; }
.footer-col p { color: var(--muted); margin: 8px 0 0; font-size: .9rem; }
.footer-col a { display: inline-block; color: var(--text); margin-right: 14px; }
.footer-col a:hover { color: var(--primary); }

/* =========================================================================
   Responsive breakpoints
   ========================================================================= */
@media (min-width: 560px) {
    .brand-grid { grid-template-columns: repeat(3, 1fr); }
    .car-grid { grid-template-columns: repeat(2, 1fr); }
    .brand-facts { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .car-layout { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); }
    .car-grid { grid-template-columns: repeat(3, 1fr); }
    .compare-pickers { grid-template-columns: 1fr 1fr; }
    .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
    .brand-facts { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1000px) {
    .brand-grid { grid-template-columns: repeat(5, 1fr); }
    .car-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile nav */
@media (max-width: 760px) {
    .nav-toggle { display: flex; }
    .site-nav {
        position: absolute; top: 62px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 12px;
        background: var(--surface); border-bottom: 1px solid var(--border);
        padding: 16px; margin: 0; display: none;
    }
    .site-nav.is-open { display: flex; }
    .nav-search { width: 100%; }
    .nav-search input { flex: 1; width: auto; }
    .toc ol { columns: 1; }
}
