/* =============================================================
   Map Builder Pro — Theme Styles
   mapmaker-theme.css — drop in your theme folder
   ============================================================= */

/* ── Fonts & variables ──────────────────────────────────────── */
:root {
	--brand-green:      #2d6a4f;
	--brand-dark:       #1b4332;
	--brand-light:      #74c69d;
	--brand-pale:       #d8f3dc;
	--text-primary:     #111827;
	--text-secondary:   #4b5563;
	--text-muted:       #9ca3af;
	--bg-white:         #ffffff;
	--bg-off:           #f9fafb;
	--border:           #e5e7eb;
	--radius:           8px;
	--shadow-sm:        0 1px 3px rgba(0,0,0,.08);
	--shadow-md:        0 4px 16px rgba(0,0,0,.10);
	--header-h:         68px;
	--font-body:        'DM Sans', sans-serif;
	--font-display:     'DM Serif Display', serif;
	--transition:       .18s ease;
}

/* ── Base reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	color: var(--text-primary);
	background: var(--bg-white);
	margin: 0;
	-webkit-font-smoothing: antialiased;
}

/* When admin bar is present, compensate */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .site-header { top: 46px; }
}

a { color: var(--brand-green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-dark); }

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

/* ── Skip link ──────────────────────────────────────────────── */
.skip-link {
	position: absolute;
	left: -999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.skip-link:focus {
	left: 12px; top: 12px;
	width: auto; height: auto;
	background: var(--brand-green);
	color: #fff;
	padding: 8px 16px;
	border-radius: var(--radius);
	z-index: 9999;
}

/* ════════════════════════════════════════════════════════════
   HEADER
   ════════════════════════════════════════════════════════════ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 400;
	background: var(--bg-white);
	border-bottom: 1px solid var(--border);
	box-shadow: var(--shadow-sm);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 24px;
	height: var(--header-h);
	gap: 24px;
}

/* ── Brand ──────────────────────────────────────────────────── */
.site-branding { flex-shrink: 0; }

.brand-link {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}
.brand-icon { display: flex; align-items: center; flex-shrink: 0; }
.brand-icon svg { display: block; }

.brand-name {
	font-family: var(--font-display);
	font-size: 22px;
	color: var(--text-primary);
	letter-spacing: -.3px;
	line-height: 1;
}

/* Custom logo sizing */
.site-logo .custom-logo-link img {
	height: 40px;
	width: auto;
	display: block;
}

/* ── Navigation ─────────────────────────────────────────────── */
.main-navigation { flex: 1; display: flex; justify-content: center; }

.main-navigation ul {
	display: flex;
	align-items: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-navigation ul li { position: relative; }

.main-navigation ul li a {
	display: block;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--text-secondary);
	border-radius: 6px;
	transition: background var(--transition), color var(--transition);
	white-space: nowrap;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current_page_item > a,
.main-navigation ul li.current-menu-item > a {
	background: var(--brand-pale);
	color: var(--brand-dark);
}

/* Sub-menus */
.main-navigation ul ul {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	flex-direction: column;
	gap: 2px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 6px;
	min-width: 180px;
	box-shadow: var(--shadow-md);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: all var(--transition);
	z-index: 100;
}
.main-navigation ul li:hover > ul,
.main-navigation ul li:focus-within > ul {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ── Header CTA ─────────────────────────────────────────────── */
.header-cta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.header-btn {
	display: inline-flex;
	align-items: center;
	background: var(--brand-green);
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	padding: 9px 20px;
	border-radius: 7px;
	white-space: nowrap;
	transition: background var(--transition), transform .1s;
	text-decoration: none;
}
.header-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.header-btn:active { transform: scale(.98); }

/* ── Hamburger button ───────────────────────────────────────── */
.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 38px;
	height: 38px;
	background: none;
	border: 1px solid var(--border);
	border-radius: 7px;
	cursor: pointer;
	padding: 0;
	transition: border-color var(--transition);
}
.menu-toggle:hover { border-color: var(--brand-green); }
.menu-toggle span {
	display: block;
	width: 18px;
	height: 2px;
	background: var(--text-primary);
	border-radius: 2px;
	transition: all .22s ease;
	transform-origin: center;
}
/* Animated X state */
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile navigation ──────────────────────────────────────── */
@media (max-width: 768px) {
	.menu-toggle { display: flex; }
	.header-btn  { display: none; }

	.main-navigation {
		position: absolute;
		top: var(--header-h);
		left: 0;
		right: 0;
		background: var(--bg-white);
		border-bottom: 1px solid var(--border);
		box-shadow: var(--shadow-md);
		padding: 12px 16px 16px;
		display: none;
		justify-content: flex-start;
	}
	.main-navigation.nav-open { display: flex; }

	.main-navigation ul {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		gap: 2px;
	}
	.main-navigation ul li a { font-size: 15px; padding: 10px 14px; }

	/* Sub-menus go inline on mobile */
	.main-navigation ul ul {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: none;
		padding: 0 0 0 16px;
		display: flex;
	}

	body.admin-bar .main-navigation { top: calc(var(--header-h) + 46px); }
}
@media (max-width: 600px) {
	body.admin-bar .main-navigation { top: calc(var(--header-h) + 46px); }
}

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ════════════════════════════════════════════════════════════ */
#primary.site-main {
	max-width: 1180px;
	margin: 0 auto;
	padding: 48px 24px 64px;
}

/* Standard article styles */
.entry-title {
	font-family: var(--font-display);
	font-size: 32px;
	font-weight: 400;
	color: var(--text-primary);
	margin: 0 0 24px;
	line-height: 1.2;
}
.entry-content {
	font-size: 16px;
	line-height: 1.7;
	color: var(--text-secondary);
}
.entry-content h2, .entry-content h3 { font-family: var(--font-display); color: var(--text-primary); }
.entry-content a { color: var(--brand-green); text-decoration: underline; text-underline-offset: 3px; }

/* Hide title/footer on plugin shortcode pages */
body:has(.mb-purchase-wrap) .entry-header,
body:has(.mb-purchase-wrap) .entry-footer,
body:has(.mb-success-wrap)  .entry-header,
body:has(.mb-success-wrap)  .entry-footer {
	display: none;
}
body:has(.mb-purchase-wrap) #primary,
body:has(.mb-success-wrap)  #primary {
	padding: 0;
	max-width: 100%;
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.site-footer {
	background: #0d1f1a;
	color: #9ca3af;
	font-size: 14px;
	margin-top: auto;
}

.footer-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 56px 24px 48px;
	display: grid;
	grid-template-columns: 1.4fr 2fr;
	gap: 64px;
	align-items: start;
}
@media (max-width: 768px) {
	.footer-inner { grid-template-columns: 1fr; gap: 40px; }
}

/* ── Footer brand ───────────────────────────────────────────── */
.footer-brand {}

.footer-logo-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	margin-bottom: 16px;
}
.footer-logo-icon svg { display: block; }

.footer-brand-name {
	font-family: var(--font-display);
	font-size: 20px;
	color: #fff;
	letter-spacing: -.2px;
}

.footer-tagline {
	font-size: 14px;
	color: #6b7280;
	line-height: 1.65;
	margin: 0 0 24px;
}

.footer-cta-btn {
	display: inline-block;
	background: var(--brand-green);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 10px 22px;
	border-radius: 7px;
	text-decoration: none;
	transition: background var(--transition);
}
.footer-cta-btn:hover { background: var(--brand-dark); color: #fff; }

/* ── Footer link columns ────────────────────────────────────── */
.footer-links {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
}
@media (max-width: 600px) {
	.footer-links { grid-template-columns: 1fr 1fr; }
}

.footer-col h4 {
	font-family: var(--font-body);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: #fff;
	margin: 0 0 16px;
}

.footer-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.footer-col ul li a {
	color: #6b7280;
	font-size: 14px;
	text-decoration: none;
	transition: color var(--transition);
	line-height: 1;
}
.footer-col ul li a:hover { color: var(--brand-light); }

/* ── Footer bottom bar ──────────────────────────────────────── */
.footer-bottom {
	border-top: 1px solid #1f2d28;
}
.footer-bottom-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 20px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.footer-copy { margin: 0; color: #4b5563; font-size: 13px; }

.footer-legal {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	font-size: 13px;
}
.footer-legal a { color: #4b5563; text-decoration: none; }
.footer-legal a:hover { color: var(--brand-light); }
.footer-legal span { color: #374151; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════ */
#secondary.widget-area {
	padding: 0 24px 48px;
	max-width: 340px;
}
.widget { margin-bottom: 32px; }
.widget-title {
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 400;
	color: var(--text-primary);
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--brand-pale);
}

/* Two-column layout for pages with sidebar */
.content-area-with-sidebar {
	max-width: 1180px;
	margin: 0 auto;
	padding: 48px 24px 64px;
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 48px;
	align-items: start;
}

/* ════════════════════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════════════════════ */
/* Smooth page reveal */
body { animation: pageFadeIn .3s ease; }
@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }