/* HaulYardHQ brand art: the sidebar module glyphs and the truck lockup with
 * the tenant's door badge (n25 branding). Loaded in <head> by haulbase.py with
 * a ?v= cache-bust; bump it on every change (tests/test_branding_n25.py pins it).
 *
 * Colour contract (the SVG art in haulbase/branding/ uses ONLY these classes):
 *   glyphs  .hy-ic   .a  accent fill (brand yellow; a navy edge in light mode)
 *                    .i  ink fill   (silver in dark mode, navy in light mode)
 *                    .s  ink stroke (no fill; stroke-width set on the element)
 *   truck   .hy-truck .f body fill with a line-coloured stroke
 *                     .l line colour fill (outlines, window, wheel rings, road dashes)
 *                     .i ink fill (the "HaulYard" letters and the H)
 *                     .y brand yellow fill (the road in the H, "HQ")
 * The tenant's own logo never enters these SVGs: it is an <img> laid over the
 * cab door (.hy-door), so a tenant's colours never recolour the app or the truck.
 */

:root, [data-theme="dark"] {
  --hy-yellow: #FBBF24;
  --hy-ic-ink: #dde3ea;
  --hy-ic-edge: transparent;
  --hy-truck-fill: #eef2f6;
  --hy-truck-ink: #eef2f6;
  --hy-truck-line: #0f172a;   /* the dark sidebar (bg-slate-900): outlines read as gaps */
}
.hy-refresh[data-theme="dark"] { --hy-truck-line: var(--bg-card); }
[data-theme="light"] {
  --hy-ic-ink: #1b2a45;
  --hy-ic-edge: #1b2a45;
  --hy-truck-fill: #f1f5f9;
  --hy-truck-ink: #0f1b2d;
  --hy-truck-line: #0f1b2d;
}

/* ---- module glyphs ---------------------------------------------------- */
.hy-ic {
  display: inline-flex;
  flex: none;
  width: 24px;
  height: 24px;
}
.hy-ic svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hy-ic .a { fill: var(--hy-yellow); stroke: var(--hy-ic-edge); stroke-width: 1.1; stroke-linejoin: round; }
.hy-ic .i { fill: var(--hy-ic-ink); }
.hy-ic .s { fill: none; stroke: var(--hy-ic-ink); stroke-linecap: round; stroke-linejoin: round; }
/* Lucide icons that keep their stock shape (Settings gear, Developer) sit in
   the same 24px box so labels line up. */
.hy-ic-lucide { display: inline-flex; flex: none; width: 24px; height: 24px; align-items: center; justify-content: center; }

/* ---- truck lockup ----------------------------------------------------- */
.hy-brand-lockup {
  position: relative;
  display: block;
  width: 100%;
  max-width: 260px;
  line-height: 0;
}
.hy-truck { display: block; width: 100%; height: auto; overflow: visible; }
.hy-truck .f { fill: var(--hy-truck-fill); stroke: var(--hy-truck-line); }
.hy-truck .l { fill: var(--hy-truck-line); }
.hy-truck .i { fill: var(--hy-truck-ink); }
.hy-truck .y { fill: var(--hy-yellow); }

/* Tenant door badge: absolutely placed over the cab door by percentages that
   come from the truck art's own door rectangle (haulbase/branding/art.py). */
.hy-door {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
  border-radius: 2px;
  line-height: 1;
}
.hy-door img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
/* The name fallback scales with the door (container query units), so it
   fills the panel at every sidebar width. */
.hy-door:has(.hy-door-name) { container-type: size; }
.hy-door-name {
  color: #fff;
  font-family: 'Inter Tight', 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: 72cqh;
  line-height: 100cqh;
  height: 100cqh;
  display: block;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  max-width: 100%;
}

/* The header uses the sidebar's full width (the nav pads its links 12px). */
.hy-brand { margin-left: -8px; margin-right: -8px; }

/* Phone (the sidebar stacks above the page): no taller than master's old
   wordmark header (56px), so the first screen is not all menu. 240px wide =
   a 55px-tall truck, with no extra padding. Desktop keeps its spacing. */
@media (max-width: 900px) {
  .hy-sidebar .hy-brand { padding-top: 0; padding-bottom: 0; }
  .hy-sidebar .hy-brand-lockup { max-width: 240px; }
}

/* Sidebar rows with the 24px glyphs: 6px top/bottom keeps the Dashboard-to-
   Settings column inside a 900px-tall window. */
.hy-sidebar .hy-sidebar-link { padding-top: 6px; padding-bottom: 6px; }

/* ---- Settings: company logo card -------------------------------------- */
.hy-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  padding: 12px;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border-1);
}
.hy-logo-preview img { display: block; max-width: 240px; max-height: 80px; object-fit: contain; }
