/* cl-site.css: dinancars.com's tokens, fonts, reset and chrome (header, menu, search suggestions, footer, the primary
   button), on every page, in Dinan's look: a black header and footer, white pages, their red, Oswald headings over
   Open Sans text, square boxes. Text is full contrast: near black on white, white on black.
   The cascade (the kit's static/parts/tokens.css): `@layer base, kit, site;` sets the order; the tokens sit on
   :root outside any layer, the reset in @layer base, every other rule in @layer site. The kit's shop pages and
   vehicle band take the brand colour and font from the --parts-* tokens alone: no rule here names a kit class.
   From 980px the desktop layout (measured at 1440); below it Dinan's phone layout (stage 390). */
@layer base, kit, site;

/* Oswald and Open Sans (SIL Open Font License, Google Fonts' latin subsets, static/fonts/FONTS.md) */
@font-face { font-family: "Oswald"; src: url("fonts/oswald-latin.woff2") format("woff2"); font-weight: 200 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/opensans-latin.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("fonts/opensans-italic-latin.woff2") format("woff2"); font-weight: 300 800; font-style: italic; font-display: swap; }

:root {
  /* colours: Dinan's white, black and red; their grey text (#444, #989898) taken to near black for contrast */
  --site-bg: #FFFFFF;
  --site-fg: #111111;
  --site-muted: #222222;
  --site-line: #DDDDDD;
  --site-band: #F4F4F4;
  --site-card: #F8F8F8;
  --site-accent: #E1251B;
  --site-accent-fg: #FFFFFF;
  --site-field-bg: #FFFFFF;
  --site-button-bg: #E1251B;
  --site-button-fg: #FFFFFF;
  --site-button-hover-bg: #000000;
  --site-button-hover-fg: #FFFFFF;
  --site-disabled-bg: #DDDDDD;
  --site-disabled-fg: #222222;
  --site-dark: #000000;
  --site-shadow: 0 0 4px 0.5px rgba(0, 0, 0, 0.15);
  --site-chrome-fg: #FFFFFF;      /* text and icons on the black header and footer, both themes */
  --site-dark-line: #E7E7E7;    /* the rule under the header's bar */
  --site-ink-line: #333333;     /* the rules of the phone menu, on black */
  --site-field-line: #000000;   /* the header search box's edge */
  --site-field-ink: #000000;    /* its magnifier */
  --site-placeholder: #333333;  /* its hint */
  --site-plate: #FFFFFF;        /* under a photo or a part's picture: white in both themes, since they are drawn for white */
  --site-fit: #0B6B2B;          /* a suggestion's "fits" line */
  --site-link-red: var(--site-accent);  /* red words on the page (the suggestions' see-all) */
  --site-panel: #FFFFFF;        /* the home's part cards */

  /* fonts */
  --site-font-body: "Open Sans", Verdana, Geneva, sans-serif;
  --site-font-heading: "Oswald", "Arial Narrow", Verdana, sans-serif;
  --site-font-button: var(--site-font-heading);

  /* shape and layout */
  --site-radius: 0;
  --site-max: 1312px;
}
/* the kit's shop pages and vehicle band: only the brand tokens a site owns (storefront-kit ADR 0007) */
:root {
  --parts-accent: var(--site-accent);
  --parts-accent-strong: #B81C14;
  --parts-font: var(--site-font-body);
}

/* the dark theme (the kit's data-parts-theme="dark", by the visitor's clock or their pick): the page in the kit's warm
   near black, text near white, rules dark grey, cards and fields a step up; the black header, the footer and its red
   band stay as they are, their red stays on buttons and lifts for words, photos keep white plates, and a shadowed box
   is ringed in the dark grey since a black shadow vanishes on the dark page.
   The vehicle band takes the kit's dark band, since this site leaves the band's tokens to the kit. */
:root[data-parts-theme="dark"] {
  color-scheme: dark;
  --site-bg: #121110;
  --site-fg: #F6F3EF;
  --site-muted: #EBE6E0;
  --site-line: #3D3833;
  --site-band: #1C1A18;
  --site-card: #1C1A18;
  --site-field-bg: #1C1A18;
  --site-disabled-bg: #2A2622;
  --site-disabled-fg: #EBE6E0;
  --site-shadow: 0 0 0 1px #3D3833;
  --site-field-line: #3D3833;
  --site-field-ink: #F6F3EF;
  --site-placeholder: #EBE6E0;
  --site-fit: #7FE5A8;
  --site-link-red: #FF6B5E;
  --site-panel: #1C1A18;
}

@layer base {

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--site-bg); }
body {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-fg);
  font: 400 16px/1.5 var(--site-font-body);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { font-weight: inherit; font-size: inherit; }
ul, ol { list-style: none; }
img, svg, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

}

@layer site {

/* ---------- the primary button: Dinan's red, Oswald capitals ---------- */
.cl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 20px;
  background: var(--site-accent); color: var(--site-accent-fg); border: 0; border-radius: var(--site-radius);
  font: 500 14px/1 var(--site-font-button); letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  transition: background-color 0.3s ease;
}
.cl-btn:hover { background: var(--site-button-hover-bg); }
.cl-btn:focus-visible { outline: 2px solid var(--site-fg); outline-offset: 2px; }

/* ---------- header: the black bar (name, search, account, cart), a light rule, the menu row ---------- */
.cl-hd { position: relative; z-index: 50; background: var(--site-dark); color: var(--site-chrome-fg); }
.cl-hd__bar { display: flex; align-items: center; height: 92px; padding: 0 32px; border-bottom: 1px solid var(--site-dark-line); }
.cl-hd__toggle { display: none; }
/* the kit's theme switch (shown at night only), between the account and the cart, in the header's white */
.parts-theme-switch { color: var(--site-chrome-fg); }
.parts-theme-switch:hover { color: var(--site-accent); }
.cl-hd__name { flex: none; display: flex; flex-direction: column; justify-content: center; width: 275px; color: var(--site-chrome-fg); }
.cl-hd__mark { font: 600 44px/1 var(--site-font-heading); letter-spacing: 0.22em; text-transform: uppercase; }
.cl-hd__tag { margin-top: 6px; font: 400 13px/1 var(--site-font-body); letter-spacing: 0.04em; }
.cl-hd__name:hover .cl-hd__mark { color: var(--site-accent); }
.cl-hd__search { position: relative; flex: 0 1 923px; min-width: 0; margin-left: 53px; }
.cl-hd__form { display: flex; height: 44px; background: var(--site-field-bg); border: 1px solid var(--site-field-line); }
.cl-hd__form input {
  flex: 1; min-width: 0; height: 42px; padding: 0 12px; border: 0; border-radius: 0; background: transparent;
  font: 400 16px/1 var(--site-font-body); color: var(--site-fg); -webkit-appearance: none; appearance: none;
}
.cl-hd__form input::placeholder { color: var(--site-placeholder); opacity: 1; }
.cl-hd__form input::-webkit-search-cancel-button { -webkit-appearance: none; }
.cl-hd__form input:focus { outline: none; }
.cl-hd__form:focus-within { outline: 2px solid var(--site-accent); outline-offset: 0; }
.cl-hd__form button { flex: none; width: 64px; display: grid; place-items: center; color: var(--site-field-ink); }
.cl-hd__form button:hover { color: var(--site-accent); }
.cl-hd__end { display: flex; align-items: center; gap: 12px; margin-left: auto; padding-left: 16px; }
.cl-hd__icon { position: relative; display: grid; place-items: center; width: 44px; height: 44px; color: var(--site-chrome-fg); }
.cl-hd__icon:hover { color: var(--site-accent); }
.cl-hd__count {
  position: absolute; top: 0; right: -4px; min-width: 18px; padding: 0 4px;
  font: 700 13px/18px var(--site-font-body); text-align: center; background: var(--site-accent); color: var(--site-accent-fg);
}
.cl-hd__count:empty { display: none; }
.cl-hd__nav { height: 48px; padding: 0 32px; }
.cl-hd__list { display: flex; align-items: center; height: 100%; gap: 0 26px; }
.cl-hd__link { display: flex; align-items: center; min-height: 40px; font: 400 16px/22px var(--site-font-body); color: var(--site-chrome-fg); white-space: nowrap; }
.cl-hd__link:hover, .cl-hd__link.is-current { color: var(--site-accent); }
@media (max-width: 1199.98px) and (min-width: 980px) {
  .cl-hd__search { margin-left: 24px; }
  .cl-hd__name { width: 200px; }
  .cl-hd__mark { font-size: 36px; }
  .cl-hd__list { gap: 0 18px; }
  .cl-hd__link { font-size: 14px; }
}

/* ---------- the search suggestions (partials/suggest.html, filled by htmx, keys by fm-site.js) ---------- */
.cl-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 60; max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--site-bg); color: var(--site-fg); border: 1px solid var(--site-field-line); border-top: 0; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  font: 400 14px/1.35 var(--site-font-body); text-align: left;
}
.fm-suggest-section + .fm-suggest-section { border-top: 1px solid var(--site-line); }
.fm-suggest-title { padding: 10px 12px 4px; font: 600 14px/1.2 var(--site-font-heading); letter-spacing: 0.5px; text-transform: uppercase; color: var(--site-fg); }
.fm-suggest-item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; color: var(--site-fg); }
.fm-suggest-item:hover, .fm-suggest-item.is-active { background: var(--site-band); }
.fm-suggest-item b, .fm-suggest-item mark { background: none; color: inherit; font-weight: 700; }
.fm-suggest-glyph { flex: none; color: var(--site-fg); }
.fm-suggest-thumb { flex: none; width: 48px; height: 48px; object-fit: contain; background: var(--site-plate); }
.fm-suggest-thumb--blank { background: var(--site-band); }
.fm-suggest-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fm-suggest-note { font-size: 13px; color: var(--site-muted); }
.fm-suggest-fit { font-size: 13px; color: var(--site-fit); }
.fm-suggest-count { flex: none; margin-left: auto; font-size: 13px; }
.fm-suggest-price { flex: none; margin-left: auto; font-weight: 700; white-space: nowrap; }
.fm-suggest-all { justify-content: center; font-weight: 600; color: var(--site-link-red); border-top: 1px solid var(--site-line); }
.fm-suggest-empty { padding: 12px; }

/* ---------- footer: their red band, then black with white Oswald headings and Open Sans links ---------- */
.cl-ft { background: var(--site-dark); color: var(--site-chrome-fg); }
.cl-ft__band { height: 90px; background: linear-gradient(to right top, #FF0000, #8B0000); }
.cl-ft__cols { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 240px) minmax(0, 330px); justify-content: space-between; gap: 40px; max-width: 1120px; margin: 0 auto; padding: 24px 0 40px; }
.cl-ft__h { margin-bottom: 10px; font: 400 21px/1.5 var(--site-font-heading); color: var(--site-chrome-fg); }
.cl-ft__col li { margin: 0; }
.cl-ft__col a { display: inline-flex; align-items: center; min-height: 40px; font: 400 13px/1.4 var(--site-font-body); color: var(--site-chrome-fg); }
.cl-ft__col a:hover, .cl-ft__owner:hover { color: var(--site-accent); }
.cl-ft__social { display: flex; gap: 20px; }
.cl-ft__social a { display: grid; place-items: center; width: 48px; height: 48px; color: var(--site-chrome-fg); }
.cl-ft__social a:hover { color: var(--site-accent); }
.cl-ft__copy { margin-top: 40px; font: 400 13px/1.5 var(--site-font-body); color: var(--site-chrome-fg); }

/* the footer's trademark line: "owner" links the client's site in the line's own colour, underlined (Greg 2026-10-01) */
.cl-owner, .cl-owner:visited { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 11px 0; }
.cl-owner:hover { opacity: .8; }

/* ---------- phones: toggle, name and cart; the search under them; the menu as an opaque panel ---------- */
@media (max-width: 979.98px) {
  .cl-hd__bar { flex-wrap: wrap; height: auto; padding: 0 16px 15px; border-bottom: 0; }
  .cl-hd__toggle { display: grid; place-items: center; width: 44px; height: 65px; color: var(--site-chrome-fg); }
  .cl-hd__name { width: auto; margin: 0 auto; align-items: center; }
  .cl-hd__mark { font-size: 30px; }
  .cl-hd__tag { margin-top: 4px; }
  .cl-hd__end { gap: 0; margin-left: 0; padding-left: 0; }
  .cl-hd__end .cl-hd__icon:not(.cl-hd__cart) { display: none; }
  .cl-hd__cart { height: 65px; }
  /* at night the switch sits before the cart: the bars side takes its width too, so the name stays centred */
  :root[data-parts-night] .cl-hd__toggle { margin-right: 40px; }
  .cl-hd__search { order: 3; flex: 1 0 100%; margin: 0; }
  .cl-hd__form button { width: 44px; }
  .cl-suggest { max-height: 60vh; }
  .cl-hd__nav { position: absolute; top: 65px; left: 0; right: 0; height: auto; padding: 0 16px; background: var(--site-dark); border-top: 1px solid var(--site-ink-line); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35); }
  .cl-js .cl-hd__nav:not(.is-open) { display: none; }
  .cl-hd__list { flex-direction: column; align-items: stretch; }
  .cl-hd__link { min-height: 48px; border-bottom: 1px solid var(--site-ink-line); font-size: 16px; }
  .cl-hd__list li:last-child .cl-hd__link { border-bottom: 0; }

  .cl-ft__band { height: 42px; }
  .cl-ft__cols { grid-template-columns: 1fr; gap: 28px; padding: 24px 16px 32px; text-align: center; }
  .cl-ft__social { justify-content: center; }
  .cl-ft__copy { margin-top: 20px; }
}

/* ---------- the 404 (templates/404.html) ---------- */
.cl-404__home { text-align: center; padding: 0 16px 80px; }

}
