/*
Theme Name: Ampac Classic
Author: Ampac
Description: Classic PHP-template theme for Ampac (no Site Editor). Content uses the block editor; layout is PHP.
Version: 0.2.1
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: ampac-classic
*/

/* ============ Tokens ============ */
:root {
	--ampac-red: #ed1c24;
	--ampac-dark: #313131;
	--ampac-grey: #f4f4f4;
	--ampac-text: #222;
	--ampac-max: 1200px;
}

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

body {
	margin: 0;
	font-family: "Nunito Sans", "Segoe UI", Arial, sans-serif;
	color: var(--ampac-text);
	font-size: 17px;
	line-height: 1.6;
	background: #fff;
}

img { max-width: 100%; height: auto; }
a { color: var(--ampac-red); }

.wrap { max-width: var(--ampac-max); margin: 0 auto; padding: 0 20px; }
.hp-narrow { max-width: 900px; }

/* ============ Buttons ============ */
.ampac-btn {
	display: inline-block;
	background: var(--ampac-red);
	color: #fff !important;
	text-decoration: none;
	padding: 12px 34px;
	font-weight: 700;
	border: none;
	border-radius: 0;
	cursor: pointer;
}
.ampac-btn:hover { background: #c8151c; color: #fff !important; }
.ampac-btn-rounded { border-radius: 6px; }
.ampac-btn-white { background: #fff; color: var(--ampac-red) !important; }
.ampac-btn-white:hover { background: #f0f0f0; color: var(--ampac-red) !important; }

/* ============ Top utility bar ============ */
.ampac-topbar { background: var(--ampac-red); }
.ampac-topbar-in { display: flex; justify-content: flex-end; padding-top: 6px; padding-bottom: 6px; }
.ampac-topbar a { color: #fff; margin-left: 12px; }
.ampac-topbar svg, .ampac-topbar img { display: block; }

/* ============ Header ============ */
.ampac-header { background: #fff; position: sticky; top: 0; z-index: 200; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.ampac-header-main { display: flex; align-items: center; gap: 28px; padding-top: 14px; padding-bottom: 14px; }
.ampac-logo img { display: block; height: 64px; width: auto; }
.ampac-header-search { flex: 1; max-width: 420px; margin-left: auto; }
.ampac-header-search form.search-form { display: flex; }
.ampac-header-search .search-field {
	flex: 1; border: 1px solid #ddd; background: #f1f1f1; border-radius: 4px 0 0 4px;
	padding: 9px 12px; font-size: 15px; min-width: 0;
}
.ampac-header-search .search-submit {
	border: 1px solid #ddd; border-left: none; background: #e4e4e4; border-radius: 0 4px 4px 0;
	padding: 0 16px; font-size: 0; cursor: pointer; min-width: 52px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='20' height='20'%3E%3Ccircle cx='11' cy='11' r='7' fill='none' stroke='%23666' stroke-width='2'/%3E%3Cpath d='M21 21l-4.3-4.3' stroke='%23666' stroke-width='2'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: center;
}
.ampac-header-utils { display: flex; align-items: center; gap: 18px; }
.ampac-util-link { color: #ed1326; font-weight: 400; text-decoration: none; }
.ampac-region { position: relative; display: inline-flex; align-items: center; gap: 6px; color: #404040; cursor: pointer; }
.ampac-region select { border: none; color: inherit; font: inherit; font-weight: 500; background: transparent; cursor: pointer; width: auto; appearance: none; -webkit-appearance: none; padding-right: 18px; }
/* Custom dropdown chevron (pure CSS) — matches live region selector arrow */
.ampac-region::after { content: ""; position: absolute; right: 2px; top: 50%; width: 7px; height: 7px; border-right: 2px solid #404040; border-bottom: 2px solid #404040; transform: translateY(-70%) rotate(45deg); pointer-events: none; }

/* ============ Nav (Max Mega Menu compatible) ============ */
.ampac-nav { border-top: 1px solid #eee; }
/* Fallback dropdowns — scoped to plain wp_nav_menu output only (never Mega Menu) */
.ampac-nav ul.menu { display: flex; justify-content: center; gap: 34px; list-style: none; margin: 0; padding: 0; }
.ampac-nav ul.menu > li > a {
	display: block; padding: 14px 4px; color: var(--ampac-dark); text-decoration: none; font-weight: 600;
}
.ampac-nav ul.menu li { position: relative; }
.ampac-nav ul.menu ul { display: none; position: absolute; top: 100%; left: 0; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.12); list-style: none; margin: 0; padding: 8px 0; min-width: 220px; z-index: 300; }
.ampac-nav ul.menu li:hover > ul { display: block; }
.ampac-nav ul.menu ul a { display: block; padding: 8px 18px; color: var(--ampac-dark); text-decoration: none; white-space: nowrap; }
.ampac-nav ul.menu ul a:hover { color: var(--ampac-red); }

/* ============ Hero (plugin carousel) ============ */
.home-slider { position: relative; }
.home-slider img, .hero-container img { width: 100%; display: block; }

/* ============ Homepage sections ============ */
.hp-section { padding: 56px 0; }
.hp-purpose { background: #fff; text-align: center; }
.hp-purpose p strong { font-size: 22px; }
.hp-btn-row { display: flex; gap: 16px; margin-top: 26px; flex-wrap: wrap; }
.hp-btn-center { justify-content: center; }

.hp-h2 { font-size: 30px; font-weight: 800; color: #111; margin: 0 0 26px; text-align: left; }
.hp-h2::after { content: ""; display: block; width: 48px; height: 4px; background: #111; margin-top: 10px; }
.hp-h2-center { text-align: center; }
.hp-h2-center::after { margin-left: auto; margin-right: auto; }

.hp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.hp-cols p { text-align: justify; }
/* ACF lead-in acts as the section heading (matches live) */
.our-solutions-col p:first-child strong,
.our-projects-col p:first-child strong {
	display: block; font-size: 30px; font-weight: 800; color: #111; text-align: left; line-height: 1.25;
}
.our-solutions-col p:first-child strong::after,
.our-projects-col p:first-child strong::after {
	content: ""; display: block; width: 48px; height: 4px; background: #111; margin-top: 10px;
}

.hp-solutions { background: var(--ampac-grey); }
.hp-solutions .our-solutions-col button,
.hp-solutions .our-solutions-col .ampac-btn { background: #fff; border: none; padding: 0; }
.hp-solutions .our-solutions-col button a { display: inline-block; background: #fff; color: var(--ampac-red) !important; font-weight: 700; text-decoration: none; padding: 12px 34px; }
.hp-solutions .our-solutions-col button a:hover { background: #f0f0f0; }

.hp-projects { background: #fff; }
.hp-projects .our-projects-col button { background: none; border: none; padding: 0; }
.hp-projects .our-projects-col button a { display: inline-block; background: var(--ampac-red); color: #fff !important; font-weight: 700; text-decoration: none; padding: 12px 34px; }
.hp-projects .our-projects-col button a:hover { background: #c8151c; }

.hp-mission { background: #fff; }
.hp-video-wrap { position: relative; padding-bottom: 56.25%; height: 0; }
.hp-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.hp-news { background: #fff; }
.hp-news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.hp-news-card img { width: 100%; display: block; }
.hp-news-card h3 { font-size: 20px; margin: 16px 0 8px; }
.hp-news-card h3 a { color: #111; text-decoration: none; }
.hp-news-card h3::after { content: ""; display: block; width: 40px; height: 3px; background: #111; margin-top: 8px; }

/* ============ Footer ============ */
.ampac-footer { background: var(--ampac-grey); margin-top: 0; }
.ampac-foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 48px; padding-top: 48px; padding-bottom: 40px; }
.ampac-footer h3 { color: #111; margin-top: 0; }
.halma-mark { font-size: 20px; color: #111; }
.ampac-foot-quicklinks a { color: var(--ampac-red); text-decoration: none; font-weight: 600; }
.ampac-connect { color: #111; font-weight: 700; margin-top: 18px; }
.ampac-legalbar { background: var(--ampac-red); color: #fff; }
.ampac-legalbar-in { display: flex; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; font-size: 15px; flex-wrap: wrap; }
.ampac-legalbar a { color: #fff; text-decoration: none; }

/* ============ Generic content ============ */
.ampac-main { min-height: 40vh; }
.page-hero { background: var(--ampac-grey); padding: 34px 0; margin-bottom: 30px; }
.page-hero h1 { margin: 0; font-size: 32px; color: #111; }
.content-wrap { padding-bottom: 50px; }
.breadcrumbs { font-size: 14px; margin-bottom: 14px; }

/* ============ Mega Menu parity with live ============
   Tabbed rail items must stay floated 100%-wide blocks so they stack
   vertically. MMM's own reset zeroes the float, collapsing the rail
   into a grid that overlaps the content pane. Pure CSS; never touch
   universal.css or plugin files. */
#mega-menu-wrap-au-menu #mega-menu-au-menu > li.mega-menu-tabbed > ul.mega-sub-menu > li.mega-menu-item,
#mega-menu-wrap-eu-menu #mega-menu-eu-menu > li.mega-menu-tabbed > ul.mega-sub-menu > li.mega-menu-item,
#mega-menu-wrap-fe-menu #mega-menu-fe-menu > li.mega-menu-tabbed > ul.mega-sub-menu > li.mega-menu-item,
#mega-menu-wrap-nz-menu #mega-menu-nz-menu > li.mega-menu-tabbed > ul.mega-sub-menu > li.mega-menu-item {
	float: left;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
	.ampac-header-main { flex-wrap: wrap; }
	.ampac-header-search { order: 3; flex-basis: 100%; max-width: none; }
	.hp-cols { grid-template-columns: 1fr; }
	.hp-news-grid { grid-template-columns: 1fr; }
	.ampac-foot-grid { grid-template-columns: 1fr; }
	.ampac-nav ul.menu { flex-wrap: wrap; gap: 18px; }
}
