/* ==========================================================================
   Route 9 Motors — design tokens
   Palette: automotive-industrial. Near-black graphite body, ignition-amber
   accent (dashboard warning-light / headlight tone), muted steel-blue for
   secondary trust signals. Oswald (condensed, road-sign character) carries
   headlines; Inter carries body copy so long spec text stays readable.
   ========================================================================== */

:root {
    /* Color */
    --bg:            #14161a;
    --surface:       #1d2026;
    --surface-raised:#242830;
    --border:        #2d323b;
    --text:          #eef0f2;
    --text-muted:    #9aa0aa;
    --text-faint:    #6b717c;
    --accent:        #f00000;
    --accent-dark:   #b80000;
    --accent-ink:    #ffffff;
    --accent-glow:   rgba(240,0,0,0.12);
    --steel:         #6fa0bd;
    --available:     #5fa777;
    --sold:          #8a8f98;

    /* Type */
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Layout */
    --max-width: 1160px;
    --radius-sm: 3px;
    --radius-md: 6px;
    --nav-height: 72px;
    /* One height for every form control and button so they line up everywhere. */
    --control-height: 46px;
    --control-height-sm: 36px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
    letter-spacing: 0.2px;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; max-width: 62ch; }

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

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

ul, ol { padding-left: 1.2em; }

/* Visible keyboard focus everywhere */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 72px 0;
}
.section--tight { padding: 48px 0; }
.section--surface { background: var(--surface); }

.eyebrow {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.3px;
    min-height: var(--control-height);
    padding: 0 26px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.btn--sm {
    min-height: var(--control-height-sm);
    padding: 0 16px;
    font-size: 0.85rem;
}
.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-dark); }
.btn--outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }
.btn--block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 5px 13px;
    border-radius: var(--radius-sm);
    /* Solid fills with dark text so status stays legible over any car photo. */
    color: #14181d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    white-space: nowrap; /* keep "Coming Soon" on one line */
    flex-shrink: 0;       /* don't get squeezed next to a long title */
}
.badge--available   { background: var(--available); }
.badge--pending     { background: #e8a33d; }
.badge--coming_soon { background: var(--steel); }
.badge--sold        { background: var(--sold); }

/* Forms (shared by contact / sell-your-car / admin) */
label {
    display: block;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
input, select, textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 11px 13px;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    outline: none;
}
/* Single-line controls share the button height (see --control-height). */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not(.visually-hidden),
select {
    height: var(--control-height);
    padding-top: 0;
    padding-bottom: 0;
}
select.control--sm,
input.control--sm {
    height: var(--control-height-sm);
    padding: 0 8px;
    font-size: 0.85rem;
    width: auto;
}
textarea { resize: vertical; min-height: 120px; }
.field { margin-bottom: 18px; }
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .field-row { grid-template-columns: 1fr; }
}

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.alert--success { background: rgba(95,167,119,0.12); border: 1px solid rgba(95,167,119,0.4); color: var(--available); }
.alert--error   { background: rgba(214,95,95,0.12); border: 1px solid rgba(214,95,95,0.4); color: #e08787; }
.alert--info    { background: rgba(111,160,189,0.12); border: 1px solid rgba(111,160,189,0.4); color: var(--steel); }

/* Pagination — shared by the public inventory and the admin listings (both load base.css). */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--control-height-sm);
    height: var(--control-height-sm);
    padding: 0 12px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none !important;
}
a.pagination-link:hover { border-color: var(--accent); color: var(--accent); }
.pagination-link.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pagination-link.is-disabled { opacity: 0.4; }
.pagination-gap { color: var(--text-faint); padding: 0 2px; }

/* No-photo placeholder: brand/favicon image centered on the striped backdrop.
   Shared by public cards and admin thumbnails (both load base.css). */
.no-photo--brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(135deg, #1a1c21, #1a1c21 12px, #1d2026 12px, #1d2026 24px);
}
.no-photo--brand img {
    width: 62%;
    height: 62%;
    object-fit: contain;
    opacity: 0.9;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
