/* UK EV Charging News – shared stylesheet for every page. */

:root {
  --bg: #fbfaf7; --surface: #ffffff; --text: #14161a; --muted: #5d6470; --faint: #666d78; --line: #e7e4dc;
  --accent: #0f766e; --accent-ink: #0b5e58; --accent-soft: #e7f3f0; --warn: #b45309;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0c1015; --surface: #131920; --text: #e9ebee; --muted: #a0a9b6; --faint: #8490a0; --line: #232c37;
  --accent: #2dd4bf; --accent-ink: #5eead4; --accent-soft: #0f2a27; --warn: #fbbf24;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; font: 16px/1.6 var(--sans); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.mast { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.mast-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand svg { flex: none; display: block; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; letter-spacing: -.015em; }
.mast-right { display: flex; align-items: center; gap: 26px; }
.main-nav { display: flex; gap: 24px; font-weight: 500; font-size: .92rem; color: var(--muted); }
.main-nav a { padding: 22px 0; border-bottom: 2px solid transparent; transition: color .15s; }
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.mast-buttons { display: flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); padding: 0; }
.icon-btn:hover { color: var(--text); border-color: var(--faint); }
.icon-btn .sun, [data-theme="dark"] .icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
.menu-btn { display: none; }

.subbar { border-bottom: 1px solid var(--line); }
.subbar-inner { display: flex; align-items: center; gap: 14px; height: 44px; font-size: .84rem; color: var(--muted); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.subbar-inner::-webkit-scrollbar { display: none; }
.subbar strong { color: var(--text); font-weight: 600; }
.live { width: 7px; height: 7px; border-radius: 50%; background: #16a34a; flex: none; }
.sep { width: 1px; height: 16px; background: var(--line); flex: none; }
.tag { border: 0; background: none; padding: 0; cursor: pointer; color: var(--text); font-size: .84rem; }
.tag:hover, .tag[aria-pressed="true"] { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.tag + .tag::before { content: '·'; color: var(--faint); margin-right: 14px; display: inline-block; }

/* ---------- Shared bits ---------- */
.kicker { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.byline { font-size: .85rem; color: var(--muted); }
.byline b { color: var(--text); font-weight: 600; }
.coverage { color: var(--accent-ink); font-weight: 600; }
.text-link { color: var(--accent-ink); font-weight: 600; font-size: .9rem; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Two-column layout ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; margin-top: 34px; }
aside > section { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
aside > section:last-child { border-bottom: 0; }

/* ---------- Homepage front ---------- */
.lead { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.lead h1 { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1.1; letter-spacing: -.02em; margin: 10px 0 14px; max-width: 22ch; }
.lead h1 a:hover, .seconds h2 a:hover { color: var(--accent-ink); }
.also { list-style: none; padding: 0 0 0 14px; margin-top: 16px; border-left: 2px solid var(--line); font-size: .9rem; color: var(--muted); }
.also li { margin: 4px 0; }
.also a { color: var(--text); }
.also a:hover { color: var(--accent-ink); }
.seconds { display: grid; grid-template-columns: 1fr 1fr; padding: 24px 0 28px; border-bottom: 1px solid var(--line); }
.seconds > div:first-child { padding-right: 28px; border-right: 1px solid var(--line); }
.seconds > div:last-child { padding-left: 28px; }
.seconds h2 { font-family: var(--serif); font-weight: 600; font-size: 1.32rem; line-height: 1.22; letter-spacing: -.01em; margin: 8px 0 10px; }

/* ---------- Story list ---------- */
.list-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 34px 0 4px; flex-wrap: wrap; }
.list-head h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; letter-spacing: -.01em; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters input, .filters select { font-size: .86rem; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.filters input { width: 250px; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.day-split { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 22px 0 2px; }
.story-list { list-style: none; padding: 0; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.item time { font-size: .8rem; color: var(--faint); padding-top: 2px; font-variant-numeric: tabular-nums; }
.item a { font-weight: 600; line-height: 1.4; }
.item a:hover { color: var(--accent-ink); }
.item .src { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.empty { padding: 24px 0; color: var(--muted); }
.load { margin: 24px 0; width: 100%; height: 44px; font-weight: 600; font-size: .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.load:hover { border-color: var(--text); }
.load[hidden] { display: none; }

/* ---------- Sidebar widgets ---------- */
.week-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.week-num { display: flex; align-items: baseline; gap: 10px; }
.week-num strong { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.week-num span { font-size: .88rem; color: var(--muted); }
.facts { margin-top: 16px; border-top: 1px solid var(--line); }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; }
.facts dd a { font-weight: 600; }
.facts dd a:hover { color: var(--accent-ink); }
.facts .n { color: var(--faint); }
.week-box .text-link { display: inline-block; margin-top: 14px; }
.ranked { list-style: none; padding: 0; counter-reset: r; }
.ranked li { counter-increment: r; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ranked li:first-child { padding-top: 0; }
.ranked li:last-child { border-bottom: 0; padding-bottom: 0; }
.ranked li::before { content: counter(r); font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--accent); }
.ranked a { font-weight: 600; font-size: .92rem; line-height: 1.38; }
.ranked a:hover { color: var(--accent-ink); }
.ranked small { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.plain-list { list-style: none; padding: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.plain-list li:first-child { padding-top: 0; }
.plain-list a { font-weight: 600; font-size: .92rem; line-height: 1.38; }
.plain-list a:hover { color: var(--accent-ink); }
.plain-list small { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.chip-links { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-links a { font-size: .84rem; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.chip-links a:hover, .chip-links a[aria-current] { border-color: var(--accent); color: var(--accent-ink); }
.chip-links span { color: var(--faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: 40px 0 28px; border-bottom: 1px solid var(--line); }
.crumbs { font-size: .82rem; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-ink); }
.crumbs span[aria-hidden] { margin: 0 7px; }
.page-head h1 { font-family: var(--serif); font-weight: 600; font-size: 2.6rem; line-height: 1.1; letter-spacing: -.02em; max-width: 24ch; }
.page-head .intro { margin-top: 12px; font-size: 1.08rem; color: var(--muted); max-width: 64ch; }
.page-head .meta { margin-top: 14px; font-size: .85rem; color: var(--faint); }

/* ---------- Cards (networks / topics / about) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 34px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s; }
a.card:hover { border-color: var(--accent); }
.card h2, .card h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.25; }
.card .count { font-size: .8rem; font-weight: 600; color: var(--accent-ink); }
.card p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.card.quiet { opacity: .7; }

/* ---------- Prose (guide, FAQ, about, legal) ---------- */
.prose-wrap { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 56px; margin-top: 34px; }
.prose-wrap.solo { grid-template-columns: minmax(0, 720px); }
.toc { position: sticky; top: 100px; align-self: start; font-size: .88rem; }
.toc ol { list-style: none; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.prose { font-size: 1.02rem; line-height: 1.7; }
.prose > * + *, .prose section > * + * { margin-top: 1em; }
.prose h2 { font-family: var(--serif); font-weight: 600; font-size: 1.65rem; line-height: 1.2; letter-spacing: -.01em; margin-top: 2.2em; padding-top: .2em; }
.prose > h2:first-child, .prose > section:first-child > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.08rem; font-weight: 700; margin-top: 1.8em; }
.prose h2 + p, .prose h3 + p { margin-top: .5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose a:not(.card):not(.btn) { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose section { scroll-margin-top: 90px; }
.prose .lede { font-size: 1.15rem; color: var(--muted); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 18px 22px; }
.callout > * + * { margin-top: .6em; }
.callout h3 { margin-top: 0; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose td.num { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.def-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.def-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.def-grid h3 { margin: 0 0 6px; font-size: 1rem; }
.def-grid p { margin: 0; font-size: .93rem; color: var(--muted); line-height: 1.55; }
.steps { list-style: none; padding: 0 !important; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 46px; margin-top: 18px !important; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .9rem; display: grid; place-items: center; }
.steps strong { display: block; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq:first-of-type { border-top: 1px solid var(--line); }
details.faq summary { cursor: pointer; list-style: none; padding: 16px 32px 16px 0; font-weight: 600; position: relative; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: ''; position: absolute; right: 6px; top: 22px; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
details.faq[open] summary::after { transform: rotate(-135deg); top: 26px; }
details.faq summary:hover { color: var(--accent-ink); }
details.faq > div { padding: 0 0 18px; color: var(--muted); }
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.calc h3 { margin: 0 0 14px; }
.calc-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.calc label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.calc input, .calc select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.calc output { display: block; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.calc output small { display: block; font-family: var(--sans); font-size: .85rem; font-weight: 400; color: var(--muted); }
.btn { display: inline-block; background: var(--accent); color: var(--surface); font-weight: 600; padding: 11px 20px; border-radius: 8px; }
.btn:hover { background: var(--accent-ink); }

/* ---------- Weekly ---------- */
.summary-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 30px; }
.summary-facts div { background: var(--surface); padding: 16px 18px; }
.summary-facts dt { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.summary-facts dd { margin-top: 6px; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; line-height: 1.15; }
.summary-facts dd a:hover { color: var(--accent-ink); }
.summary-facts dd small { display: block; font-family: var(--sans); font-size: .8rem; font-weight: 400; color: var(--muted); }
.week-section h2 { font-family: var(--serif); font-weight: 600; font-size: 1.4rem; margin-top: 38px; }
.week-section h2 span { color: var(--faint); font-weight: 500; }
.week-list { list-style: none; padding: 0; }
.week-list li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.week-list a { font-weight: 600; }
.week-list a:hover { color: var(--accent-ink); }
.week-list span { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 90px 0 40px; }
.not-found .code { font-family: var(--serif); font-size: 5rem; font-weight: 600; color: var(--accent); line-height: 1; }
.not-found h1 { font-family: var(--serif); font-size: 2rem; font-weight: 600; margin: 14px 0 10px; }
.not-found p { color: var(--muted); margin-bottom: 26px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 72px; background: var(--surface); }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-top: 44px; padding-bottom: 30px; }
.foot p { font-size: .88rem; color: var(--muted); margin-top: 12px; max-width: 34ch; }
.foot h2 { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.foot ul { list-style: none; padding: 0; }
.foot li { margin: 7px 0; font-size: .9rem; }
.foot li a:hover { color: var(--accent-ink); }
.legal { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 28px; font-size: .8rem; color: var(--faint); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.legal a:hover { color: var(--accent-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; gap: 20px; }
  .menu-btn { display: grid; }
  .main-nav { display: none; position: absolute; top: 66px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 6px 24px 14px; box-shadow: 0 12px 24px rgba(0,0,0,.08); }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a:last-child { border-bottom: 0; }
  .main-nav a[aria-current] { color: var(--accent-ink); border-bottom-color: var(--line); }
  .foot { grid-template-columns: 1fr 1fr; }
  .prose-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 18px; }
  .lead h1 { font-size: 1.95rem; }
  .page-head h1 { font-size: 2rem; }
  .seconds { grid-template-columns: 1fr; }
  .seconds > div:first-child { padding: 0 0 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .seconds > div:last-child { padding: 20px 0 0; }
  .filters, .filters input, .filters select { width: 100%; }
  .filters input, .filters select { font-size: 16px; height: 42px; } /* under 16px, iOS Safari zooms the page on focus */
  .item { grid-template-columns: 52px 1fr; gap: 12px; }
  .brand-name { font-size: 1.08rem; }
  .mast-right { gap: 12px; }
  .foot { grid-template-columns: 1fr; gap: 24px; }
  .week-list li { flex-direction: column; gap: 2px; }
}
@media print {
  .mast, .subbar, .site-footer, aside, .filters, .load { display: none !important; }
}
