/* Design Calculations - site-wide tokens + shared header/footer pieces (staging 2026-10).
   Loaded after /shared/branding/branding.css and /shared/ui/styles.css.
   Tokens: one place for colours, radius, shadow and font. The calculator pages can switch to
   this file later; their inline header/footer rules are copied here unchanged in look. */
:root {
  --gd-brand: #2563eb;
  --gd-brand-hover: #1d4ed8;
  --gd-brand-dark: #1e3a5f;
  --gd-accent: #059669;
  --gd-text: #1e293b;
  --gd-text-strong: #0f172a;
  --gd-muted: #64748b;
  --gd-muted-strong: #475569;
  --gd-border: #e2e8f0;
  --gd-border-soft: #cbd5e1;
  --gd-bg: #f8fafc;
  --gd-card: #ffffff;
  --gd-tint: #eff6ff;
  --gd-ok-bg: #ecfdf5;
  --gd-ok-text: #065f46;
  --gd-soon-bg: #fffbeb;
  --gd-soon-text: #92400e;
  --gd-radius: 10px;
  --gd-shadow: 0 2px 8px rgba(0,0,0,.08);
  --gd-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gd-wrap: 1120px;
  --gd-tap: 44px;
  /* map the calculator variables onto the tokens so styles.css follows them */
  --primary: var(--gd-brand);
  --primary-dark: var(--gd-brand-hover);
  --bg: var(--gd-bg);
  --card-bg: var(--gd-card);
  --text: var(--gd-text);
  --text-muted: var(--gd-muted);
  --border: var(--gd-border);
  --radius: var(--gd-radius);
  --shadow: var(--gd-shadow);
  --font: var(--gd-font);
}

/* ---- shared header (same as the calculators: gradient from styles.css, centred) ---- */
.site-lang { text-align: right; font-size: .8rem; letter-spacing: .04em; margin: 0 0 .4rem; }
.site-lang a { color: #fff; text-decoration: none; font-weight: 650; } /* 2026-10 contrast: #fff is the only AA colour on the light end of the gradient (#2563eb) */
.site-lang a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: .2em; }
.site-lang a:hover { color: #fff; }
.site-lang .sep, .site-footer .lang .sep { opacity: .55; margin: 0 .28rem; }
a.home-link { color: inherit; text-decoration: none; }
a.home-link:hover { text-decoration: underline; text-underline-offset: .2em; }
header a.home-link:hover { color: #fff; }

/* ---- shared footer (same as the calculators: centred, language + legal links) ---- */
.site-footer { border-top: 1px solid var(--gd-border); margin-top: 2rem; padding: 1.25rem 1.5rem; color: var(--gd-muted); font-size: .85rem; text-align: center; }
.site-footer .foot-tools { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem 1rem; margin-bottom: .45rem; }
.site-footer-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .35rem .8rem; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--gd-brand); text-decoration: underline; }
.site-footer .lang a { font-weight: 650; }
.site-footer .lang a[aria-current="page"] { color: var(--gd-text-strong); text-decoration: underline; text-underline-offset: .2em; }

/* ---- tap targets: at least 44 x 44 px for every link in header and footer ---- */
.site-lang a, .site-footer .lang a, .site-footer-links a, header .gd-brand-mark a.home-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--gd-tap); min-width: var(--gd-tap); padding: 0 .5rem;
}
.site-lang .sep, .site-footer .lang .sep { margin: 0; }
.site-lang, .site-footer .lang { display: flex; align-items: center; }
.site-lang { justify-content: flex-end; margin-bottom: 0; }
.site-footer .lang { justify-content: center; }

/* visible keyboard focus */
a:focus-visible { outline: 2px solid var(--gd-brand); outline-offset: 2px; border-radius: 4px; }
header a:focus-visible { outline-color: #fff; }

@media print { .site-lang, .site-footer .foot-tools { display: none; } }

/* ===== Home page (/ and /nl/) ===== */
body.home { display: flex; flex-direction: column; line-height: 1.5; }
.home main { flex: 1; }
.home-wrap { max-width: var(--gd-wrap); margin: 2rem auto 0; padding: 0 1.5rem; width: 100%; }
.section-label, .home .section-label { color: var(--gd-muted-strong); font-size: .85rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 .75rem; }
.home .section { margin-bottom: 2rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
@media (max-width: 380px) { .tool-grid, .guide-grid { grid-template-columns: 1fr; } }

.tool-card { display: flex; flex-direction: column; align-items: flex-start; background: var(--gd-card); border: 1px solid var(--gd-border); border-radius: var(--gd-radius); padding: 1.25rem 1.5rem; color: inherit; text-decoration: none; }
.tool-card h2 { font-size: 1.15rem; margin-bottom: .35rem; }
.tool-card p { color: var(--gd-muted); font-size: .95rem; }
.badge { display: inline-block; margin-bottom: .7rem; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }

/* available: strong blue border, green label, real button */
.tool-live { border: 2px solid var(--gd-brand); box-shadow: var(--gd-shadow); transition: box-shadow .15s; }
.tool-live:hover { box-shadow: 0 4px 14px rgba(37,99,235,.18); }
.tool-live h2 { color: var(--gd-brand); font-size: 1.3rem; }
.badge-ok { background: var(--gd-ok-bg); color: var(--gd-ok-text); }
.btn-primary { display: inline-flex; align-items: center; min-height: var(--gd-tap); margin-top: 1rem; padding: 0 1.25rem; border-radius: var(--gd-radius); background: var(--gd-brand); color: #fff; font-size: 1rem; font-weight: 600; }
.tool-live:hover .btn-primary { background: var(--gd-brand-hover); }
@media (min-width: 1024px) { .tool-live { grid-column: span 2; } }

/* coming soon: compact, muted title, dashed border, amber label, plain text link */
.tool-soon { padding: 1rem; border: 1px dashed var(--gd-border-soft); background: var(--gd-card); }
.tool-soon h2 { color: #334155; font-size: 1.05rem; }
.badge-soon { background: var(--gd-soon-bg); color: var(--gd-soon-text); }
.tool-soon .text-link { display: inline-flex; align-items: center; min-height: var(--gd-tap); margin-top: .25rem; color: var(--gd-brand); font-size: .875rem; font-weight: 600; }
a.tool-soon:hover { border-color: var(--gd-brand); }
a.tool-soon:hover .text-link { text-decoration: underline; }

/* guides: compact link cards, existing page titles only */
.guide-card { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: var(--gd-tap); padding: .75rem 1rem; background: var(--gd-card); border: 1px solid var(--gd-border); border-radius: var(--gd-radius); color: var(--gd-brand); font-size: 1rem; font-weight: 600; text-decoration: none; }
.guide-card:hover { border-color: var(--gd-brand); }
.guide-card .arrow { flex: none; }

/* ---- home hero (scan point 1, approved hero B): inside the shared gradient header ---- */
.home header { padding: 1.25rem 1.5rem 2.25rem; }
.home header .gd-brand-mark { margin: 0 auto; max-width: var(--gd-wrap); text-align: left; }
.home .site-lang { max-width: var(--gd-wrap); margin: 0 auto; }
.hero { max-width: var(--gd-wrap); margin: 1rem auto 0; display: grid; gap: 1.5rem; text-align: left; align-items: center; }
.hero h1, .home header .hero h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.hero-lead, .home header p.hero-lead { margin-top: .75rem; font-size: 1.05rem; opacity: 1; color: #fff; max-width: 34rem; line-height: 1.5; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin-top: 1.5rem; }
.btn-hero { display: inline-flex; align-items: center; min-height: var(--gd-tap); padding: 0 1.25rem; border-radius: var(--gd-radius); background: #fff; color: var(--gd-brand-dark); font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(15,23,42,.25); }
.btn-hero:hover { background: var(--gd-tint); }
.hero-second { display: inline-flex; align-items: center; min-height: var(--gd-tap); color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }
.hero-example { margin: 0; background: var(--gd-card); color: var(--gd-text); border: 1px solid var(--gd-border); border-radius: var(--gd-radius); box-shadow: var(--gd-shadow); padding: .9rem 1rem 1rem; width: 100%; max-width: 520px; justify-self: end; }
.hero-example .ex-top { font-size: .85rem; font-weight: 600; color: var(--gd-muted-strong); }
.hero-example .ex-drawing { display: block; width: 100%; height: auto; margin: .4rem 0 .6rem; }
.ex-box { background: linear-gradient(135deg, var(--gd-tint), #fff); border: 2px solid var(--gd-brand); border-radius: var(--gd-radius); padding: .7rem .9rem; }
.ex-ring { font-weight: 700; font-size: 1.05rem; color: var(--gd-text-strong); margin-bottom: .35rem; }
.ex-box dl { display: grid; grid-template-columns: 1fr 1fr; gap: .25rem 1rem; }
.ex-box dl div { display: flex; justify-content: space-between; gap: .5rem; font-size: .875rem; border-bottom: 1px solid var(--gd-border); padding: .15rem 0; }
.ex-box dt { color: var(--gd-muted-strong); }
.ex-box dd { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-example .ex-bottom, .home header .hero-example p.ex-bottom { margin-top: .5rem; font-size: .8rem; color: var(--gd-muted-strong); opacity: 1; font-style: italic; }
@media (min-width: 1024px) { .hero { grid-template-columns: 1fr minmax(0, 520px); gap: 2.5rem; margin-top: 1.5rem; } }
@media (max-width: 767px) {
  .hero h1, .home header .hero h1 { font-size: 1.6rem; }
  .hero-example { justify-self: stretch; max-width: none; }
  .hero-example .ex-drawing { display: none; }   /* scan point 1: drawing left out on phones, result box stays */
  .ex-box dl { grid-template-columns: 1fr; }
}

/* ---- 2026-10: header contrast AA on the whole gradient (worst case #2563eb, only #fff reaches 5.17:1) ---- */
header .gd-brand-mark { opacity: 1; }
header > p { opacity: 1; color: #fff; }

/* ---- 2026-10: shared unit control (segmented mm | in right of the main input, same height) ---- */
.gd-unit-row { display: flex; gap: .5rem; align-items: stretch; }
.gd-unit-row > input { flex: 1 1 auto; min-width: 0; }
.gd-unit { display: inline-flex; align-items: stretch; flex: 0 0 auto; padding: 2px; background: var(--gd-bg); border: 1px solid var(--gd-border); border-radius: var(--gd-radius); }
.gd-unit button { min-width: 44px; padding: 0 .85rem; border: 0; border-radius: calc(var(--gd-radius) - 2px); background: transparent; color: var(--gd-muted-strong); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; }
.gd-unit button[aria-pressed="true"] { background: var(--gd-brand); color: #fff; }
.gd-unit button:hover:not([aria-pressed="true"]) { background: var(--gd-border); }

/* ---- 2026-10: visible keyboard focus on every control (links are covered above) ---- */
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--gd-brand); outline-offset: 2px; }

/* ---- 2026-11 taalwissel: home only (body.home): language switch top right, not vertically centred in the tall hero ---- */
@media (min-width: 1100px) { body.home .lang-switch--header { top: 1.25rem; transform: none; } }
