/*
Theme Name: Compound Design
Theme URI: https://www.compounddesign.co.uk/
Author: Compound Design
Description: A clean, lightweight theme for Compound Design. Fixed full-screen background image, logo header bar, editable menu, contact form and map, all managed from the WordPress admin (Appearance > Customize, Appearance > Menus, Pages).
Version: 1.0.0
Requires at least: 5.8
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: compound-design
*/

:root {
	--lime: #c0e010;
	--grey: #686868;
	--ink: #2b2b2b;
	--link: #567200;
	--panel: rgba(255, 255, 255, 0.92);
}

*, *::before, *::after { box-sizing: border-box; }

html { background: #ececec; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: var(--ink);
	background: transparent;
}

/* Fixed background: stays put while the text scrolls (also works on iOS) */
body::before {
	content: "";
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: -1;
	background: #ececec url("assets/images/background.jpg") center center / cover no-repeat;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover, a:focus { color: #000; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 8px; left: 8px; z-index: 100;
	background: #fff; padding: 0.75rem 1rem;
}

/* ---------- Header bar ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, 0.96);
	border-bottom: 5px solid var(--lime);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}
body.admin-bar .site-header { top: 32px; }

.header-inner {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0.5rem 1.25rem;
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.site-logo { display: block; line-height: 0; flex: 0 0 auto; }
.site-logo img { height: 68px; width: auto; display: block; }

.site-tagline {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.3;
	color: var(--grey);
	flex: 1 1 auto;
}

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; }
.main-nav a {
	display: block;
	padding: 0.55rem 0.9rem;
	color: var(--grey);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.9rem;
	text-decoration: none;
	border-bottom: 4px solid transparent;
}
.main-nav a:hover, .main-nav a:focus { color: #000; border-bottom-color: var(--lime); }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: #000; border-bottom-color: var(--lime); }

.menu-toggle {
	display: none;
	margin-left: auto;
	background: var(--lime);
	color: #222;
	border: 0;
	padding: 0.6rem 1rem;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
	border-radius: 3px;
}

/* ---------- Content ---------- */
.site-main { max-width: 960px; margin: 2.5rem auto; padding: 0 1.25rem; }

.panel {
	background: var(--panel);
	border-left: 6px solid var(--lime);
	border-radius: 4px;
	padding: 2.25rem 2.5rem;
	margin-bottom: 2rem;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

h1, h2, h3, h4 { color: var(--grey); line-height: 1.2; margin: 1.6em 0 0.5em; }
.panel > :first-child, .panel > .entry-header + .entry-content > :first-child { margin-top: 0; }
.entry-title { font-size: 2.2rem; margin: 0 0 1.25rem; padding-bottom: 0.6rem; border-bottom: 4px solid var(--lime); }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.4em; padding-left: 1.4rem; }
li { margin-bottom: 0.35em; }
.entry-content ul li::marker { color: var(--lime); font-size: 1.15em; }

.wp-block-button__link, .button, .cd-form button[type="submit"] {
	display: inline-block;
	background: var(--lime);
	color: #222;
	font-weight: 700;
	text-decoration: none;
	padding: 0.8rem 1.6rem;
	border: 0;
	border-radius: 3px;
	font-size: 1rem;
	cursor: pointer;
}
.wp-block-button__link:hover, .button:hover, .cd-form button[type="submit"]:hover { background: #222; color: var(--lime); }

.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: 0.85rem; color: var(--grey); }

/* ---------- Contact form ---------- */
.section-bar {
	background: var(--lime);
	color: #222;
	margin: -2.25rem -2.5rem 1.5rem;
	padding: 0.6rem 2.5rem;
	font-size: 1.15rem;
	border-radius: 0 4px 0 0;
}
.cd-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.cd-form .field { margin-bottom: 1.1rem; }
.cd-form label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.cd-form .req { color: #b00020; }
.cd-form input[type="text"], .cd-form input[type="email"], .cd-form input[type="tel"], .cd-form textarea {
	width: 100%;
	padding: 0.7rem 0.8rem;
	font: inherit;
	border: 1px solid #999;
	border-radius: 3px;
	background: #fff;
}
.cd-form input:focus, .cd-form textarea:focus { border-color: #222; outline: 3px solid var(--lime); outline-offset: 0; }
.cd-hp { position: absolute !important; left: -9999px; height: 0; width: 0; overflow: hidden; }

.cd-notice { padding: 0.9rem 1.1rem; border-radius: 3px; margin-bottom: 1.25rem; font-weight: 600; }
.cd-notice.ok { background: #eef8c4; border-left: 5px solid var(--lime); }
.cd-notice.bad { background: #fde8ea; border-left: 5px solid #b00020; }

/* ---------- Map ---------- */
.cd-map iframe { width: 100%; height: 380px; border: 0; display: block; border-radius: 3px; }
.cd-map small { display: block; margin-top: 0.5rem; }

/* ---------- Posts (fallback blog / search / 404) ---------- */
.post-item { margin-bottom: 2rem; }
.post-item .entry-title { font-size: 1.6rem; border: 0; padding: 0; }
.entry-meta { color: var(--grey); font-size: 0.9rem; margin-bottom: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer {
	background: rgba(255, 255, 255, 0.96);
	border-top: 5px solid var(--lime);
	font-size: 0.92rem;
	color: var(--grey);
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }
.footer-inner p { margin: 0; }
.footer-inner .sep { margin: 0 0.5rem; }
.footer-widgets { margin-bottom: 1rem; }

/* ---------- Small screens ---------- */
@media (max-width: 782px) {
	body.admin-bar .site-header { top: 46px; }
}
@media (max-width: 720px) {
	.site-tagline { display: none; }
	.site-logo img { height: 56px; }
	.header-inner { flex-wrap: wrap; }
	.menu-toggle { display: block; }
	.main-nav { display: none; width: 100%; margin-left: 0; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav a { border-bottom: 0; border-left: 4px solid transparent; }
	.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { border-left-color: var(--lime); }
	.panel { padding: 1.5rem 1.25rem; }
	.section-bar { margin: -1.5rem -1.25rem 1.25rem; padding: 0.6rem 1.25rem; }
	.entry-title { font-size: 1.8rem; }
	.cd-form .row { grid-template-columns: 1fr; gap: 0; }
	.cd-map iframe { height: 300px; }
}
