/*
Theme Name: Target Risk Services
Theme URI: https://www.targetriskservices.co.za/
Author: Target Specialised Risk Services
Description: One-page block theme for Target Specialised Risk Services. Colours, fonts and spacing live in theme.json; this file holds the section layouts.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: target-risk
Tags: one-column, block-patterns, full-site-editing, custom-colors
*/

/* Layout: one long page. Dark header/hero and footer bracket light content bands;
   the vehicle livery (blue stripe over a thin black rule) is the recurring motif. */
:root {
	--tr-blue: var(--wp--preset--color--blue, #1e73be);
	--tr-blue-bright: var(--wp--preset--color--blue-bright, #3a9be0);
	--tr-ink: var(--wp--preset--color--ink, #0c1015);
	--tr-char: var(--wp--preset--color--charcoal, #1a1f26);
	--tr-mist: var(--wp--preset--color--mist, #eef1f4);
	--tr-muted: var(--wp--preset--color--muted, #5b636d);
	--tr-line: #d9dee4;
	--tr-on-dark: #b8c2cc;
	--tr-display: var(--wp--preset--font-family--display);
	--tr-gutter: max(16px, min(4vw, 32px));
	--tr-header-h: 72px;
}

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: calc(var(--tr-header-h) + var(--wp-admin--admin-bar--height, 0px) + 12px); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--tr-blue-bright); outline-offset: 3px; }
h1, h2, h3, h4 { text-wrap: balance; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Top-level sections butt together; spacing comes from each band's own padding. */
.wp-site-blocks > *,
.site-main > * { margin-block: 0; }

.hero, .livery, .band, .stats, .header-inner, .footer-inner, .page-main {
	padding-left: var(--tr-gutter);
	padding-right: var(--tr-gutter);
}
.band { padding-block: clamp(64px, 9vw, 112px); }

.eyebrow {
	font-weight: 600;
	font-size: 0.8125rem;
	line-height: 1;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--tr-blue);
}
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head > * { margin-block: 0; }
.section-head > * + * { margin-block-start: 14px; }
.section-head p:not(.eyebrow):not(.pull) { color: var(--tr-muted); }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: var(--tr-ink);
	color: #fff;
	border-bottom: 1px solid #222a33;
	transition: box-shadow 0.2s;
}
.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
@media (max-width: 600px) {
	.site-header { top: 0; }
}
.header-bar { min-height: var(--tr-header-h); gap: 24px; }
.brand { gap: 12px; }
.brand-logo { margin: 0; }
.brand-logo img { width: 52px; height: auto; display: block; }
.brand-text { gap: 0; }
.brand-text p { margin: 0; line-height: 1; }
.brand-name { font: 800 1.625rem/1 var(--tr-display); letter-spacing: 0.12em; }
.brand-name a { color: inherit; text-decoration: none; }
.brand-tag { font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: #a9b3be; margin-top: 4px !important; }
.header-actions { gap: 28px; }

.site-nav { gap: 28px; font-size: 0.9375rem; font-weight: 500; }
.site-nav .wp-block-navigation-item__content { color: #c9d1da; text-decoration: none; }
.site-nav .wp-block-navigation-item__content:hover { color: #fff; }
.site-nav .wp-block-navigation__responsive-container-open,
.site-nav .wp-block-navigation__responsive-container-close { color: #fff; }
.site-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: calc(24px + var(--wp-admin--admin-bar--height, 0px)) var(--tr-gutter) 24px;
}
.site-nav .is-menu-open .wp-block-navigation-item__content {
	font: 700 1.75rem/1.2 var(--tr-display);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #fff;
	padding: 8px 0;
}
@media (max-width: 1000px) {
	.header-call { display: none; }
}

/* ---------- Hero ---------- */
.hero { background: var(--tr-ink); color: #fff; }
.hero-grid { align-items: center; gap: clamp(32px, 5vw, 64px); padding-block: clamp(48px, 7vw, 88px); margin: 0; }
.hero-copy > * { margin-block: 0; }
.hero-copy > * + * { margin-block-start: 24px; }
.hero .eyebrow { color: var(--tr-blue-bright); }
.hero h1 em { font-style: normal; color: var(--tr-blue-bright); }
.hero-lead { color: var(--tr-on-dark); font-size: 1.1875rem; max-width: 34em; }
.hero .wp-block-buttons { gap: 14px; }
.hero-photo { margin: 0; }
.hero-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; }

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid #4a5560;
	background: transparent;
	color: #fff;
	padding: calc(0.8rem - 2px) calc(1.4rem - 2px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: #fff; background: transparent; }
.wp-block-button__link { transition: background-color 0.2s, border-color 0.2s; }

/* ---------- Livery stripe ---------- */
.livery { background: var(--tr-blue); color: #fff; border-bottom: 6px solid var(--tr-ink); }
.livery-inner { padding-block: 18px; gap: 8px 32px; align-items: center; }
.livery-inner p { margin: 0; }
.livery-label { font: 600 0.9375rem/1.3 var(--tr-display); letter-spacing: 0.14em; text-transform: uppercase; }
.livery-phone { font: 800 clamp(1.625rem, 3.4vw, 2.375rem)/1 var(--tr-display); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.livery-phone a { color: #fff; text-decoration: none; }

/* ---------- Services ---------- */
.services-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--tr-line);
	border: 1px solid var(--tr-line);
}
.services-grid > * { margin: 0 !important; }
.service { background: #fff; padding: 32px 28px; display: grid; align-content: start; gap: 14px; transition: background-color 0.2s; }
.service:hover { background: #f6f9fc; }
.service > * { margin: 0; }
.service-icon img { width: 40px; height: 40px; display: block; }
.service h3 { font-size: 1.5625rem; }
.service p { color: var(--tr-muted); font-size: 1rem; }
.service.is-lead { grid-column: span 2; background: var(--tr-char); color: #fff; }
.service.is-lead:hover { background: #20262e; }
.service.is-lead .service-icon img { width: 56px; height: 56px; }
.service.is-lead h3 { font-size: 2.125rem; }
.service.is-lead p { color: var(--tr-on-dark); font-size: 1.0625rem; max-width: 46em; }
.service.is-lead .service-tag { font-weight: 600; font-size: 0.75rem; line-height: 1; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tr-blue-bright); }
@media (max-width: 960px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
	.services-grid { grid-template-columns: minmax(0, 1fr); }
	.service.is-lead { grid-column: auto; }
}

/* ---------- Stats ---------- */
.stats { background: var(--tr-blue); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-block: 56px; }
.stats-grid > * { margin: 0 !important; }
.stat { border-left: 2px solid rgba(255, 255, 255, 0.35); padding-left: 20px; }
.stat > * { margin: 0; }
.stat-num { font: 800 clamp(2.75rem, 6vw, 4.25rem)/1 var(--tr-display); font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 6px !important; font-weight: 600; font-size: 0.875rem; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; color: #dbe9f6; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; } }

/* ---------- About ---------- */
.about { background: var(--tr-mist); position: relative; overflow: hidden; }
.about::after {
	content: "";
	position: absolute;
	right: -6%;
	top: 50%;
	width: min(560px, 60vw);
	aspect-ratio: 1;
	transform: translateY(-50%);
	background: url(assets/images/watermark.png) right bottom / 200% no-repeat;
	opacity: 0.09;
	pointer-events: none;
}
.about-grid { position: relative; z-index: 1; gap: clamp(32px, 6vw, 80px); margin: 0; }
.about .section-head { margin-bottom: 0; }
.about-text { color: #333b44; }
.about-text > * { margin-block: 0; }
.about-text > * + * { margin-block-start: 18px; }
.pull {
	font: 700 clamp(1.5rem, 2.8vw, 2rem)/1.2 var(--tr-display);
	text-transform: uppercase;
	color: var(--tr-ink);
	border-left: 4px solid var(--tr-blue);
	padding-left: 18px;
}
.checks { list-style: none; padding: 0; display: grid; gap: 12px; }
.checks li { padding-left: 34px; background: url(assets/icons/check.svg) 0 3px / 22px 22px no-repeat; }

/* ---------- Gallery ---------- */
.gallery-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.gallery-filters button {
	font: 600 0.875rem/1 var(--wp--preset--font-family--body);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 10px 18px;
	border: 1px solid var(--tr-line);
	background: #fff;
	color: inherit;
	border-radius: 3px;
	cursor: pointer;
}
.gallery-filters button[aria-pressed="true"] { background: var(--tr-ink); border-color: var(--tr-ink); color: #fff; }
.target-gallery.wp-block-gallery img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; transition: transform 0.35s; }
.target-gallery.wp-block-gallery .wp-block-image { overflow: hidden; border-radius: 3px; background: var(--tr-char); }
.target-gallery.wp-block-gallery .wp-block-image:hover img { transform: scale(1.04); }

/* ---------- Videos ---------- */
.videos { background: var(--tr-ink); color: #fff; }
.videos .eyebrow { color: var(--tr-blue-bright); }
.videos .section-head { margin-bottom: 0; }
.videos .section-head p:not(.eyebrow) { color: #a9b3be; }
.video-grid { align-items: center; gap: clamp(32px, 5vw, 64px); margin: 0; }
.video-media .wp-block-video { margin: 0; }
.video-media video { width: 100%; border-radius: 4px; background: var(--tr-char); }
.video-media figcaption { color: #8f9aa6; font-size: 0.875rem; text-align: left; }

/* ---------- Contact ---------- */
.contact-grid { gap: clamp(32px, 6vw, 72px); margin: 0; }
.contact-grid .section-head { margin-bottom: 32px; }
.contact-list { display: grid; gap: 22px; margin-bottom: 28px; }
.contact-list > * { margin: 0 !important; }
.contact-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; }
.contact-item::before {
	content: "";
	grid-row: span 2;
	width: 44px;
	height: 44px;
	border-radius: 3px;
	background: var(--tr-mist) center / 22px 22px no-repeat;
}
.contact-item.is-phone::before { background-image: url(assets/icons/phone.svg); }
.contact-item.is-email::before { background-image: url(assets/icons/email.svg); }
.contact-item.is-location::before { background-image: url(assets/icons/location.svg); }
.contact-item p { margin: 0; }
.contact-label { font-weight: 600; font-size: 0.75rem; line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tr-muted); margin-bottom: 4px !important; }
.contact-value { font-weight: 600; overflow-wrap: anywhere; }
.contact-value a { color: inherit; text-decoration: none; }
.contact-value a:hover { color: var(--tr-blue); }
.map-embed { border: 1px solid var(--tr-line); border-radius: 3px; overflow: hidden; background: var(--tr-mist); }
.map-embed iframe { display: block; width: 100%; height: 280px; border: 0; }

.target-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	border: 1px solid var(--tr-line);
	border-top: 4px solid var(--tr-blue);
	border-radius: 3px;
	padding: clamp(20px, 3vw, 32px);
	background: #fff;
}
.target-form p { margin: 0; display: grid; gap: 6px; }
.target-form .is-full, .target-form__notice { grid-column: 1 / -1; }
.target-form label { font-weight: 600; font-size: 0.875rem; }
.target-form input, .target-form textarea {
	font: inherit;
	padding: 12px 14px;
	border: 1px solid #c7ced6;
	border-radius: 3px;
	background: #fff;
	color: inherit;
	width: 100%;
	box-sizing: border-box;
}
.target-form input:focus, .target-form textarea:focus { outline: 2px solid var(--tr-blue); outline-offset: 0; border-color: var(--tr-blue); }
.target-form textarea { min-height: 140px; resize: vertical; }
.target-form button { border: 0; cursor: pointer; }
.target-form .target-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.target-form__notice { display: block !important; padding: 12px 14px; border-radius: 3px; font-weight: 600; }
.target-form__notice.is-ok { background: #e7f6ee; color: #145c3b; }
.target-form__notice.is-error { background: #fdecec; color: #8a1f1f; }
@media (max-width: 520px) { .target-form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--tr-ink); color: #a9b3be; font-size: 0.9375rem; border-top: 6px solid var(--tr-blue); }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { gap: 40px; padding-block: 56px; margin: 0; }
.footer-grid .brand { margin-bottom: 16px; color: #fff; }
.footer-grid h4 { font-size: 1rem; letter-spacing: 0.14em; color: #fff; margin: 0 0 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-base { border-top: 1px solid #1f262e; padding-block: 20px; font-size: 0.8125rem; gap: 8px 24px; }
.footer-base p { margin: 0; }

/* ---------- Inner pages ---------- */
.page-main { padding-block: clamp(48px, 7vw, 88px); }
.page-main .wp-block-post-title { margin-bottom: 24px; }
