/*
Theme Name:        Groundhog TT4 Child
Theme URI:         https://groundhoganchors.ca/
Description:       Child theme of Twenty Twenty-Four, styled to match the
                   Groundhog Anchor and Support Systems site (New Order
                   Enterprizes).
Author:            New Order Enterprizes
Author URI:        https://groundhoganchors.ca/
Template:          twentytwentyfour
Version:           1.0.0
Requires at least: 6.4
Requires PHP:      7.0
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       groundhog-tt4
*/

/* ============================================================================
   1. DESIGN TOKENS
   Change these values to retune the whole site at once.
   ========================================================================= */

:root {
	--gh-red:        #B91C1C;
	--gh-red-dark:   #9B1616;
	--gh-body:       #374151;
	--gh-button:     #333333;
	--gh-button-hov: #4A4A4A;
	--gh-footer-bg:  #F5F5F5;
	--gh-muted:      #6B7280;
	--gh-gutter:     24px;
}

/* ============================================================================
   2. FULL-BLEED BANDS
   Pulls the red header bands and grey footer out to the viewport edges,
   compensating for whatever root padding the parent theme applies.
   ========================================================================= */

.gh-band {
	margin-left:  calc(var(--wp--style--root--padding-left, 0px) * -1);
	margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1);
	padding-left:  var(--wp--style--root--padding-left, 0px);
	padding-right: var(--wp--style--root--padding-right, 0px);
}

/* ============================================================================
   3. TOP CONTACT BAR
   ========================================================================= */

.gh-topbar {
	background-color: var(--gh-red);
	color: #ffffff;
	font-size: 15px;
	line-height: 1.5;
	padding-top: 14px;
	padding-bottom: 14px;
	text-align: center;
}

.gh-topbar p {
	margin: 0;
	color: #ffffff;
}

.gh-topbar a,
.gh-topbar a:visited {
	color: #ffffff;
	text-decoration: none;
}

.gh-topbar a:hover,
.gh-topbar a:focus {
	color: #ffffff;
	text-decoration: underline;
}

/* ============================================================================
   4. LOGO BAND
   ========================================================================= */

.gh-logoband {
	background-color: var(--gh-red);
	padding-top: 28px;
	padding-bottom: 24px;
	text-align: center;
}

.gh-logoband figure,
.gh-logoband .wp-block-image {
	margin: 0 auto;
}

.gh-logoband img {
	display: block;
	max-width: 540px;
	width: 100%;
	height: auto;
	margin: 0 auto;
}

/* ============================================================================
   5. NAVIGATION
   ========================================================================= */

.gh-navband {
	background-color: var(--gh-red);
	padding: 0;
}

.gh-navband .wp-block-navigation__container {
	justify-content: center !important;
	align-items: stretch !important;
	gap: 0 !important;
	flex-wrap: wrap !important;
}

.gh-navband .wp-block-navigation-item {
	display: flex;
	align-items: stretch;
}

.gh-navband .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	color: #ffffff !important;
	padding: 13px 15px !important;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
	border-radius: 0;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

.gh-navband .wp-block-navigation-item__content:hover,
.gh-navband .wp-block-navigation-item__content:focus {
	background-color: rgba(255, 255, 255, .14);
	color: #ffffff !important;
}

/* Active page — white tab meeting the content area below */
.gh-navband .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.gh-navband .wp-block-navigation-item.current-menu-ancestor > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: var(--gh-red) !important;
	border-radius: 4px 4px 0 0;
}

.gh-navband .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content:hover {
	background-color: #ffffff !important;
	color: var(--gh-red) !important;
}

/* Submenus */
.gh-navband .wp-block-navigation__submenu-container {
	background-color: var(--gh-red);
	border: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}

.gh-navband .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	color: #ffffff !important;
	padding: 10px 18px !important;
	border-radius: 0;
}

.gh-navband .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	background-color: rgba(255, 255, 255, .14);
}

/* Hamburger / close icons on the red band */
.gh-navband .wp-block-navigation__responsive-container-open,
.gh-navband .wp-block-navigation__responsive-container-close {
	color: #ffffff;
	fill: #ffffff;
}

.gh-navband .wp-block-navigation__responsive-container-open svg,
.gh-navband .wp-block-navigation__responsive-container-close svg {
	fill: #ffffff;
}

/* Mobile overlay panel */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--gh-red);
	color: #ffffff;
}

.gh-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: #ffffff !important;
	padding: 12px 20px !important;
}

.gh-navband .wp-block-navigation__responsive-dialog {
	margin: 0 auto;
}

/* ============================================================
   MOBILE NAV — VISIBILITY FIX FOR WHITE-ON-WHITE ISSUE
   ============================================================ */

/* Force the mobile overlay panel to have visible text */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open,
.gh-navband .wp-block-navigation__responsive-container:not(.hidden-by-default),
.gh-navband .wp-block-navigation__popover {
	background-color: var(--gh-red) !important;
	color: #ffffff !important;
}

/* All links and labels inside the mobile menu */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open a,
.gh-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.gh-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__label,
.gh-navband .wp-block-navigation__popover a,
.gh-navband .wp-block-navigation__popover .wp-block-navigation-item__content {
	color: #ffffff !important;
	background-color: transparent !important;
	text-decoration: none !important;
}

/* Hover state inside mobile menu */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open a:hover,
.gh-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.gh-navband .wp-block-navigation__popover a:hover {
	background-color: rgba(255, 255, 255, .14) !important;
	color: #ffffff !important;
	text-decoration: none !important;
}

/* Active page highlight inside mobile menu */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open .current-menu-item > .wp-block-navigation-item__content,
.gh-navband .wp-block-navigation__responsive-container.is-menu-open .current-menu-ancestor > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: var(--gh-red) !important;
	border-radius: 4px 4px 0 0;
}

/* Hamburger icon and close button */
.gh-navband .wp-block-navigation__responsive-container-open,
.gh-navband .wp-block-navigation__responsive-container-close,
.gh-navband .wp-block-navigation__toggle-button {
	color: #ffffff !important;
	fill: #ffffff !important;
	background-color: transparent !important;
}

.gh-navband .wp-block-navigation__responsive-container-open svg,
.gh-navband .wp-block-navigation__responsive-container-close svg,
.gh-navband .wp-block-navigation__toggle-button svg {
	fill: #ffffff !important;
	stroke: #ffffff !important;
}

/* Submenu panels in mobile view */
.gh-navband .wp-block-navigation__submenu-container,
.gh-navband .wp-block-navigation__submenu-panel {
	background-color: var(--gh-red) !important;
	color: #ffffff !important;
}

.gh-navband .wp-block-navigation__submenu-container a,
.gh-navband .wp-block-navigation__submenu-panel a {
	color: #ffffff !important;
	background-color: transparent !important;
}

/* Edge case: nested submenus */
.gh-navband .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
	background-color: var(--gh-red-dark) !important;
}
/* ============================================================
   ACTIVE MENU ITEM — MOBILE OVERLAY VISIBILITY FIX
   ============================================================ */

/* Active page in mobile menu — ensure high contrast */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-item > .wp-block-navigation-item__content,
.gh-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-ancestor > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: #B91C1C !important;
	font-weight: 600 !important;
	border-radius: 4px !important;
	padding: 12px 18px !important;
}

/* Fallback: if current-menu-item doesn't trigger, target via data attributes */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open 
	li[data-wp-state-active],
.gh-block-navigation-item--current > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: #B91C1C !important;
}

/* Alternative indicator if background stays problematic */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-item > .wp-block-navigation-item__content::after,
.gh-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-ancestor > .wp-block-navigation-item__content::after {
	content: "";
	display: block;
	width: 4px;
	height: 100%;
	background-color: #B91C1C !important;
	position: absolute;
	left: 0;
	top: 0;
	border-radius: 2px 0 0 2px;
}

/* Remove the white background entirely for active items in mobile, use indicator instead */
.gh-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-item > .wp-block-navigation-item__content {
	background: transparent !important;
	color: #ffffff !important;
	font-weight: 700 !important;
	text-decoration: underline !important;
	text-decoration-color: #ffffff !important;
	text-decoration-thickness: 3px !important;
	text-underline-offset: 4px !important;
}

/* ============================================================================
   6. CONTENT AREA
   ========================================================================= */

.gh-content {
	padding-top: 40px;
	padding-bottom: 60px;
}

/* Gutter for any content sitting outside a styled band */
.wp-site-blocks > main,
main.wp-block-group {
	padding-left: var(--gh-gutter);
	padding-right: var(--gh-gutter);
}

.gh-content h1,
.entry-content h1 {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.25;
	margin-top: 0;
	margin-bottom: 20px;
	color: var(--gh-body);
}

.gh-content h2,
.entry-content h2 {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.3;
	margin-top: 38px;
	margin-bottom: 14px;
	color: var(--gh-body);
}

.gh-content h3,
.entry-content h3 {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.35;
	margin-top: 28px;
	margin-bottom: 10px;
	color: var(--gh-body);
}

.gh-content p,
.entry-content p {
	margin-bottom: 18px;
}

.gh-content ul,
.gh-content ol {
	margin-bottom: 18px;
	padding-left: 22px;
}

/* ============================================================================
   7. ENGINEERING PAGE — DOWNLOAD ROWS
   ========================================================================= */

.gh-download-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.gh-download-row .gh-doc-label {
	color: var(--gh-red);
	font-size: 15px;
	margin: 0;
}

.gh-download-row .wp-block-button__link {
	background-color: var(--gh-button);
	color: #ffffff;
	border-radius: 9999px;
	padding: 8px 20px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
}

.gh-download-row .wp-block-button__link:hover,
.gh-download-row .wp-block-button__link:focus {
	background-color: var(--gh-button-hov);
	color: #ffffff;
}

/* ============================================================================
   8. FOOTER
   ========================================================================= */

.gh-footer {
	background-color: var(--gh-footer-bg);
	padding-top: 44px;
	padding-bottom: 34px;
	text-align: center;
}

.gh-footer p {
	margin-left: auto;
	margin-right: auto;
}

.gh-footer .gh-footer-contact {
	font-size: 19px;
	line-height: 1.5;
	color: var(--gh-body);
	margin-bottom: 22px;
}

.gh-footer .gh-footer-contact strong {
	font-weight: 700;
}

.gh-footer .gh-footer-contact a,
.gh-footer .gh-footer-contact a:visited {
	color: var(--gh-red);
	text-decoration: none;
}

.gh-footer .gh-footer-contact a:hover,
.gh-footer .gh-footer-contact a:focus {
	color: var(--gh-red-dark);
	text-decoration: underline;
}

.gh-footer .gh-footer-name {
	color: var(--gh-red);
	font-size: 15px;
	margin-bottom: 26px;
}

.gh-footer .gh-footer-name a {
	color: var(--gh-red);
	text-decoration: none;
}

.gh-footer .gh-footer-copy {
	color: var(--gh-muted);
	font-size: 13px;
	margin-bottom: 0;
}

/* ============================================================================
   9. RESPONSIVE
   ========================================================================= */

@media (max-width: 1120px) {
	.gh-navband .wp-block-navigation-item__content {
		padding: 12px 11px !important;
		font-size: 14px;
	}
}

@media (max-width: 940px) {
	.gh-navband .wp-block-navigation-item__content {
		padding: 11px 9px !important;
		font-size: 13px;
	}
}

@media (max-width: 800px) {
	:root {
		--gh-gutter: 18px;
	}

	.gh-logoband img {
		max-width: 360px;
	}

	.gh-logoband {
		padding-top: 22px;
		padding-bottom: 18px;
	}

	.gh-content {
		padding-top: 28px;
		padding-bottom: 44px;
	}

	.gh-content h1,
	.entry-content h1 { font-size: 25px; }

	.gh-content h2,
	.entry-content h2 { font-size: 22px; }

	.gh-content h3,
	.entry-content h3 { font-size: 19px; }

	.gh-footer .gh-footer-contact { font-size: 16px; }

	.gh-footer {
		padding-top: 32px;
		padding-bottom: 26px;
	}
}

@media (max-width: 480px) {
	.gh-topbar {
		font-size: 13px;
		padding-top: 11px;
		padding-bottom: 11px;
	}

	.gh-logoband img {
		max-width: 280px;
	}

	.gh-footer .gh-footer-contact {
		font-size: 15px;
	}
}

/* ============================================================
   BUTTON HOVER — universal safety net
   ============================================================ */

/* Fill-style buttons: darken slightly on hover, keep white text */
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
.wp-element-button:not(.is-style-outline):hover {
	background-color: #4A4A4A !important;
	color: #ffffff !important;
	opacity: 1;
}

/* Outline-style buttons: fill dark on hover, white text */
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
	background-color: #333333 !important;
	border-color: #333333 !important;
	color: #ffffff !important;
	opacity: 1;
}

/* ============================================================
   metaslider text fix
   ============================================================ */
   
.metaslider.metaslider-136 .flexslider .caption-wrap,
.metaslider.metaslider-136 .caption {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box;
}
