/* UK Settlement Hub — design tokens
   Direction: civic clarity. Navy ink on cool paper, "granted" green for
   actions, amber reserved for proposed-rule warnings. The signature element
   is the rule-status badge + last-verified chip on every article: the design
   itself encodes whether a rule is law yet. */

:root {
  --ink: #16263F;        /* headings, header bar */
  --text: #35404E;       /* body */
  --paper: #F6F7F5;      /* background */
  --card: #FFFFFF;
  --granted: #0E7A5F;    /* links, CTAs, "current rule" */
  --granted-soft: #E2F0EA;
  --proposed: #9A5B12;   /* "proposed change" */
  --proposed-soft: #F6E9D7;
  --line: #DFE3DD;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Public Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }

h1, h2, h3 { font-family: var(--display); color: var(--ink); line-height: 1.15; }
a { color: var(--granted); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--granted); outline-offset: 2px; }

.mono { font-family: var(--mono); font-size: 0.82rem; }

/* Header */
.site-header { background: var(--ink); }
.header-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; padding: 0.8rem 1.25rem; }
.brand { font-family: var(--display); font-weight: 700; color: #fff; text-decoration: none; font-size: 1.15rem; }
.brand-mark { background: #fff; color: var(--ink); padding: 0 0.35rem; border-radius: 3px; margin-right: 0.15rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-nav a { color: #D9DFE9; text-decoration: none; font-size: 0.92rem; }
.site-nav a:hover { color: #fff; text-decoration: underline; }

/* Masthead */
.masthead { padding: 3rem 0 2rem; }
.eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--granted); margin: 0 0 0.75rem; }
.masthead h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 1rem; font-weight: 700; }
.lede { font-size: 1.1rem; max-width: 42rem; margin: 0 0 2rem; }

/* Tool cards */
.tool-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--granted); border-radius: 6px;
  padding: 1rem 1.1rem; text-decoration: none; color: var(--text);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(22,38,63,0.10); color: var(--text); }
.tool-name { display: block; font-family: var(--display); font-weight: 700; color: var(--ink); margin-bottom: 0.25rem; }
.tool-desc { font-size: 0.9rem; }

/* Listings */
.home-section { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.page-title { padding-top: 2rem; }
.update-list, .guide-list { list-style: none; margin: 0; padding: 0; }
.update-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--line); }
.update-list .date { color: var(--ink); margin-right: 0.6rem; }
.update-list p, .guide-list p { margin: 0.2rem 0 0; font-size: 0.92rem; }
.guide-list li { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.guide-list a { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }

/* Article */
.article { padding: 2rem 0; }
.article-head h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin-bottom: 0.75rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1.5rem; }
.badge {
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500;
  padding: 0.2rem 0.55rem; border-radius: 999px;
}
.badge-current { background: var(--granted-soft); color: var(--granted); }
.badge-proposed { background: var(--proposed-soft); color: var(--proposed); }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.55rem; color: var(--text); }

.prose h2 { margin-top: 2rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.5rem 0.7rem; text-align: left; overflow-wrap: anywhere; }
.prose th { background: var(--card); font-family: var(--mono); font-size: 0.8rem; }
.prose blockquote { border-left: 4px solid var(--line); margin-left: 0; padding-left: 1rem; color: #5A6472; }
.prose code { font-family: var(--mono); background: var(--card); border: 1px solid var(--line); border-radius: 3px; padding: 0 0.3rem; font-size: 0.85em; overflow-wrap: anywhere; }
/* Safety net: any wide element (a table, a long unbroken code line) scrolls
   within the prose column instead of pushing the whole page wider on mobile. */
.prose { max-width: 100%; overflow-x: auto; }

/* Buttons (shared across tool pages and the cookie banner) */
.btn {
  font: inherit; font-weight: 600; padding: 0.5rem 0.95rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.btn:hover { border-color: var(--granted); color: var(--granted); }
.btn-primary { background: var(--granted); border-color: var(--granted); color: #fff; }
.btn-primary:hover { background: #0b6350; color: #fff; }
.btn-ghost { background: transparent; }

.disclaimer-block {
  margin-top: 2.5rem; padding: 1rem 1.1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; font-size: 0.88rem;
}

/* Footer */
.site-footer { margin-top: 3rem; background: var(--ink); color: #C6CEDA; padding: 2rem 0; font-size: 0.88rem; }
.site-footer a { color: #D9DFE9; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; }
.foot-copy { color: #8B96A8; }

@media (prefers-reduced-motion: reduce) {
  .tool-card { transition: none; }
}

/* Ad slots */
.ad-slot {
  margin: 1.75rem 0; padding: 0.6rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; text-align: center; overflow: hidden;
}
.ad-slot-label {
  margin: 0 0 0.4rem; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: #8B96A8; text-align: left;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--ink); color: #D9DFE9; padding: 1rem 1.25rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}
.cookie-banner p { margin: 0; max-width: 46rem; font-size: 0.9rem; }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 0.6rem; flex-shrink: 0; }
.cookie-banner .btn-ghost { background: transparent; color: #D9DFE9; border-color: #4A5568; }
.cookie-banner .btn-ghost:hover { color: #fff; border-color: #fff; }

@media (max-width: 560px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: left; }
  .cookie-banner-actions { justify-content: flex-end; }
}
