/* ==========================================================================
   VIN Atlas: light automotive reference style.
   System fonts only (no external requests). Bahnschrift/DIN-style headings
   where the OS provides them. The stamped "VIN plate" is the signature piece.
   ========================================================================== */
:root {
  --paper: #f2f4f6;
  --surface: #ffffff;
  --ink: #18212b;
  --steel: #566270;
  --line: #d7dce1;
  --plate: #e4e7eb;
  --plate-edge: #b3bbc4;
  --green: #0e5b45;
  --green-dark: #0a4333;
  --signal: #f2c230;
  --font-head: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --maxw: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 var(--font-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-underline-offset: 2px; }
a:hover { color: var(--green-dark); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1rem; }
.muted { color: var(--steel); }
.small { font-size: .875rem; }
.mono, .vin, .vin-inline { font-family: var(--font-mono); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }
.narrow { max-width: 760px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* Header ------------------------------------------------------------------ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 1.2rem; min-height: 64px; flex-wrap: wrap; padding-top: .5rem; padding-bottom: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.main-nav { display: flex; gap: 1.1rem; margin-left: .5rem; }
.main-nav a { color: var(--ink); text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--green); }
.header-search { margin-left: auto; display: flex; gap: .4rem; }
.header-search input { font: .9rem var(--font-mono); padding: .45rem .7rem; border: 1px solid var(--plate-edge); border-radius: 6px; width: 15rem; max-width: 100%; text-transform: uppercase; letter-spacing: .06em; }
.header-search input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font-body); }
.header-search button, .filters button, .btn { font: 600 .9rem var(--font-body); background: var(--green); color: #fff; border: 0; border-radius: 6px; padding: .5rem 1rem; cursor: pointer; }
.header-search button:hover, .filters button:hover, .btn:hover { background: var(--green-dark); }
@media (max-width: 700px) {
  .main-nav { margin-left: auto; }
  .header-search { margin-left: 0; width: 100%; }
  .header-search input { flex: 1; width: auto; }
}

/* Hero + VIN plate ------------------------------------------------------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 3rem 0 2.4rem; }
.hero-compact { padding: 2rem 0 1.8rem; }
.hero .lead { color: var(--steel); font-size: 1.1rem; max-width: 40rem; }
.lead { font-size: 1.05rem; color: var(--steel); max-width: 44rem; }
.hint { color: var(--steel); font-size: .875rem; margin: .8rem 0 0; }
.vin-plate { position: relative; display: flex; align-items: center; gap: .8rem; max-width: 760px; background: var(--plate); border: 2px solid var(--plate-edge); border-radius: 10px; padding: .7rem .7rem .7rem 2.1rem; box-shadow: inset 0 1px 0 #fff; margin-top: 1.4rem; }
.vin-plate::before { content: ""; position: absolute; left: 12px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--plate-edge); box-shadow: inset 0 1px 1px rgba(0,0,0,.3); }
.vin-plate:focus-within { outline: 3px solid var(--green); outline-offset: 2px; }
.vin-plate input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font: 600 clamp(1rem, 2.8vw, 1.45rem) var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); padding: .5rem 0; }
.vin-plate input::placeholder { font: 400 1rem var(--font-body); letter-spacing: 0; text-transform: none; color: var(--steel); }
.vin-plate button { font: 700 1rem var(--font-body); background: var(--green); color: #fff; border: 0; border-radius: 6px; padding: .85rem 1.5rem; cursor: pointer; white-space: nowrap; }
.vin-plate button:hover { background: var(--green-dark); }
@media (max-width: 560px) {
  .vin-plate { flex-wrap: wrap; padding: .7rem .7rem .7rem 1.9rem; }
  .vin-plate input { flex-basis: 100%; }
  .vin-plate button { width: 100%; }
}

/* Sections ---------------------------------------------------------------- */
.section { padding: 2.4rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); }
.section-tight { margin-top: 2.4rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.steps { padding-left: 1.3rem; }
.steps li { margin-bottom: .7rem; }
.empty { background: var(--surface); border: 1px dashed var(--plate-edge); border-radius: 8px; padding: 1.2rem; color: var(--steel); }
.page-top { padding-top: 1.4rem; padding-bottom: 3rem; }
.prose h2 { margin-top: 1.8rem; }

/* Vehicle cards ----------------------------------------------------------- */
.vgrid { display: grid; gap: 1rem; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1020px) { .vgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .vgrid { grid-template-columns: repeat(2, 1fr); gap: .7rem; } }
@media (max-width: 420px) { .vgrid { grid-template-columns: 1fr; } }
.vcard { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.vcard:hover, .vcard:focus-within { border-color: var(--green); }
.vcard a { display: block; color: inherit; text-decoration: none; }
.vcard-media { aspect-ratio: 4 / 3; background: #dfe3e7; }
.vcard-media img { width: 100%; height: 100%; object-fit: cover; }
.no-photo { height: 100%; display: grid; place-content: center; justify-items: center; gap: .3rem; color: var(--steel); font-size: .85rem; }
.vcard-body { padding: .75rem .9rem .9rem; }
.vcard h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.vcard .vin { margin: 0 0 .2rem; font-size: .8rem; color: var(--steel); word-break: break-all; letter-spacing: .02em; }
.vcard p { margin: 0; }

/* Breadcrumb, filters, pagination ---------------------------------------- */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1rem; font-size: .875rem; color: var(--steel); }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: var(--plate-edge); }
.breadcrumb a { color: var(--steel); }
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: end; margin: 1.2rem 0 1.4rem; }
.filters label { display: grid; gap: .2rem; font-size: .85rem; color: var(--steel); }
.filters select { font: 1rem var(--font-body); padding: .45rem .6rem; border: 1px solid var(--plate-edge); border-radius: 6px; background: #fff; min-width: 10rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; align-items: center; }
.pagination a, .pagination .current, .pagination .gap { padding: .4rem .8rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; min-width: 2.4rem; text-align: center; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .gap { border: 0; background: none; }

/* Vehicle detail ----------------------------------------------------------- */
.vehicle h1 { margin-bottom: .9rem; }
.vin-inline { font-size: .92em; letter-spacing: .04em; word-break: break-all; }
.vin-tag { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .8rem; background: var(--plate); border: 2px solid var(--plate-edge); border-radius: 10px; padding: .55rem .7rem .55rem 1.9rem; position: relative; box-shadow: inset 0 1px 0 #fff; margin-bottom: 1.5rem; max-width: 100%; }
.vin-tag::before { content: ""; position: absolute; left: 11px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--plate-edge); box-shadow: inset 0 1px 1px rgba(0,0,0,.3); }
.vin-label { font: 600 .8rem var(--font-head); color: var(--steel); }
.vin-value { font: 700 clamp(1.05rem, 3.6vw, 1.6rem) var(--font-mono); letter-spacing: .1em; word-break: break-all; }
.copy-btn { font: 600 .85rem var(--font-body); background: var(--surface); border: 1px solid var(--plate-edge); border-radius: 6px; padding: .4rem .8rem; cursor: pointer; color: var(--ink); }
.copy-btn:hover { border-color: var(--green); }
.copy-btn.is-done { background: var(--green); color: #fff; border-color: var(--green); }
.vehicle-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.8rem; align-items: start; }
@media (max-width: 900px) { .vehicle-layout { grid-template-columns: 1fr; } }
.gallery-main { display: block; aspect-ratio: 4 / 3; background: #dfe3e7; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; padding: 0; margin: .6rem 0 0; }
.gallery-thumbs a { display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: #dfe3e7; }
.gallery-thumbs a.active { border-color: var(--green); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #dfe3e7; color: var(--steel); border-radius: 8px; text-align: center; padding: 1rem; }
.specs-col { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 1.2rem 1.3rem; }
.specs-col h3 { margin: 1.1rem 0 .2rem; color: var(--steel); font-size: .95rem; }
.specs { margin: 0; }
.specs > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.specs dt { color: var(--steel); }
.specs dd { margin: 0; text-align: right; font-weight: 600; word-break: break-word; }
.specs dd.mono { font-size: .92rem; letter-spacing: .03em; }
.text-block { margin-top: 2rem; max-width: 760px; }
.disclaimer { margin-top: 2rem; font-size: .85rem; color: var(--steel); max-width: 760px; }
.search-again { margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.preview-banner { background: var(--signal); color: #3a2c00; padding: .6rem 1rem; text-align: center; font-weight: 600; }

/* Lightbox ---------------------------------------------------------------- */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 14, 18, .92); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; text-align: center; color: #fff; }
.lightbox img { max-width: 92vw; max-height: 84vh; width: auto; height: auto; margin: 0 auto; border-radius: 4px; }
.lightbox figcaption { margin-top: .6rem; font-size: .9rem; }
.lb-close, .lb-nav { position: fixed; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 50%; width: 3rem; height: 3rem; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 1rem; right: 1rem; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 1rem; } .lb-next { right: 1rem; }
.lightbox.single .lb-nav { display: none; }

/* Forms / notices ---------------------------------------------------------- */
.notice { background: var(--surface); border-left: 5px solid var(--plate-edge); border-radius: 6px; padding: .9rem 1.1rem; max-width: 760px; }
.notice-warn { border-left-color: var(--signal); }
.flash { background: #e3f2ea; border: 1px solid #b8dcc8; padding: .7rem 1rem; border-radius: 6px; margin: 1rem 0 0; }
.form .field { margin-bottom: 1rem; display: grid; gap: .25rem; }
.form input[type=text], .form input[type=email], .form textarea { font: 1rem var(--font-body); padding: .6rem .7rem; border: 1px solid var(--plate-edge); border-radius: 6px; width: 100%; }
.form .error, .errorlist { color: #a12622; font-size: .9rem; margin: 0; padding: 0; list-style: none; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

/* Footer ------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #c9d1d9; margin-top: 3rem; padding: 2.2rem 0 1.2rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font: 700 1.2rem var(--font-head); color: #fff; margin: 0 0 .4rem; }
.site-footer .muted { color: #a3adb8; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.footer-base { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #2c3743; color: #a3adb8; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
