/* EllE Auto theme tokens — layered over the Modernist sheet. Soft radii, mono black/white palette. */
html { scrollbar-gutter: stable; }
:root, [data-theme] {
  --r-xs: 8px; --r-sm: 12px; --r-md: 18px; --r-lg: 26px; --r-pill: 999px;
  --radius-sm: 12px; --radius-md: 18px; --radius-lg: 26px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --as-red: #e5484d; --as-green: #30a46c;
  --as-red-badge: #c62f2f; /* white badge text on red passes contrast (5.4:1) */
  --as-brand: #2563eb; /* default brand colour — the dealer's own comes from dealers.json → brand.colors (Worker) */
  --as-brand-btn: #1d4ed8; /* one step darker: white button text must pass WCAG AA (4.5:1) */
}
:root, [data-theme="light"] {
  --color-bg: #f4f4f2; --color-surface: #ffffff; --as-surface-2: #ebebe8;
  --color-text: #1b1c1f; --as-muted: #5f6066;
  --color-divider: rgba(27, 28, 31, .10); --as-line-strong: rgba(27, 28, 31, .18);
  /* Brand colour: buttons, selected filters, checkboxes, active page — the "action" colour. */
  --as-ink: var(--as-brand-btn); --as-on-ink: #ffffff; --as-logo-plate: #1b1c1f;
  --color-accent: var(--as-brand); --color-accent-100: #e8effd; --color-accent-800: #1e3a8a;
  --as-stripe: rgba(27, 28, 31, .06);
  --shadow-sm: 0 1px 2px rgba(20, 20, 24, .06);
  --shadow-md: 0 8px 24px rgba(20, 20, 24, .08);
  --shadow-lg: 0 24px 60px rgba(20, 20, 24, .16);
}
[data-theme="dark"] {
  --color-bg: #16171a; --color-surface: #1f2024; --as-surface-2: #292a2f;
  --color-text: #f2f2f0; --as-muted: #a3a4aa;
  --color-divider: rgba(242, 242, 240, .09); --as-line-strong: rgba(242, 242, 240, .18);
  /* Same brand colour as day mode for buttons / selected items, so both themes match. */
  --as-ink: var(--as-brand-btn); --as-on-ink: #ffffff; --as-logo-plate: transparent;
  --color-accent: var(--as-brand-btn); --color-accent-100: #1a2236; --color-accent-800: #9db8f8;
  --as-stripe: rgba(242, 242, 240, .05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-lg: 0 0 0 1px rgba(242, 242, 240, .06), 0 30px 70px rgba(0, 0, 0, .55);
}

html, body { margin: 0; background: var(--color-bg); }

[data-skip-link] { position: fixed; left: 12px; top: 12px; z-index: 4000; transform: translateY(-160%); padding: 12px 16px; border-radius: 12px; background: var(--as-ink); color: var(--as-on-ink); font: 700 14px/1 var(--font-body); text-decoration: none; transition: transform .18s var(--ease); }
[data-skip-link]:focus { transform: translateY(0); outline: 3px solid var(--color-text); outline-offset: 3px; }

/* Smooth page-to-page transitions (cross-document View Transitions — Chrome/Edge/Safari 18+; others navigate normally) */
/* cross-document view transitions disabled — page fade is handled in theme.js + the server shell (prevents multiple flashes) */
::view-transition-old(root) { animation: as-vt-out .28s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(root) { animation: as-vt-in .42s cubic-bezier(.16,1,.3,1) both; }
@keyframes as-vt-out { to { opacity: 0; transform: translateY(-10px) scale(.995); } }
@keyframes as-vt-in { from { opacity: 0; transform: translateY(16px); } }
header, [data-site-header] { view-transition-name: as-header; }
::view-transition-group(as-header) { animation-duration: 0s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
html { background: var(--color-bg); }

/* ───────── ELLE Auto design layer: "noir rosé" ─────────
   Warm plum-black stage, the logo's magenta as the one action colour, a soft rosé paper in day mode.
   The header and the footer stay on the black stage in both themes (the logo is drawn for black).
   Signature: a magenta hairline (header bottom, footer top, section kickers). */
:root, [data-theme] {
  --r-xs: 6px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px;
  --elle-stage: #0b0709; --elle-stage-2: #150d12; --elle-stage-3: #22151c;
  --elle-rose: #ff7ab9; --elle-blush: #f3b8d2;
  --elle-line: linear-gradient(90deg, rgba(224,6,127,0) 0%, #e0067f 22%, #ff7ab9 50%, #e0067f 78%, rgba(224,6,127,0) 100%);
  --elle-glow: radial-gradient(60% 80% at 12% 100%, rgba(224,6,127,.34) 0%, rgba(224,6,127,0) 70%);
}
:root, [data-theme="light"] {
  --color-bg: #f8f3f5; --color-surface: #ffffff; --as-surface-2: #f1e7ec;
  --color-text: #1d1218; --as-muted: #6a5862;
  --color-divider: rgba(29, 18, 24, .10); --as-line-strong: rgba(29, 18, 24, .20);
  --shadow-sm: 0 1px 2px rgba(40, 10, 26, .06);
  --shadow-md: 0 10px 28px rgba(40, 10, 26, .09);
  --shadow-lg: 0 26px 64px rgba(40, 10, 26, .16);
}
[data-theme="dark"] {
  --color-bg: #0b0709; --color-surface: #150d12; --as-surface-2: #22151c;
  --color-text: #f8eef3; --as-muted: #b9a7b1;
  --color-divider: rgba(248, 238, 243, .09); --as-line-strong: rgba(248, 238, 243, .18);
  --color-accent: #ff7ab9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-lg: 0 0 0 1px rgba(248, 238, 243, .06), 0 30px 70px rgba(0, 0, 0, .6);
}
/* Brand text on dark surfaces: the lighter rose keeps 7:1 contrast (the magenta stays on buttons). */
[data-theme="dark"][data-theme="dark"][data-theme="dark"], header[data-keep], footer[data-keep] { --as-brand: #ff5fae; }
/* The header and its menus: always the black stage (same tokens as the dark theme, whatever the page theme). */
header[data-keep] {
  --color-bg: var(--elle-stage); --color-surface: var(--elle-stage-2); --as-surface-2: var(--elle-stage-3);
  --color-text: #f8eef3; --as-muted: #b9a7b1;
  --color-divider: rgba(248, 238, 243, .10); --as-line-strong: rgba(248, 238, 243, .2);
  --shadow-lg: 0 0 0 1px rgba(248, 238, 243, .06), 0 30px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
header[data-keep]::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 100vw; margin-left: -50vw; height: 1px; background: var(--elle-line); opacity: .75; pointer-events: none; }
/* Footer: the same black stage, the magenta hairline on top. */
footer[data-keep] { --color-text: #f8eef3; --as-muted: #b9a7b1; }
footer[data-keep]::after { content: ''; position: absolute; left: 50%; top: 0; width: 100vw; margin-left: -50vw; height: 1px; background: var(--elle-line); pointer-events: none; }
/* Page headings: tighter, heavier display type. */
[data-site] h1, [data-site] h2 { letter-spacing: -0.035em; }
/* Primary buttons: a soft magenta glow on hover (colour and size unchanged). */
[data-site] a[style*="background: var(--as-ink)"], [data-site] a[style*="background: var(--as-brand-btn)"], [data-site] button[style*="background: var(--as-ink)"] { transition: box-shadow .35s var(--ease), transform .35s var(--ease); }
[data-site] a[style*="background: var(--as-ink)"]:hover, [data-site] a[style*="background: var(--as-brand-btn)"]:hover, [data-site] button[style*="background: var(--as-ink)"]:hover { box-shadow: 0 10px 30px rgba(224, 6, 127, .35); opacity: 1; }
/* Cards and panels: a magenta edge on hover. */
[data-site] a[style*="border: 1px solid var(--color-divider)"][style*="background: var(--color-surface)"] { transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .35s var(--ease), background .3s var(--ease), color .3s var(--ease); }
[data-site] a[style*="border: 1px solid var(--color-divider)"][style*="background: var(--color-surface)"]:hover { border-color: rgba(224, 6, 127, .45) !important; }
::selection { background: rgba(224, 6, 127, .28); }
@media (prefers-reduced-motion: reduce) { [data-site] a, [data-site] button { transition: none !important; } }

/* Native selects: themed dropdown lists (dark mode was white-on-white) */
:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
select option, select optgroup { background-color: var(--color-surface); color: var(--color-text); }

/* ELLE Auto: body-type tiles on phones (two per row): a long word ("Fourgonnette") stays whole. */
@container site (max-width: 819px) {
  [data-site] [data-m2] a span[style*="font-size: 17px"] { font-size: 15px !important; overflow-wrap: normal !important; word-break: normal !important; hyphens: manual; }
}

/* ELLE Auto hero: a short headline that grows with the window, never past the fold on laptops (1366×768, 125 % zoom). */
[data-site] [data-hero-h1] { font-size: clamp(38px, min(6.2vw, 9vh), 88px) !important; max-width: 18ch !important; }
@media (min-width: 820px) and (max-height: 860px) {
  [data-site] [data-hero-rot], [data-site] [data-hero-text] { display: none !important; }
}

/* ELLE Auto hero: the dealer panel (description, hours, address, phone, stock) on wide screens; below 1200 px the description stays in the left column. */
[data-site] [data-hero-panel] { display: none; }
@media (min-width: 1200px) {
  [data-site] [data-hero-panel] { display: block; }
  [data-site] [data-hero-text] { display: none !important; }
}
/* The hero is drawn edge to edge (data-bleed, 100vw): its content keeps the page's own left and right edges (the header logo line), scrollbar or not. */
[data-site] [data-hero-content] { max-width: none !important; padding-left: calc((100% - 100cqw) / 2 + max(20px, (100cqw - 1440px) / 2 + 20px)) !important; padding-right: calc((100% - 100cqw) / 2 + max(20px, (100cqw - 1440px) / 2 + 20px)) !important; }
[data-site] [data-hero-panel] { right: calc((100% - 100cqw) / 2 + max(20px, (100cqw - 1440px) / 2 + 20px)) !important; }
@media (max-height: 719px) { [data-site] [data-hp-text] { display: none; } }

/* ELLE Auto dark mode: the brand carries the night. Plum-rose surfaces and lines, the logo's true magenta on the buttons
   (white text 4.66:1), soft magenta light on the page, rose kickers. */
[data-theme="dark"] {
  --color-surface: #170b12; --as-surface-2: #261320; --as-muted: #c4abb9;
  --color-divider: rgba(255, 95, 174, .13); --as-line-strong: rgba(255, 95, 174, .26); --as-stripe: rgba(255, 95, 174, .05);
  --color-accent-100: #2a0f1d;
}
[data-theme="dark"][data-theme="dark"][data-theme="dark"] { --as-brand-btn: #e0067f; }
[data-theme="dark"] [data-site] { background: radial-gradient(1100px 700px at 100% 0%, rgba(224, 6, 127, .11), rgba(224, 6, 127, 0) 62%), radial-gradient(900px 800px at 0% 58%, rgba(224, 6, 127, .08), rgba(224, 6, 127, 0) 62%), var(--color-bg) !important; background-attachment: fixed !important; }
[data-theme="dark"] [data-site-frame] { background: transparent !important; }
[data-theme="dark"] [data-site] a[style*="background: var(--as-ink)"], [data-theme="dark"] [data-site] a[style*="background: var(--as-brand-btn)"], [data-theme="dark"] [data-site] button[style*="background: var(--as-ink)"], [data-theme="dark"] [data-site] button[style*="background: var(--as-brand-btn)"] { background-image: linear-gradient(135deg, #e0067f 0%, #b0006a 100%) !important; }
[data-theme="dark"] [data-site] span[style*="text-transform: uppercase"][style*="background: var(--as-surface-2)"] { color: var(--elle-rose); background: rgba(224, 6, 127, .14) !important; box-shadow: inset 0 0 0 1px rgba(255, 95, 174, .28); }
[data-theme="dark"] [data-site] h2 { text-shadow: 0 0 40px rgba(224, 6, 127, .18); }
/* Footer column titles: rose, both themes (the footer is always on the black stage). */
footer[data-keep] span[style*="font-size: 12px; font-weight: 700; opacity: .5"] { color: var(--elle-rose); opacity: 1 !important; letter-spacing: .1em; text-transform: uppercase; }
/* Header: the current page's menu item in the brand tint (both themes: the header is always on the black stage). */
header[data-keep] nav a[style*="background: var(--as-surface-2)"] { background: rgba(224, 6, 127, .2) !important; box-shadow: inset 0 0 0 1px rgba(255, 95, 174, .38); }
/* Hero subline on phones: the local line stays light (two lines at most at 360 px). */
@container site (max-width: 819px) { [data-site] [data-hero-sub] { font-size: 17px !important; line-height: 1.35; } }
