/* Why Not Scotland — site styles
   Palette: stone, heather, moss, loch slate. No party colours. */

@font-face { font-family: "Newsreader"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/newsreader-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/public-sans-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #F4F1EA;
  --surface: #FAF8F3;
  --surface-alt: #E7E1D5;
  --band: #E3E6E1;
  --expert: #E9EDE8;
  --ink: #1F2622;
  --ink-2: #333B37;
  --muted: #4A514C;
  --faint: #626760;
  --line: #DDD6C8;
  --line-strong: #B9B1A1;
  --accent: #5E4A68;       /* heather */
  --accent-hover: #3F3047;
  --loch: #2F4650;
  --loch-ink: #D9E0DD;
  --neutral-rule: #6B7470;
  --hill-1: #B9C1C0; --hill-2: #8E9A8E; --hill-3: #7E6E80; --sky-1: #D5DDDB; --sky-2: #ECE9E0;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1280px;
  --gutter: clamp(16px, 5vw, 80px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; margin: 0; text-wrap: balance; }
p, ul, ol { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
sup a { text-decoration: none; font-size: 0.72em; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--loch); color: #fff; padding: 12px 16px; z-index: 10; }
.skip-link:focus { left: 16px; top: 16px; color: #fff; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--serif); font-size: 22px; line-height: 1; display: block; }
.brand-tag { font-size: 12px; color: var(--faint); letter-spacing: 0.03em; display: block; margin-top: 4px; }
.site-nav ul { list-style: none; padding: 0; display: flex; gap: 28px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .brand-tag { display: none; }
  .site-nav { display: none; }
  .nav-toggle { display: block; position: relative; }
  .nav-toggle summary { list-style: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
  .nav-toggle summary::-webkit-details-marker { display: none; }
  .nav-toggle ul { list-style: none; padding: 8px 0; margin: 0; position: absolute; right: 0; top: 48px; background: var(--surface); border: 1px solid var(--line); min-width: 240px; z-index: 5; box-shadow: 0 10px 30px rgba(31, 38, 34, 0.1); }
  .nav-toggle a { display: block; padding: 12px 18px; color: var(--ink); text-decoration: none; }
}

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; font-weight: 600; font-size: 16px; text-decoration: none; border: 1px solid transparent; }
.btn-primary { background: var(--loch); color: var(--surface); }
.btn-primary:hover { background: #22363E; color: var(--surface); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 400; }
.btn-secondary:hover { color: var(--ink); border-color: var(--ink); }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(var(--sky-1), var(--sky-2)); padding: 88px 0 150px; }
.hero-landscape { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 300px; }
.hero .wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 64px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; max-width: 680px; }
.hero-copy .eyebrow { color: #3F4A45; }
.hero h1 { font-size: clamp(38px, 5.2vw, 64px); line-height: 1.04; }
.hero-lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; color: var(--ink-2); max-width: 580px; }

.status { background: var(--surface); border: 1px solid #D4CCBC; padding: 26px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 30px rgba(31, 38, 34, 0.08); }
.status-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.status h2 { font-size: 22px; }
.status-updated { font-size: 12px; color: var(--faint); }
.status dl { margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; }
.status dl div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; border-top: 1px solid #E4DED2; padding-top: 12px; }
.status dt { color: var(--faint); }
.status dd { margin: 0; }
.status a { font-size: 14px; font-weight: 600; }

@media (max-width: 1000px) {
  .hero { padding: 40px 0 110px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-landscape { height: 140px; }
  .status dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Sections */
.section { padding: 72px 0 32px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(30px, 3vw, 40px); }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; }
.card { display: flex; flex-direction: column; gap: 12px; height: 100%; background: var(--surface); border: 1px solid var(--line); padding: 28px; text-decoration: none; color: var(--ink); }
.card:hover { color: var(--ink); border-color: var(--accent); }
.card .eyebrow { color: var(--accent); }
.card h3 { font-size: 26px; line-height: 1.15; }
.card p { font-size: 15px; line-height: 1.5; color: var(--muted); }
@media (max-width: 1000px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .card { padding: 18px; }
  .card h3 { font-size: 21px; }
  .card p { display: none; }
}

.principles { background: var(--surface-alt); padding: 48px 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; margin: 40px 0; }
.principles h3 { font-size: 24px; margin-bottom: 10px; }
.principles p { font-size: 15px; line-height: 1.55; color: #3F4642; }
@media (max-width: 900px) { .principles { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 32px 24px; } }

.feature-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-bottom: 80px; }
.feature-pair .card h3 { font-size: 24px; }
.feature-pair .card .eyebrow { color: var(--faint); }
@media (max-width: 800px) { .feature-pair { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.site-footer { background: var(--loch); color: var(--loch-ink); font-size: 14px; line-height: 1.6; margin-top: 40px; }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; padding-top: 48px; padding-bottom: 48px; }
.site-footer h2 { font-size: 15px; font-family: var(--sans); font-weight: 600; color: var(--surface); margin-bottom: 8px; }
.site-footer .footer-name { font-family: var(--serif); font-size: 22px; color: var(--surface); margin-bottom: 8px; }
.site-footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.site-footer a { color: var(--loch-ink); }
.site-footer a:hover { color: #fff; }
.imprint { color: #A9B6B2; margin-top: 10px; }
@media (max-width: 800px) { .site-footer .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* Topic page */
.page-band { background: var(--band); border-bottom: 1px solid #D4D8D1; padding: 44px 0 48px; }
.page-band .wrap { display: flex; flex-direction: column; gap: 14px; }
.breadcrumb ol { list-style: none; padding: 0; display: flex; gap: 8px; font-size: 14px; color: var(--muted); }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; }
.breadcrumb a { color: var(--muted); }
.page-band h1 { font-size: clamp(36px, 4.5vw, 56px); line-height: 1.05; }
.page-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--muted); }

.topic-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: 56px; align-items: start; padding-top: 56px; padding-bottom: 56px; }
.toc { position: sticky; top: 24px; font-size: 14px; }
.toc ol { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.toc a { color: var(--muted); text-decoration: none; display: block; padding-left: 14px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--accent); }

.topic-main { display: flex; flex-direction: column; gap: 48px; max-width: 720px; min-width: 0; }
.topic-main h2 { font-size: 32px; margin-bottom: 14px; scroll-margin-top: 24px; }
.topic-main p { font-size: 18px; line-height: 1.65; }
.panel { background: var(--surface); border: 1px solid var(--line); padding: 28px 32px; }
.panel h2 { font-size: 28px; }
.bullets { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 17px; line-height: 1.55; }

.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.side { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--neutral-rule); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.topic-main .side h2 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 0; }
.side .bullets { font-size: 16px; }
.topic-main .side-source { font-size: 13px; color: var(--faint); margin-top: auto; }
@media (max-width: 700px) { .sides { grid-template-columns: minmax(0, 1fr); } }

.experts { background: var(--expert); padding: 28px 32px; }
.experts .title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.topic-main .experts .title h2 { margin: 0; font-size: 28px; }
.experts svg { width: 22px; height: 22px; flex: none; }

.questions { border-top: 1px solid var(--line); }
.questions details { border-bottom: 1px solid var(--line); padding: 18px 0; }
.questions summary { cursor: pointer; font-weight: 600; font-size: 17px; min-height: 28px; }
.questions details p { margin-top: 10px; font-size: 17px; color: #3F4642; }

.sources { border-top: 1px solid var(--line); padding-top: 24px; font-size: 14px; line-height: 1.6; color: #3F4642; }
.sources h2, .topic-main .sources h2 { font-size: 22px; color: var(--ink); }
.sources ol { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

.topic-aside { display: flex; flex-direction: column; gap: 20px; font-size: 14px; line-height: 1.5; }
.aside-box { background: var(--surface); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.aside-box dl { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.aside-box dl div { display: flex; gap: 10px; }
.aside-box dt { font-weight: 600; min-width: 72px; }
.aside-box dd { margin: 0; }
.aside-box ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.aside-dashed { padding: 22px; border: 1px dashed var(--line-strong); }

@media (max-width: 1100px) {
  .topic-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .toc { position: static; background: var(--surface); border: 1px solid var(--line); padding: 18px; }
  .topic-main { max-width: none; }
}
@media (max-width: 640px) {
  .panel, .experts { padding: 22px 18px; }
  .topic-main h2 { font-size: 27px; }
  .topic-main p { font-size: 17px; }
}

/* Placeholder marker — remove once content is sourced */
.todo { background: #FFF4D6; outline: 1px dashed #C9A13A; padding: 0 4px; }

@media print {
  .site-header, .site-footer, .toc, .topic-aside, .hero-landscape { display: none; }
  body { background: #fff; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; }
}

/* Generic content pages */
.page-lede { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 760px; }
.prose { max-width: 760px; padding-top: 48px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 18px; }
.prose h2 { font-size: 30px; margin-top: 24px; }
.prose h3 { font-size: 22px; margin-top: 8px; }
.prose p, .prose li { font-size: 17px; line-height: 1.65; }
.prose ul, .prose ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.timeline { list-style: none; padding: 0 !important; border-left: 2px solid var(--line-strong); gap: 22px !important; }
.timeline li { padding-left: 22px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; background: var(--surface); border: 2px solid var(--accent); border-radius: 50%; }
.timeline .when { display: block; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { font-weight: 600; background: var(--surface-alt); }
.table-scroll { overflow-x: auto; }
.glossary dt { font-family: var(--serif); font-size: 22px; margin-top: 18px; }
.glossary dd { margin: 4px 0 0; font-size: 17px; line-height: 1.6; }
.qa { border-top: 1px solid var(--line); padding-top: 18px; }
.qa h2 { font-size: 24px; margin: 0 0 8px; }
.note { background: var(--surface); border: 1px solid var(--line); padding: 18px 20px; font-size: 15px; }

/* Pro-independence topic layout */
.panel.case { border-top: 4px solid var(--loch); }
.side-challenge { border-top-color: var(--accent); }
.side-plan { border-top-color: #4E6A58; }
