/* ==========================================================================
   Brand tokens — swap these to rebrand the whole app.
   Applied on top of Bootstrap 5 + Tabler (both MIT).
   ========================================================================== */

/* Self-hosted display face for the Boulderix wordmark (see apps/themes/logos.py).
   Bundled locally rather than loaded from Google's CDN so the logo renders
   offline and adds no third-party request. Subset to the Latin alphabet, which
   covers the brand name. */
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/syne-800.a0c6d2520639.woff2") format('woff2');
}

:root,
[data-bs-theme="light"] {
  --brand-primary: #1e3a8a;      /* alpine navy */
  --brand-primary-rgb: 30, 58, 138;
  --brand-accent: #1d4ed8;       /* glacier blue */
  --brand-accent-rgb: 29, 78, 216;
  --brand-ink: #172554;
  --brand-surface: #eff6ff;
  /* Constant dark band (navbar/footer/hero) — never the ink token, which flips. */
  --brand-deep: #172554;
  --brand-link: #1d4ed8;
  --brand-link-hover: #1544ce;
  /* Fills that carry white text; dark mode swaps to a darker, AA-safe blue. */
  --brand-fill: #1e3a8a;
  --brand-fill-rgb: 30, 58, 138;
  --brand-fill-2: #1d4ed8;
  --brand-fill-2-rgb: 29, 78, 216;
  --brand-btn-fill: #1e3a8a;
  --brand-radius: 0.75rem;
  --brand-font: var(--font-body, system-ui, sans-serif);

  --tblr-primary: var(--brand-primary);
  --tblr-primary-rgb: var(--brand-primary-rgb);
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: var(--brand-primary-rgb);
  --bs-link-color: var(--brand-link);
  --bs-link-hover-color: var(--brand-link-hover);
  --bs-border-radius: var(--brand-radius);
}

:root[data-bs-theme="dark"] {
  --brand-primary: #6988d8;      /* lighter navy for text on dark surfaces */
  --brand-primary-rgb: 105, 136, 216;
  --brand-accent: #5081ff;
  --brand-accent-rgb: 80, 129, 255;
  --brand-ink: #e2e9f1;          /* text token flips light */
  --brand-surface: #0d1218;
  --brand-deep: #172554;         /* stays dark in both schemes */
  --brand-link: #5081ff;
  --brand-link-hover: #588bff;
  --brand-fill: #2f60ec;         /* white-on-fill stays >= 4.5:1 */
  --brand-fill-rgb: 47, 96, 236;
  --brand-fill-2: #2450c8;
  --brand-fill-2-rgb: 36, 80, 200;
  --brand-btn-fill: #2f60ec;

  --tblr-primary: var(--brand-primary);
  --tblr-primary-rgb: var(--brand-primary-rgb);
  --bs-primary: var(--brand-primary);
  --bs-primary-rgb: var(--brand-primary-rgb);
  --bs-link-color: var(--brand-link);
  --bs-link-hover-color: var(--brand-link-hover);
}

body.layout-fluid {
  background-color: var(--brand-surface);
  color: var(--brand-ink);
  font-family: var(--brand-font, system-ui, sans-serif);
}

.brand-mark {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  margin-right: 0.35rem;
}

/* Inline brand logo (top-left lockup). The SVG reads --brand-primary/--brand-accent,
   so it recolors with the active theme just like the rest of the tokens. */
.brand-logo {
  display: inline-flex;
  align-items: center;
  margin-right: 0.4rem;
}
.brand-logo-svg {
  /* The SVG now contains the mark AND wordmark; fix the height and let the
     width follow the viewBox so each lockup keeps its aspect ratio. */
  height: 1.75rem;
  width: auto;
  display: block;
}
.navbar-brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
}

.bg-brand { background-color: var(--brand-primary) !important; }
.text-brand { color: var(--brand-primary) !important; }
.btn-brand {
  --tblr-btn-bg: var(--brand-primary);
  --tblr-btn-border-color: var(--brand-primary);
  --tblr-btn-color: #fff;
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}
.btn-brand:hover { filter: brightness(0.92); color: #fff; }

/* Product cards */
.specimen-card {
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  height: 100%;
}
.specimen-card:hover { transform: translateY(-3px); box-shadow: 0 0.5rem 1.25rem rgba(0,0,0,.12); }
.specimen-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: var(--brand-surface);
}
.specimen-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* Zoom viewer */
.zoom-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--brand-radius);
  background: #0e0c0b;
  touch-action: none;
}
.zoom-stage img { width: 100%; display: block; cursor: zoom-in; }
.zoom-thumbs { display: flex; flex-wrap: wrap; gap: .5rem; }
.zoom-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 0.5rem; cursor: pointer; border: 2px solid transparent; }
.zoom-thumbs img.active { border-color: var(--brand-primary); }

/* Capture wizard */
.capture-drop {
  border: 2px dashed var(--brand-primary);
  border-radius: var(--brand-radius);
  padding: 2rem;
  text-align: center;
  background: rgba(var(--brand-primary-rgb), 0.04);
}
.capture-step.active { border-color: var(--brand-primary); }
.thumb-pending { opacity: .6; }

.price-tag { font-weight: 600; color: var(--brand-primary); }
