/* UK Work Tools — single stylesheet. Mobile-first, no external CSS. */

:root {
  --navy: #1f3a5f;
  --navy-dark: #172c48;
  --teal: #1e8a8a;
  --teal-dark: #16706f;
  --ink: #16202c;
  --body: #405066;
  --muted: #6b7c93;
  --line: #dde5ee;
  --surface: #ffffff;
  --surface-alt: #f4f7fb;
  --bg: #fbfcfe;
  --success-bg: #e7f6ec;
  --success-ink: #175c31;
  --error-bg: #fdecec;
  --error-ink: #93221f;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(22, 32, 44, 0.06), 0 8px 24px rgba(22, 32, 44, 0.06);
  --max: 1140px;
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.75rem); }
h3 { font-size: 1.1rem; }
p, ul, ol, dl { margin: 0 0 1rem; }

a { color: var(--teal-dark); }
a:hover { color: var(--navy); }

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

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

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: 0.75rem 1rem;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand-mark { background: var(--navy); color: #fff; border-radius: 8px; padding: 0.15rem 0.45rem; font-size: 0.85rem; letter-spacing: 0.04em; }

.nav-toggle {
  background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.55rem 0.9rem; font: inherit; color: var(--ink); min-height: 44px; cursor: pointer;
}
.primary-nav { display: none; width: 100%; padding-bottom: 1rem; }
.primary-nav.is-open { display: block; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav a {
  display: block; padding: 0.7rem 0.25rem; text-decoration: none;
  color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line);
}
.primary-nav a[aria-current="page"] { color: var(--teal-dark); }
.nav-search { display: flex; gap: 0.5rem; margin-top: 0.85rem; }
.nav-search input { flex: 1 1 auto; min-width: 0; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .primary-nav { display: flex !important; align-items: center; gap: 1.25rem; width: auto; padding: 0; }
  .primary-nav ul { display: flex; gap: 1.1rem; }
  .primary-nav a { border: 0; padding: 0.35rem 0; }
  .nav-search { margin: 0; }
  .nav-search input { width: 170px; }
}

/* Forms */
input, select, textarea, button { font: inherit; }
input[type="text"], input[type="email"], input[type="search"], input[type="number"],
input[type="time"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; padding: 0.7rem 0.85rem; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 150px; }
label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 0.35rem; }
.field { margin-bottom: 1rem; }
.field-suffix { font-weight: 400; color: var(--muted); }
.field-help { font-size: 0.85rem; color: var(--muted); margin: 0.35rem 0 0; }
.hp-field { position: absolute; left: -9999px; }
.stack-form { max-width: 34rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.6rem 1.15rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--surface-alt); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }

button[type="submit"].btn-primary:focus-visible { outline-color: var(--navy); }
.nav-search button, .hero-search button {
  min-height: 44px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font-weight: 600; cursor: pointer;
}

/* Hero */
.hero { background: linear-gradient(160deg, #1f3a5f 0%, #17324f 55%, #14504f 100%); color: #eaf2fa; padding: 3rem 0 3.25rem; }
.hero h1 { color: #fff; }
.hero .lead { color: #cddceb; max-width: 46rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--teal); margin: 0 0 0.5rem; }
.hero .eyebrow { color: #7fd3d0; }
.hero-search { display: flex; gap: 0.5rem; max-width: 32rem; margin-top: 1.5rem; }
.hero-search input { flex: 1 1 auto; min-width: 0; }

.lead { font-size: 1.075rem; color: var(--body); }

/* Layout blocks */
.section { margin: 2.5rem 0; }
.breadcrumbs { padding-top: 1rem; font-size: 0.875rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--muted); margin-right: 0.4rem; }

.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 620px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }

.tool-card {
  display: flex; flex-direction: column; gap: 0.35rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; text-decoration: none; box-shadow: var(--shadow-card);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover { transform: translateY(-2px); border-color: var(--teal); }
.tool-card-category { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--teal-dark); font-weight: 700; }
.tool-card-name { font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.tool-card-desc { color: var(--body); font-size: 0.925rem; }

.link-list { list-style: none; padding: 0; }
.link-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.text-link { font-weight: 600; }

.pill-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.25rem 0; }
.pill { padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.pill.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.tool-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; padding-top: 1.5rem; }
@media (min-width: 1000px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.sidebar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1.25rem; }
.sidebar-card h2 { font-size: 1rem; }
.sidebar-card ul { list-style: none; padding: 0; margin: 0; }
.sidebar-card li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); font-size: 0.925rem; }
@media (min-width: 1000px) { .sidebar { position: sticky; top: 88px; align-self: start; } }

/* Calculator */
.calculator { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-card); margin: 1.5rem 0; }
.calculator-hint { font-size: 0.875rem; color: var(--muted); }
.field-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-grid { grid-template-columns: repeat(2, 1fr); } }
.calculator-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }

.results { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin-top: 1.5rem; }
.results-standalone { background: var(--surface); }
.results-title { font-size: 1rem; margin-bottom: 0.75rem; }
.results dl { margin: 0; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.result-row:last-child { border-bottom: 0; }
.result-row dt { color: var(--body); }
.result-row dd { margin: 0; font-weight: 700; color: var(--ink); text-align: right; }
.result-row.is-primary dd { color: var(--teal-dark); font-size: 1.2rem; }
.result-sub { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.result-note { font-size: 0.875rem; color: var(--muted); margin: 0.75rem 0 0; }
.result-error { color: var(--error-ink); margin: 0; font-weight: 600; }

.example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.example-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .example-grid { grid-template-columns: repeat(2, 1fr); } }

.faq-list details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.85rem 1rem; margin-bottom: 0.6rem; }
.faq-list summary { font-weight: 600; color: var(--ink); cursor: pointer; min-height: 32px; }
.faq-list details p { margin: 0.6rem 0 0; }

/* Prose */
.prose { max-width: 46rem; }
.prose-narrow { max-width: 42rem; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.25rem; }
.post-meta { color: var(--muted); font-size: 0.9rem; }
.post-nav { display: grid; gap: 0.75rem; margin: 2rem 0; grid-template-columns: 1fr; }
@media (min-width: 640px) { .post-nav { grid-template-columns: repeat(2, 1fr); } }
.post-nav-link { display: block; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; font-weight: 600; color: var(--ink); }
.post-nav-link span { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.post-nav-link.is-next { text-align: right; }

/* Alerts */
.alert { border-radius: var(--radius); padding: 0.9rem 1rem; border: 1px solid transparent; }
.alert-success { background: var(--success-bg); color: var(--success-ink); border-color: #b9e2c6; }
.alert-error { background: var(--error-bg); color: var(--error-ink); border-color: #f2c3c1; }
.alert ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }

/* Ads */
.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 96px; margin: 1.75rem 0; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface-alt); }
.ad-placeholder { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.ad-slot-sidebar { min-height: 250px; }

/* Footer */
.site-footer { background: var(--navy-dark); color: #c8d6e6; margin-top: 3.5rem; padding: 2.5rem 0 1.5rem; }
.footer-grid { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.site-footer h2 { font-size: 0.95rem; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 0.25rem 0; font-size: 0.925rem; }
.site-footer a { color: #c8d6e6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { font-weight: 700; color: #fff; font-size: 1.05rem; margin-bottom: 0.4rem; }
.footer-text { font-size: 0.925rem; max-width: 26rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); margin-top: 2rem; padding-top: 1rem; font-size: 0.85rem; }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow-card); max-width: 34rem; margin: 0 auto;
}
.cookie-banner p { margin: 0 0 0.75rem; font-size: 0.9rem; }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-actions button { min-height: 44px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--navy); background: var(--navy); color: #fff; font-weight: 600; cursor: pointer; }
.cookie-actions .secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }

.error-page { padding: 4rem 1rem; text-align: center; }
.error-page .btn { margin: 0.25rem; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .calculator-actions, .cookie-banner, .breadcrumbs, .sidebar { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-layout { display: block; }
}
