/* Layout: classic UK council front page — civic band header, task-led hero, service grid, trust panel, news, footer. Hosted pieces can be revealed with the demo toggle. */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --fg: #16212c;
  --muted: #4d5b69;
  --line: #d3dbe3;
  --council: #14365c;
  --council-ink: #ffffff;
  --council-soft: #e3ebf4;
  --link: #1a4f86;
  --focus: #ffdd00;
  --focus-ink: #0b0c0c;
  --ok: #1f6b3a;
  --ok-soft: #e2f1e7;
  --warn: #9a3412;
  --warn-soft: #fbe9de;
  --hosted: #7a3fb0;
  --hosted-soft: #f2eafa;
  --display: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 1.0625rem; line-height: 1.55; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; box-shadow: 0 0 0 6px var(--focus-ink); }
a:focus-visible { background: var(--focus); color: var(--focus-ink); text-decoration: none; box-shadow: 0 4px 0 var(--focus-ink); outline: none; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.2; }
h2 { font-size: 1.6rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.mono { font-family: var(--mono); font-size: 0.82em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* demo bar */
.demo-bar { background: var(--hosted-soft); color: var(--fg); border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.demo-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 8px; }
.demo-bar strong { color: var(--hosted); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked { background: var(--hosted); }
.switch input:checked::after { transform: translateX(18px); }

/* header */
.masthead { background: var(--council); color: var(--council-ink); border-bottom: 8px solid var(--focus); }
.masthead .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--council-ink); text-decoration: none; }
.brand svg { flex: none; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.45rem; line-height: 1.05; letter-spacing: -0.01em; }
.brand-name small { display: block; font-family: var(--body); font-weight: 400; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: .85; margin-top: 3px; }
.head-links { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.head-links a { color: var(--council-ink); font-weight: 700; }
.btn-signin { border: 2px solid var(--council-ink); padding: 6px 14px; text-decoration: none; display: inline-flex; flex-direction: column; line-height: 1.2; }
.btn-signin span { font-family: var(--mono); font-weight: 400; font-size: 0.7rem; opacity: .85; }
.nav { background: var(--surface); border-bottom: 1px solid var(--line); }
.nav ul { list-style: none; margin: 0; display: flex; flex-wrap: wrap; gap: 0 28px; padding-block: 10px; }
.nav a { font-weight: 700; text-decoration: none; color: var(--fg); padding-block: 4px; display: inline-block; border-bottom: 3px solid transparent; }
.nav a:hover { border-color: var(--council); }

/* hero */
.hero { background: var(--council-soft); padding-block: 36px 40px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; color: var(--fg); }
.hero p.lede { color: var(--muted); margin-top: 6px; max-width: 60ch; }
.search { display: flex; margin-top: 20px; max-width: 720px; }
.search input { flex: 1; min-width: 0; font: inherit; font-size: 1.15rem; padding: 12px 14px; border: 2px solid var(--fg); border-right: 0; background: var(--surface); color: var(--fg); border-radius: 0; }
.search button { font: inherit; font-weight: 700; padding: 0 22px; background: var(--council); color: var(--council-ink); border: 2px solid var(--council); cursor: pointer; }
.popular { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 0.95rem; color: var(--muted); }
.search-result { margin-top: 12px; font-size: 0.95rem; }

/* sections */
main section { padding-block: 40px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }

/* tasks */
.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.task { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--council); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.task .verb { font-family: var(--body); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.task h3 a { color: var(--link); }
.task p { color: var(--muted); font-size: 0.97rem; }
.task .dest { margin-top: auto; padding-top: 8px; color: var(--muted); display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.task .dest svg { flex: none; }

/* tools row */
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel .hint { color: var(--muted); font-size: 0.93rem; }
label { font-weight: 700; display: block; }
.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.field-row input { flex: 1 1 180px; min-width: 0; font: inherit; padding: 9px 12px; border: 2px solid var(--fg); background: var(--surface); color: var(--fg); border-radius: 0; }
.btn { font: inherit; font-weight: 700; padding: 9px 18px; background: var(--council); color: var(--council-ink); border: 2px solid var(--council); cursor: pointer; box-shadow: 0 3px 0 var(--focus-ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--focus-ink); }
.result { border-left: 5px solid var(--line); padding: 10px 14px; background: var(--bg); font-size: 0.97rem; }
.result.ok { border-color: var(--ok); background: var(--ok-soft); }
.result.bad { border-color: var(--warn); background: var(--warn-soft); }
.result strong { display: block; }
.result dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; margin: 8px 0 0; }
.result dt { color: var(--muted); }
.result dd { margin: 0; font-variant-numeric: tabular-nums; }
.widget-foot { font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }

/* trust panel */
.trust { background: var(--surface); border-block: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 860px) { .trust-grid { grid-template-columns: 1fr; } }
.trust .lede { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.rule { margin-top: 20px; border: 3px solid var(--council); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.rule .eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rule .domain { font-family: var(--mono); font-size: clamp(1.05rem, 3vw, 1.35rem); font-weight: 500; overflow-wrap: anywhere; }
.numbers { margin-top: 20px; display: grid; gap: 10px; }
.number { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.number .tel { font-family: var(--mono); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.number .what { color: var(--muted); font-size: 0.93rem; grid-column: 1; }
.copy { font: inherit; font-size: 0.85rem; padding: 4px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); cursor: pointer; grid-row: 1 / span 2; grid-column: 2; }
.lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px 24px; margin-top: 22px; }
.lists ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 0.97rem; }
.never h3 { color: var(--warn); }
.will h3 { color: var(--ok); }
.wa-start { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }

/* news */
.news-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 860px) { .news-grid { grid-template-columns: 1fr; } }
.news-list { display: grid; gap: 0; }
.news-item { padding-block: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.news-item:first-child { padding-top: 0; }
.news-item time, .meeting time { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.meetings { background: var(--surface); border: 1px solid var(--line); padding: 20px; display: grid; gap: 14px; align-content: start; }
.meeting { display: grid; gap: 2px; }

/* footer */
footer { background: var(--council); color: var(--council-ink); padding-block: 32px; margin-top: 8px; font-size: 0.95rem; }
footer a { color: var(--council-ink); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 20px 32px; }
footer ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
footer h2 { font-size: 1rem; }
.foot-base { border-top: 1px solid rgba(255,255,255,.25); margin-top: 24px; padding-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; opacity: .9; }

/* hosted reveal */
[data-hosted] { position: relative; }
body.show-hosted [data-hosted] { outline: 3px dashed var(--hosted); outline-offset: 4px; }
body.show-hosted [data-hosted]::before {
  content: attr(data-hosted);
  position: absolute; top: -14px; right: 8px; z-index: 2;
  background: var(--hosted); color: var(--surface);
  font: 500 0.72rem/1 var(--mono); padding: 5px 8px; letter-spacing: 0.02em;
  max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.legend { display: none; }
body.show-hosted .legend { display: block; }
.legend .wrap { padding-block: 10px; font-size: 0.9rem; color: var(--muted); }
.legend b { color: var(--hosted); }

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

/* Citizen services widget, served from services.anplacela.co.uk.
   Custom properties set on the element reach inside its shadow root: this is how the council brands it. */
citizen-verify-message {
  display: block;
  --mat-sys-primary: #14365c;
  --mat-sys-on-primary: #ffffff;
}
/* What shows until the widget loads, and to anyone whose browser cannot run it. */
citizen-verify-message:not(:defined) { display: grid; gap: 10px; }
citizen-verify-message:not(:defined) h2 { font-size: 1.3rem; }
