/*
Theme Name: Bandeath Green Compute & Heat
Theme URI: https://cllralasdairmacpherson.co.uk/
Author: Cllr Alasdair MacPherson
Description: Lightweight, mobile-first heritage theme for the Bandeath Green Compute & Heat proposal. Shares the Polmaise coalfield dark palette used on the Fallin Minewater site. Includes ready-made pages, menus and built-in SEO (meta descriptions, Open Graph, structured data) that steps aside if an SEO plugin is active.
Version: 1.0.4
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bandeath-gch
Tags: one-column, custom-logo, custom-menu, accessibility-ready, block-styles, wide-blocks
*/

/* ---------- Palette (Polmaise coalfield dark heritage, shared with Fallin Minewater) ---------- */
:root {
	--coal: #101413;
	--coal-deep: #0b1210;
	--page: #171e1b;
	--panel: #1d2622;
	--green: #263e35;
	--green-card: #203a30;
	--green-line: #54715c;
	--copper: #b87848;
	--copper-light: #e0a775;
	--copper-pale: #f4c99c;
	--river: #6fb3dd;
	--ink: #e8dfd0;
	--ink-soft: #c9bfae;
	--paper: #f2ede3;
	--paper-ink: #1d3d33;
	--rule: #33413b;
	--serif: Georgia, "Times New Roman", serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--wrap: 1160px;
	--content: 850px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.7 var(--sans); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--copper-light); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, a:focus { color: #f5c89b; }
:focus-visible { outline: 3px solid var(--copper-pale); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.2; color: #f4ece0; margin: 1.8em 0 .55em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); margin-top: .3em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); }
h3 { font-size: clamp(1.18rem, 2.4vw, 1.4rem); }
p, ul, ol { margin: 0 0 1.1em; }
li { margin-bottom: .45em; }
strong { color: #f6eee2; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5em 0; }
blockquote { margin: 1.6em 0; padding: .4em 0 .4em 1.2em; border-left: 3px solid var(--copper); font-family: var(--serif); font-size: 1.1rem; color: #efe6d8; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; word-wrap: normal !important; }
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; left: 12px; top: 12px; z-index: 2147483647; background: var(--paper); color: var(--paper-ink); padding: 10px 16px; border-radius: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.content { max-width: var(--content); }

/* ---------- Header ---------- */
.site-header { background: var(--coal); border-bottom: 3px solid var(--copper); position: sticky; top: 0; z-index: 1000; }
.header-inner { max-width: 1320px; margin: 0 auto; padding: 12px 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.site-branding { flex: 0 1 auto; min-width: 0; }
.site-branding a { display: block; line-height: 0; }
.site-branding img { height: 120px; width: auto; display: block; }
.site-branding picture { display: block; }
.header-search { margin-left: auto; }
.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] { background: #18211e; border: 1px solid #3c4a44; color: var(--ink); padding: 9px 12px; border-radius: 3px; font: 15px var(--sans); width: 220px; }
.search-form button, .menu-toggle, .drawer-close { font: 600 14px var(--sans); cursor: pointer; border-radius: 3px; }
.search-form button { background: var(--copper); color: var(--coal); border: 0; padding: 9px 14px; }
.menu-toggle { background: var(--green); color: #f0e4d1; border: 1px solid #a87d59; padding: 9px 14px; white-space: nowrap; }
.menu-toggle:hover { background: #2f4c41; }
@media (max-width: 860px) {
	/* Row 1: logo fills the width. Row 2: search left, menu right. */
	.site-header { position: relative; }
	.header-inner { padding: 10px 8px 12px; gap: 12px; }
	.site-branding { flex: 0 0 100%; }
	.site-branding img { width: 100%; height: auto; max-height: none; }
	.header-search { display: block; margin-left: 0; flex: 1 1 0; min-width: 0; padding-left: 6px; }
	.header-search .search-form { width: 100%; }
	.header-search .search-form input[type="search"] { flex: 1 1 auto; width: auto; min-width: 0; padding: 11px 12px; font-size: 16px; }
	.header-search .search-form button { padding: 11px 14px; }
	.menu-toggle { margin-left: 0; margin-right: 6px; flex: 0 0 auto; padding: 11px 14px; font-size: 15px; }
}

/* ---------- Drawer navigation ---------- */
.nav-backdrop { position: fixed; inset: 0; background: rgba(5,13,11,.70); opacity: 0; visibility: hidden; transition: opacity .3s; z-index: 2147482999; }
.primary-navigation { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 54vw); background: var(--paper); color: var(--paper-ink); border-left: 3px solid var(--copper); box-shadow: -24px 0 70px rgba(0,0,0,.38); transform: translateX(105%); visibility: hidden; transition: transform .42s cubic-bezier(.2,.75,.2,1), visibility .42s; z-index: 2147483000; overflow-y: auto; padding: 22px 28px 40px; }
.nav-open .primary-navigation { transform: none; visibility: visible; }
.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
.nav-open { overflow: hidden; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d8cdbb; padding-bottom: 14px; margin-bottom: 18px; }
.drawer-label { font: 700 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #996640; }
.drawer-close { background: transparent; border: 1px solid #c5b59e; color: var(--paper-ink); padding: 7px 12px; }
.drawer-title { font: 400 1.6rem/1.2 var(--serif); color: var(--paper-ink); margin: 0 0 18px; }
.drawer-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.drawer-group h2 { font: 700 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #996640; margin: 0 0 8px; }
.drawer-group ul { list-style: none; margin: 0; padding: 0; }
.drawer-group li { margin: 0; }
.drawer-group a { display: block; font: 400 16px/1.38 var(--serif); color: var(--paper-ink); text-decoration: none; padding: 8px 10px; border-radius: 3px; }
.drawer-group a:hover, .drawer-group a:focus, .drawer-group .current-menu-item > a { color: #9d5831; background: #e6ddcf; }
.drawer-search { margin-top: 26px; }
.drawer-search input[type="search"] { background: #fff; color: #222; border-color: #c5b59e; flex: 1; width: auto; }
@media (max-width: 720px) { .primary-navigation { width: 100vw; border-left: 0; padding: 18px 20px 40px; } .drawer-groups { grid-template-columns: 1fr; gap: 18px; } }

/* ---------- Main ---------- */
.site-main { padding: 30px 0 70px; }
.breadcrumbs { font-size: 14px; color: var(--ink-soft); margin: 4px 0 14px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--copper); }
.breadcrumbs a { color: var(--ink-soft); }
.entry-header { border-bottom: 1px solid var(--rule); margin-bottom: 26px; padding-bottom: 8px; }
.entry-meta, .bg-meta { font-size: 14px; color: var(--ink-soft); letter-spacing: .02em; }
.bg-meta span { color: var(--copper-light); }
.entry-content > * { max-width: var(--content); }
.entry-content > .bg-hero, .entry-content > .bg-cards, .entry-content > .bg-stats, .entry-content > .bg-table, .entry-content > .wp-block-table, .entry-content > .alignwide, .entry-content > .bg-publisher { max-width: 1040px; }
.bg-lead { font-family: var(--serif); font-size: clamp(1.12rem, 2.3vw, 1.3rem); line-height: 1.55; color: #efe6d8; }
.bg-eyebrow { font: 700 12px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--copper-light); margin-bottom: .4em; }
.bg-note { font-size: 14.5px; color: var(--ink-soft); border-left: 3px solid var(--green-line); padding-left: 14px; }

/* Buttons */
.button, .wp-block-button__link { display: inline-block; background: #c48b5a; color: var(--coal) !important; padding: 13px 22px; border-radius: 3px; text-decoration: none; font-weight: 600; border: 1px solid #c48b5a; margin: 4px 8px 4px 0; }
.button:hover, .wp-block-button__link:hover { background: #e7b985; border-color: #e7b985; }
.button.outline { background: transparent; color: #f4e8d5 !important; border-color: #a87d59; }
.button.outline:hover { background: var(--green); }

/* Hero */
.bg-hero { background: linear-gradient(160deg, #1b2a24 0%, #121916 70%); border: 1px solid #2c3b35; border-top: 3px solid var(--copper); border-radius: 6px; padding: clamp(24px, 5vw, 52px); margin: 6px 0 34px; }
.bg-hero h1 { margin: .15em 0 .35em; max-width: 950px; }
.bg-hero .bg-lead { max-width: 790px; }
.bg-actions { margin: 18px 0 0; }

/* Stats */
.bg-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 18px 0 14px; }
.bg-stat { background: var(--green-card); border: 1px solid var(--green-line); border-radius: 5px; padding: 16px 14px; }
.bg-stat strong { display: block; font: 700 clamp(1.25rem, 2.4vw, 1.75rem)/1.2 var(--serif); color: var(--copper-pale); margin-bottom: 6px; }
.bg-stat span { display: block; font-size: .82rem; line-height: 1.45; color: #eee9dd; }
@media (max-width: 900px) { .bg-stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px) { .bg-stats { grid-template-columns: 1fr; } }

/* Cards */
.bg-cards { display: grid; gap: 14px; margin: 16px 0 18px; }
.bg-cards-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.bg-cards-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.bg-card { background: var(--panel); border: 1px solid #2f3d37; border-top: 3px solid var(--green-line); border-radius: 6px; padding: 18px 20px; }
.bg-card h3 { margin: .1em 0 .4em; }
.bg-card p:last-child, .bg-card ul:last-child { margin-bottom: 0; }
.bg-card ul { padding-left: 1.1em; }
.bg-card-tag { font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--copper-light); margin: 0 0 4px; }
@media (max-width: 860px) { .bg-cards-3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) { .bg-cards-2 { grid-template-columns: 1fr; } }

/* Link list */
.bg-linklist { list-style: none; padding: 0; }
.bg-linklist li { border-bottom: 1px solid var(--rule); padding: 10px 0; margin: 0; }
.bg-linklist a { font-family: var(--serif); font-size: 1.12rem; display: block; }

/* Timeline */
.bg-timeline { list-style: none; padding: 0; margin: 14px 0 22px; counter-reset: step; }
.bg-timeline li { position: relative; padding: 0 0 18px 44px; margin: 0; counter-increment: step; }
.bg-timeline li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--green); border: 1px solid var(--copper); color: var(--copper-pale); font: 700 14px/28px var(--sans); text-align: center; }
.bg-timeline li::after { content: ""; position: absolute; left: 15px; top: 32px; bottom: 2px; width: 1px; background: #3b4a43; }
.bg-timeline li:last-child::after { display: none; }

/* Tables */
.wp-block-table, .bg-table { margin: 16px 0 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wp-block-table table, .bg-table table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.wp-block-table th, .wp-block-table td { border: 1px solid #34433c; padding: 10px 12px; text-align: left; vertical-align: top; }
.wp-block-table thead th { background: var(--green); color: #f4e8d5; font-weight: 600; }
.wp-block-table tbody th { background: #1a2420; font-weight: 600; color: #efe6d8; }
.wp-block-table tbody tr:nth-child(even) td { background: #1a221f; }

/* FAQ */
.bg-faq details { border: 1px solid #2f3d37; border-radius: 5px; background: var(--panel); margin: 0 0 10px; }
.bg-faq summary { cursor: pointer; padding: 14px 18px; font: 400 1.12rem/1.35 var(--serif); color: #f4ece0; list-style: none; position: relative; padding-right: 44px; }
.bg-faq summary::-webkit-details-marker { display: none; }
.bg-faq summary::after { content: "+"; position: absolute; right: 18px; top: 12px; color: var(--copper-light); font: 400 1.4rem var(--sans); }
.bg-faq details[open] summary::after { content: "–"; }
.bg-faq details > p { padding: 0 18px 14px; margin: 0; }

/* Publisher credit */
.bg-publisher { background: var(--green-card); border: 1px solid var(--green-line); border-radius: 5px; padding: clamp(20px, 4vw, 34px); margin-top: 40px; }
.bg-publisher h2 { margin-top: .1em; }

/* Posts list */
.post-list { list-style: none; padding: 0; }
.post-list li { border-bottom: 1px solid var(--rule); padding: 18px 0; }
.post-list h2 { margin: 0 0 .3em; font-size: 1.4rem; }
.pagination { margin-top: 30px; }
.pagination .page-numbers { display: inline-block; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 3px; margin-right: 4px; text-decoration: none; }
.pagination .current { background: var(--green); }

/* ---------- Footer ---------- */
.site-footer { background: var(--coal-deep); padding-top: 56px; border-top: 3px solid var(--copper); color: #d8d0c3; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr) minmax(0,1fr); gap: 36px; }
.footer-brand img { height: 64px; width: auto; margin-bottom: 14px; }
.site-footer h2 { font: 400 23px/1.2 var(--serif); color: #e5bb91; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 8px; }
.site-footer a { color: #e5d6c0; }
.site-footer a:hover { color: #e7ac79; }
.footer-bottom { border-top: 1px solid #26312c; margin-top: 40px; padding: 18px 0 28px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; font-size: 14px; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }

/* ---------- WordPress core alignment ---------- */
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--ink-soft); }
.entry-content img { border-radius: 7px; }
.sticky, .bypostauthor, .gallery-caption { outline: 0; }

/* ---------- Print ---------- */
@media print {
	.site-header, .site-footer, .primary-navigation, .nav-backdrop, .breadcrumbs, .bg-actions { display: none !important; }
	body { background: #fff; color: #111; font-size: 12pt; }
	h1, h2, h3, strong, .bg-lead, .bg-stat strong { color: #111 !important; }
	.bg-hero, .bg-card, .bg-stat, .bg-publisher { background: #fff !important; border-color: #999 !important; }
	a { color: #111; }
}

/* ---------- Small-screen refinements ---------- */
@media (max-width: 600px) {
	body { font-size: 16.5px; }
	.wp-block-table table, .bg-table table { font-size: 14px; min-width: 460px; }
	.wp-block-table th, .wp-block-table td { padding: 8px 9px; }
	.wp-block-table, .bg-table { background: linear-gradient(to left, rgba(16,20,19,.9), rgba(16,20,19,0) 28px) right / 28px 100% no-repeat; }
	.bg-hero { padding: 22px 18px; }
	.bg-actions .button { display: block; text-align: center; margin-right: 0; }
}

/* ---------- Cookie bar ---------- */
.cookie-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 2147482000; border-radius: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.45); transform: translateY(130%); opacity: 0; transition: transform .35s ease, opacity .35s ease; }
.cookie-bar.is-visible { transform: none; opacity: 1; }
.cookie-bar__inner { max-width: 1160px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; gap: 18px 26px; }
.cookie-bar__text { margin: 0; font-size: 15px; line-height: 1.55; flex: 1 1 auto; }
.cookie-bar__text strong { color: inherit; }
.cookie-bar__text a { color: inherit; font-weight: 600; text-decoration: underline; }
.cookie-bar__actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-bar__btn { font: 700 15px var(--sans); padding: 11px 20px; border-radius: 3px; cursor: pointer; border: 2px solid transparent; white-space: nowrap; }
/* Copper (default) */
.cookie-bar--copper { background: #c48b5a; color: #101413; border: 1px solid #e7b985; }
.cookie-bar--copper .cookie-bar__btn--accept { background: #101413; color: #f4e8d5; }
.cookie-bar--copper .cookie-bar__btn--reject { background: transparent; color: #101413; border-color: #101413; }
/* Heritage green */
.cookie-bar--green { background: var(--green); color: #f4ece0; border: 1px solid var(--copper); border-top: 4px solid var(--copper); }
.cookie-bar--green .cookie-bar__btn--accept { background: #c48b5a; color: #101413; }
.cookie-bar--green .cookie-bar__btn--reject { background: transparent; color: #f4e8d5; border-color: #c9a27e; }
.cookie-bar--green .cookie-bar__text a { color: var(--copper-pale); }
/* Forth blue */
.cookie-bar--river { background: #1f4f6b; color: #f2f6f8; border: 1px solid #6fb3dd; border-top: 4px solid #6fb3dd; }
.cookie-bar--river .cookie-bar__btn--accept { background: #f2ede3; color: #12303f; }
.cookie-bar--river .cookie-bar__btn--reject { background: transparent; color: #f2f6f8; border-color: #9fd0ec; }
.cookie-bar__btn:hover { filter: brightness(1.1); }
.cookie-bar__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.cookie-settings-link { background: none; border: 0; padding: 0; color: #e5d6c0; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cookie-settings-link:hover { color: #e7ac79; }
@media (max-width: 700px) {
	.cookie-bar { left: 8px; right: 8px; bottom: 8px; }
	.cookie-bar__inner { flex-direction: column; align-items: stretch; padding: 14px 16px; }
	.cookie-bar__text { font-size: 14.5px; }
	.cookie-bar__actions .cookie-bar__btn { flex: 1 1 0; }
}
@media print { .cookie-bar { display: none !important; } }
