/*
Theme Name:   Grate Detections
Description:  Lightweight child theme of GeneratePress for Grate Detections. Mobile-first. Brand colors, sticky tap-to-call bar, and trims only. Layout and typography are set in Appearance > Customize.
Author:       Grate Detections
Template:     generatepress
Version:      1.0.0
Requires at least: 6.0
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:  gd-child
*/

/* Brand tokens (all text pairs pass WCAG AA) */
:root {
	--gd-purple: #4a2c7a;
	--gd-purple-dark: #2e1a4f;
	--gd-teal: #0e7490;
	--gd-call: #0060c0;
	--gd-text: #1a1a1a;
	--gd-soft: #f4f1f9;
	--gd-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Mobile-first base */
body {
	font-family: var(--gd-font);
	color: var(--gd-text);
	background: #fff;
	line-height: 1.6;
	overflow-wrap: break-word;
}

a { color: var(--gd-teal); }
a:hover, a:focus { color: var(--gd-purple); }

h1, h2, h3, h4 { color: var(--gd-purple); line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }

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

.site-header { background: var(--gd-purple-dark); }

/* The logo already carries the name; keep the title for screen readers and SEO */
.main-title, .site-description {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

/* Navigation on dark purple */
.main-navigation,
.main-navigation ul ul,
.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items {
	background: var(--gd-purple-dark);
	color: #fff;
}
.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li a:focus,
.main-navigation .main-nav ul li[class*="current-menu-"] > a,
.main-navigation .menu-toggle:hover {
	background: var(--gd-purple);
	color: #fff;
}
.main-navigation .main-nav ul li a { min-height: 48px; }

/* Legacy inline styles in old page content (blue, underlined headings) */
.entry-content :is(h1, h2, h3, h4, h5, h6) [style] {
	color: inherit !important;
	text-decoration: none !important;
}
.site-footer, .site-info { background: var(--gd-purple-dark); color: #fff; }
.site-footer a, .site-info a { color: #fff; }

/* Footer contact block and menu (single column on phones, two columns from 769px) */
.gd-footer { padding: 2rem 1rem 1rem; color: #fff; background: var(--gd-purple-dark); }
.gd-footer__contact { font-style: normal; margin-bottom: 1.5rem; }
.gd-footer a { color: #fff; }
.gd-footer__menu { margin: 0; padding: 0; list-style: none; }
.gd-footer__menu a { display: block; padding: 0.6rem 0; min-height: 44px; }
@media (min-width: 769px) {
	.gd-footer__inner { display: flex; justify-content: space-between; gap: 2rem; }
	.gd-footer__menu { columns: 2; column-gap: 3rem; }
}

/* Sticky tap-to-call bar (phones only) */
.gd-call {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999;
	display: block;
	padding: 0.9rem 1rem;
	background: var(--gd-call);
	color: #fff;
	font-size: 1.25rem;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	min-height: 48px;
}
.gd-call:hover, .gd-call:focus { background: var(--gd-purple); color: #fff; }
body { padding-bottom: 4.5rem; }

@media (min-width: 769px) {
	.gd-call { display: none; }
	body { padding-bottom: 0; }
}

/* Prominent mobile menu button: 56px square filled teal icon button */
@media (max-width: 1024px) {
	.main-navigation .menu-toggle {
		display: inline-flex;
		align-items: center;
		gap: 0.6rem;
		width: 56px;
		justify-content: center;
		min-height: 56px;
		padding: 0;
		margin: 0.5rem 0;
		border-radius: 8px;
		background: var(--gd-teal);
		color: #fff;
		font-size: 1.125rem;
		font-weight: 700;
		line-height: 1;
	}
	.main-navigation .menu-toggle .gp-icon svg { width: 1.75rem; height: 1.75rem; }
	/* Same colors in every state (GeneratePress's :focus rule otherwise turns the icon dark on dark) */
	.main-navigation button.menu-toggle,
	.main-navigation button.menu-toggle:focus,
	.main-navigation button.menu-toggle:hover,
	.main-navigation button.menu-toggle:active { background: var(--gd-teal); color: #fff; }
	.main-navigation button.menu-toggle[aria-expanded="true"] { background: #fff; color: var(--gd-purple-dark); }
	.main-navigation .menu-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

	/* Mobile menu items: larger text, tighter rows (still 48px+ tap targets) */
	.main-navigation .main-nav ul li a {
		font-size: 1.25rem;
		line-height: 1.2;
		padding-top: 0.8rem;
		padding-bottom: 0.8rem;
		min-height: 48px;
		display: flex;
		align-items: center;
	}
	.main-navigation .main-nav ul ul li a { font-size: 1.125rem; }
}
