/*
 * Crom Services shared theme (light default + dark by system preference): crom-shared v1
 * ONE source for every Crom sample page, the packs page and the job page.
 * Hosted: https://cromservices.github.io/crom-shared/theme.css
 * Values: Brand PACKS-SCHEME-SPEC.md (measured from https://cromservices.com.au/; first measured 1 Oct 2026, re-measured 3 Oct 2026).
 * Change a value here and every sample that links this file picks it up.
 * Follows the visitor's system setting (prefers-color-scheme): light by default,
 * dark when the OS asks for dark. Force one with <html data-theme="light|dark">.
 * Light tokens: Brand PACKS-SCHEME-SPEC.md (measured). Dark tokens: Brand
 * DARK-SCHEME-SPEC.md (designed counterpart, AA-checked). Both blocks below are
 * pasted verbatim from DARK-SCHEME-SPEC.md section 3.
 * Logo: <picture> swap by preference (header.js / snippets). Credit: footer.js
 * picks the SPEC light or dark snippet from the resolved scheme.
 */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");

/* Brand palette, verbatim from DARK-SCHEME-SPEC.md section 3 */
:root {
  /* Crom firm LIGHT scheme (measured — see PACKS-SCHEME-SPEC.md) */
  --bg: #f3f2ef;  --card: #ffffff;  --soft: #eeede9;
  --fg: #111111;  --muted: #6b6b6b; --border: #e4e2dc;
  --primary: #111111; --primary-fg: #ffffff; --primary-hover: #333333;
  --outline-hover: rgba(17,17,17,.06); --ring: #111111;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Crom firm DARK scheme (designed counterpart, AA-checked — DARK-SCHEME-SPEC.md) */
    --bg: #1b1a17;  --card: #26241f;  --soft: #24221d;
    --fg: #f3f1ec;  --muted: #a7a399; --border: #38352e;
    --primary: #f3f1ec; --primary-fg: #111111; --primary-hover: #e3e0d8;
    --outline-hover: rgba(243,241,236,.08); --ring: #f3f1ec;
  }
}

/* Shared non-colour tokens (unchanged between schemes; PACKS-SCHEME-SPEC.md) */
:root {
  --credit-fg: #4a5752;     /* credit text on light footers (crom-credit SPEC) */
  --thumb-bg: #ffffff;      /* thumbs are white browser windows (THUMB-SPEC) */
  --accent-green: #4caf78;  /* same in light and dark; only the small 6px step/demo dots (PACKS/DARK-SCHEME-SPEC) */
  --radius-card: 16px;
  --radius-media: 12px;
  --radius-pill: 9999px;
  --shell: 1040px;          /* max-width incl. 20px side padding, so 1000px content */
  --gutter: 20px;
  --gap: 20px;
  --card-pad: 24px;
  --btn-pad: 10px 24px;
  --btn-min-h: 44px;
  --logo-h: 64px;           /* mobile */
  --logo-h-md: 84px;        /* >=768px */
  --section-pad: 64px;
  --section-pad-md: 96px;
  --fs-body: 17px;  --fs-body-md: 18px;
  --fs-lead: 1.0625rem; --fs-lead-md: 1.2rem;
  --fs-h1: 2.05rem; --fs-h1-md: 3.4rem;
  --fs-h2: 28px;    --fs-h2-md: 36px;
  --fs-h3: 18.4px;
  --fs-note: 15px;
  --fs-small: 14px;
  --tracking-tight: -0.018em;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --credit-fg: #cdd6d1; } /* credit text on dark footers (crom-credit SPEC) */
}

/* Optional override for screenshots and testing: <html data-theme="light|dark">.
   Same values as above; the attribute selector beats the media query. */
:root[data-theme="light"] {
  --bg: #f3f2ef;  --card: #ffffff;  --soft: #eeede9;
  --fg: #111111;  --muted: #6b6b6b; --border: #e4e2dc;
  --primary: #111111; --primary-fg: #ffffff; --primary-hover: #333333;
  --outline-hover: rgba(17,17,17,.06); --ring: #111111;
  --credit-fg: #4a5752; color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b1a17;  --card: #26241f;  --soft: #24221d;
  --fg: #f3f1ec;  --muted: #a7a399; --border: #38352e;
  --primary: #f3f1ec; --primary-fg: #111111; --primary-hover: #e3e0d8;
  --outline-hover: rgba(243,241,236,.08); --ring: #f3f1ec;
  --credit-fg: #cdd6d1; color-scheme: dark;
}

/* CSS swap helpers for React/static markup that renders both variants
   (CromFooter auto). Put each variant in <span class="crom-when-light|dark">. */
.crom-when-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .crom-when-light { display: none !important; }
  :root:not([data-theme="light"]) .crom-when-dark { display: contents !important; }
}
:root[data-theme="dark"] .crom-when-light { display: none !important; }
:root[data-theme="dark"] .crom-when-dark { display: contents !important; }

/* base */
* { box-sizing: border-box; }
html { overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.55;
}
@media (min-width: 768px) { body { font-size: var(--fs-body-md); } }
a { color: var(--fg); text-underline-offset: 4px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* layout */
.crom-shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.crom-section { border-top: 1px solid var(--border); padding: var(--section-pad) 0; }
@media (min-width: 768px) { .crom-section { padding: var(--section-pad-md) 0; } }

/* type helpers */
.crom-h1 { font-size: var(--fs-h1); line-height: 1.18; font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0; }
@media (min-width: 768px) { .crom-h1 { font-size: var(--fs-h1-md); line-height: 1.12; } }
.crom-h2 { font-size: var(--fs-h2); line-height: 1.2; font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0; }
@media (min-width: 768px) { .crom-h2 { font-size: var(--fs-h2-md); } }
.crom-h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0; }
.crom-lead { font-size: var(--fs-lead); margin: 24px 0 0; max-width: 62ch; }
@media (min-width: 768px) { .crom-lead { font-size: var(--fs-lead-md); } }
.crom-note { font-size: var(--fs-note); line-height: 1.625; color: var(--muted); }
.crom-small { font-size: var(--fs-small); color: var(--muted); }
.crom-eyebrow { font-size: var(--fs-small); font-weight: 500; color: var(--muted); margin: 0 0 12px; }

/* shared header (header.js / header.html) */
.crom-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.crom-header__inner {
  max-width: var(--shell); margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.crom-brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: inherit; }
.crom-logo { display: block; height: var(--logo-h); width: auto; }
@media (min-width: 768px) { .crom-logo { height: var(--logo-h-md); } }
.crom-tag {
  font-size: var(--fs-small); font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); background: var(--card);
  padding: 6px 14px; border-radius: var(--radius-pill); white-space: nowrap;
}

/* cards, chips, buttons */
.crom-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); box-shadow: none; overflow: hidden; }
.crom-chip {
  display: inline-block; font-size: var(--fs-small); font-weight: 500; color: var(--fg);
  background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 4px 12px;
}
.crom-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--btn-min-h); padding: var(--btn-pad);
  font-family: var(--font-ui); font-size: 16px; font-weight: 500; line-height: 24px;
  text-decoration: none; border-radius: var(--radius-pill); border: 1px solid var(--primary);
  background: var(--primary); color: var(--primary-fg); cursor: pointer;
  transition: background-color 150ms var(--ease); width: fit-content;
}
.crom-btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.crom-btn--outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.crom-btn--outline:hover { background: var(--outline-hover); border-color: var(--fg); }
.crom-btn:hover { color: var(--primary-fg); }
.crom-btn--outline:hover { color: var(--fg); }

/* small status dot (6px, decorative) */
.crom-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-green); vertical-align: middle; }

/* thumbs: white canvas, contain, corners follow the card */
.crom-thumb { display: block; width: 100%; height: auto; object-fit: contain; background: var(--thumb-bg); }

/* shared footer (footer.js / footer.html / CromFooter.tsx) */
.crom-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 32px 0 40px; font-size: var(--fs-small); color: var(--muted); }
.crom-footer a { color: var(--muted); }
.crom-footer p { margin: 0 0 12px; }
.crom-footer__line { margin: 0 0 18px; }
.crom-footer__credit { display: block; padding: 0; }
