/* cetome dataviz - shared look and feel (tokens, font, header, footer, controls).
   Page layouts: css/home.css (landing page) and css/graph.css (graph pages). */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-variable.woff2') format('woff2');
}

:root {
  /* brand (same values as cetome.com) */
  --blue: #0044aa;
  --blue-deep: #003a8f;
  --blue-accent: #1565d8;
  --blue-light: #217aff;
  --blue-tint: #e8effb;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #cbd5e1;
  --line-soft: #e2e8f0;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-soft: #f8fafc;
  --green: #22c55e;
  --green-deep: #166534;
  --red: #ef4444;
  --red-deep: #b91c1c;
  --amber-deep: #a16207;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, Consolas, 'Courier New', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.16);
  --gutter: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
}

a { color: var(--blue); text-decoration: none; }
a:hover, a:focus-visible { color: var(--blue-light); }
:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 2px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; }

/* --- header --------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.6rem var(--gutter);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.site-header .logo { display: inline-flex; align-items: center; flex: none; }
.site-header .logo img { height: 40px; width: auto; display: block; }
.site-header .page-title { font-size: 1.05rem; font-weight: 600; color: var(--blue); margin: 0; }
.site-header .page-title small { display: block; font-size: 0.85rem; font-weight: 400; color: var(--muted); }

/* --- footer --------------------------------------------------------------- */
.site-footer { font-size: 0.8rem; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--blue); }

/* --- controls ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--blue);
  background: var(--surface);
  color: var(--blue);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover, .btn:focus-visible { background: var(--blue-tint); color: var(--blue-deep); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--blue-accent); color: #fff; border-color: var(--blue-accent); }
.btn:disabled, .btn:disabled:hover { background: var(--surface-alt); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn[aria-pressed="true"] { background: var(--blue); color: #fff; }

.input, select.input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
}
.input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(0, 68, 170, 0.15); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.25rem 0;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.check input { margin: 0.2rem 0 0; accent-color: var(--blue); flex: none; cursor: pointer; }
.check:hover { color: var(--blue); }
.check-strong { font-weight: 600; color: var(--blue); }
.check .tag { font-weight: 700; color: var(--blue); margin-right: 0.25rem; }

.swatch {
  width: 12px; height: 12px; border-radius: 3px; flex: none;
  display: inline-block; margin: 0.3rem 0.4rem 0 0; border: 1px solid transparent;
}

/* toggle switch (prEN 40000-1-3 assessment mode) */
.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; margin: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: background 0.25s; }
.switch .track::after {
  content: ''; position: absolute; width: 14px; height: 14px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.25s;
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue-light); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
