/* Regional hubs (/planning/regions/:region, views/region.ejs) on the Site Plan shell. base.css is loaded here;
   council.css supplies the drawing sheet (.cx-sheet) that council.js fills with the region's planning authorities. */

.page-region main { overflow: clip; }
.rg-h2 { font-size: clamp(30px, 3.4vw, 50px); max-width: 20ch; }
.rg-h3 { font-family: var(--font-display); font-size: clamp(22px, 2vw, 28px); font-weight: 600; line-height: 1.1; letter-spacing: -0.025em; color: var(--ink); }

/* ---------- Hero ---------- */
.rg-hero { background: var(--paper-2); padding: calc(var(--nav-clear) + clamp(14px, 2.4vw, 30px)) 0 clamp(48px, 6vw, 88px); }
.rg-crumbs { display: flex; flex-wrap: wrap; gap: 0 9px; margin-bottom: clamp(22px, 3vw, 40px); font: 400 12.5px/1.4 var(--font-mono); letter-spacing: 0; color: var(--ink-3); }
.rg-crumbs a { color: var(--ink-3); transition: color var(--dur-instant); }
.rg-crumbs a:hover { color: var(--ink); }
.rg-crumbs span[aria-hidden] { color: var(--ink-4); }
.rg-crumbs > span:last-child { color: var(--ink-2); }
.rg-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(32px, 5vw, 88px); align-items: start; }
.rg-hero-copy { display: grid; gap: 22px; justify-items: start; max-width: 44rem; }
.rg-h1 { font-size: clamp(40px, 4.4vw, 66px); line-height: .98; }
.rg-hero .lead { max-width: 36em; }
/* the homepage's postcode field */
.rg-search {
  position: relative; display: flex; align-items: center; gap: 8px; width: 100%; max-width: 560px; padding: 6px 6px 6px 48px; margin-top: 4px;
  background: var(--sheet); border-radius: 18px; box-shadow: 0 0 0 1px var(--rule-2), 0 10px 30px -14px rgba(18, 20, 23, .18);
  transition: box-shadow var(--dur-instant);
}
.rg-search:focus-within { box-shadow: 0 0 0 1.5px var(--amber-deep), 0 0 0 5px var(--amber-wash), 0 10px 30px -14px rgba(18, 20, 23, .18); }
.rg-search-ico { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; }
.rg-search input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; font-size: 17px; outline: none; color: var(--ink); }
.rg-search input::placeholder { color: var(--ink-3); }
.rg-search input:focus-visible { box-shadow: none; }
.rg-search .btn { flex: none; min-width: 120px; }
/* the map sheet: room is held for it whenever the page runs scripts (the motion gate's classes), so it moves nothing */
.rg-sheet { display: none; aspect-ratio: 5 / 4.3; width: 100%; }
:is(.pw-motion, .pw-static) .rg-sheet { display: block; }
@media (min-width: 1024px) {
  .rg-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 500px); }
}

/* ---------- Stats ---------- */
.rg-stats { border-bottom: 1px solid var(--rule); }
.rg-stat-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.rg-stat { padding: clamp(22px, 3vw, 36px) 20px clamp(22px, 3vw, 36px) 0; min-width: 0; }
.rg-stat + .rg-stat { padding-left: clamp(16px, 2.4vw, 32px); border-left: 1px solid var(--rule); }
.rg-stat dt { font: 500 11px/1.3 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.rg-stat dd { margin: 12px 0 0; font: 600 clamp(36px, 4.4vw, 64px)/.95 var(--font-display); letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Key facts beside the long read ---------- */
.rg-read { padding: clamp(64px, 8vw, 120px) 0; }
.rg-read-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 5vw, 80px); align-items: start; }
@media (min-width: 1024px) {
  .rg-read-grid { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .rg-facts { position: sticky; top: calc(var(--nav-clear) + 24px); }
}
.rg-facts { padding: 24px 24px 10px; border-radius: var(--r-lg); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); }
.rg-facts ol { counter-reset: rg-fact; margin-top: 16px; }
.rg-facts li { counter-increment: rg-fact; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-top: 1px solid var(--rule); font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.rg-facts li::before { content: counter(rg-fact, decimal-leading-zero); font: 500 12px/1.9 var(--font-mono); color: var(--amber-ink); }
.rg-prose { display: grid; gap: 18px; }
.rg-prose .rg-h2 { margin-bottom: 8px; }
.rg-prose p { font-size: 17.5px; line-height: 1.7; color: var(--ink-2); max-width: 64ch; text-wrap: pretty; }

/* ---------- Detailed council pages ---------- */
.rg-band { background: var(--paper-2); padding: clamp(64px, 8vw, 112px) 0; }
.rg-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 3vw, 44px); }
.rg-head p { font-size: 17px; color: var(--ink-2); max-width: 44em; }
.rg-councils { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rg-council {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px 14px 14px;
  border-radius: 16px; background: var(--sheet); box-shadow: var(--sh-1); transition: box-shadow var(--dur-instant) var(--ease-out), transform var(--dur-quick) var(--ease-out);
}
.rg-council:hover { box-shadow: 0 0 0 1px var(--rule-2), 0 12px 28px -18px rgba(17, 18, 20, .28); transform: translateY(-2px); }
.rg-council-art { width: 56px; height: 56px; border-radius: 12px; background: var(--blue-wash); display: grid; place-items: center; overflow: hidden; }
.rg-council-art svg { width: 46px; height: 46px; }
.rg-council-art path { fill: var(--sheet); stroke: var(--blue); stroke-linejoin: round; }
.rg-council-t { display: grid; gap: 3px; min-width: 0; }
.rg-council-t h3 { font: 600 15.5px/1.3 var(--font-sans); letter-spacing: -0.01em; color: var(--ink); }
.rg-council-t span { font-size: 13px; color: var(--ink-3); }
.rg-council:hover .rg-council-t span { color: var(--amber-ink); }

/* ---------- Directory ---------- */
.rg-dir-sec { padding: clamp(56px, 7vw, 96px) 0 0; }
.rg-dir summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--ink);
  font: 600 clamp(22px, 2.2vw, 30px)/1.15 var(--font-display); letter-spacing: -0.03em; color: var(--ink);
}
.rg-dir summary::-webkit-details-marker { display: none; }
.rg-dir summary::after {
  content: ""; margin-left: auto; width: 12px; height: 12px; flex: none;
  background: linear-gradient(var(--ink-2), var(--ink-2)) center / 12px 1.5px no-repeat, linear-gradient(var(--ink-2), var(--ink-2)) center / 1.5px 12px no-repeat;
  transition: transform var(--dur-quick) var(--ease-out);
}
.rg-dir[open] summary::after { transform: rotate(45deg); }
.rg-dir-list { columns: 4 220px; column-gap: 28px; padding-top: 10px; }
.rg-dir-list a { display: block; break-inside: avoid; padding: 9px 0; border-bottom: 1px solid var(--rule-soft); font-size: 15px; color: var(--ink); transition: color var(--dur-instant); }
.rg-dir-list a:hover { color: var(--amber-ink); }

/* ---------- Guides and sources ---------- */
.rg-more { padding: clamp(56px, 7vw, 96px) 0 clamp(64px, 8vw, 112px); }
.rg-more-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 5vw, 72px); }
@media (min-width: 900px) { .rg-more-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.rg-guides, .rg-sources { margin-top: 18px; border-top: 1px solid var(--rule); }
.rg-guide { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--rule); font-size: 16px; font-weight: 500; color: var(--ink); transition: color var(--dur-instant); }
.rg-guide svg { flex: none; color: var(--ink-3); transition: transform var(--dur-quick) var(--ease-out); }
.rg-guide:hover { color: var(--amber-ink); }
.rg-guide:hover svg { transform: translateX(3px); color: var(--amber-ink); }
.rg-sources li { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.rg-sources strong { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.rg-sources p { margin-top: 2px; font-size: 14.5px; color: var(--ink-3); }

/* ---------- Close: amber field ---------- */
.rg-cta { padding: clamp(72px, 9vw, 136px) 0; text-align: center; }
.rg-cta-in { display: grid; gap: 20px; justify-items: center; }
.rg-cta .h2 { max-width: 16ch; }
.rg-cta p { font-size: 18px; color: var(--ink-2); max-width: 34em; }
.rg-cta .btn { margin-top: 6px; background: #111214; color: #FFBE3B; }
.rg-cta .btn:hover { background: #2B2D31; }

/* ---------- Community discussion (comments.js injects its own styles; these sit on top) ---------- */
.page-region .pw-comments { max-width: calc(52rem + var(--gutter) * 2); margin: 0 auto; padding: clamp(48px, 6vw, 80px) var(--gutter); font-family: var(--font-sans); }
.page-region .pw-comments .pw-c-h { font: 600 clamp(24px, 2.2vw, 32px)/1.1 var(--font-display); letter-spacing: -0.03em; color: var(--ink); }
.page-region .pw-comments .pw-c-h span { color: var(--ink-3); font-weight: 500; }
.page-region .pw-comments .pw-c-sub { color: var(--ink-3); font-size: 15px; }
.page-region .pw-comments .pw-c-box { border-color: var(--rule-2); border-radius: var(--r-md); background: var(--sheet); color: var(--ink); }
.page-region .pw-comments .pw-c-btn { border-radius: var(--r-btn); background: var(--ink); color: var(--paper); height: 44px; padding: 0 18px; }
.page-region .pw-comments .pw-c-signin { border-color: var(--rule); border-radius: 14px; background: var(--paper-2); color: var(--ink-2); }
.page-region .pw-comments .pw-c-signin a { color: var(--ink); font-weight: 600; }
.page-region .pw-comments .pw-c-item { border-color: var(--rule); border-radius: 14px; background: var(--sheet); }
.page-region .pw-comments .pw-c-who { font-weight: 600; color: var(--ink); }
.page-region .pw-comments .pw-c-when { color: var(--ink-3); font-family: var(--font-mono); font-size: 12px; }
.page-region .pw-comments .pw-c-body { color: var(--ink-2); }
.page-region .pw-comments .pw-c-msg { color: var(--amber-ink); }

/* ---------- Phones ---------- */
@media (max-width: 767px) {
  .rg-stat-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rg-stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .rg-stat:nth-child(-n + 2) { border-bottom: 1px solid var(--rule); }
  .rg-sheet { aspect-ratio: 1 / 1.06; }
  .rg-dir-list { columns: 2 140px; column-gap: 18px; }
}
@media (max-width: 420px) {
  .rg-search { padding-left: 40px; }
  .rg-search-ico { left: 14px; }
  .rg-search .btn { min-width: 0; padding: 0 16px; font-size: 15px; --h: 46px; }
  .rg-search input { font-size: 16px; }
}
