/*
Theme Name:        New Order Enterprizes TT4 Child
Theme URI:         https://neworder.ca/
Description:       Child theme of Twenty Twenty-Four, styled to match the
                   New Order Enterprizes site (Custom Steel Division).
Author:            New Order Enterprizes
Author URI:        https://neworder.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:       neworder-tt4
*/

/* ============================================================================
   1. DESIGN TOKENS
   ========================================================================= */

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

/* ============================================================================
   2. FULL-BLEED BANDS
   Pulls the red header bands and grey footer out to the viewport edges.
   ========================================================================= */

.noe-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
   ========================================================================= */

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

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

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

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

/* ============================================================================
   4. LOGO BAND
   The New Order logo is wider and shorter than the Groundhog one, so the
   max-width is a little larger to keep it legible.
   ========================================================================= */

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

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

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

/* ============================================================================
   5. NAVIGATION
   Five items, so no wrapping pressure at any reasonable width.
   ========================================================================= */

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

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

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

.noe-navband .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	color: #ffffff !important;
	padding: 13px 18px !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;
}

.noe-navband .wp-block-navigation-item__content:hover,
.noe-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 */
.noe-navband .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content,
.noe-navband .wp-block-navigation-item.current-menu-ancestor > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: var(--noe-red) !important;
	border-radius: 4px 4px 0 0;
}

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

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

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

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

/* Hamburger / close icons */
.noe-navband .wp-block-navigation__responsive-container-open,
.noe-navband .wp-block-navigation__responsive-container-close {
	color: #ffffff;
	fill: #ffffff;
}

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

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

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

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

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

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

/* All links and labels inside the mobile menu */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open a,
.noe-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content,
.noe-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__label,
.noe-navband .wp-block-navigation__popover a,
.noe-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 */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open a:hover,
.noe-navband .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover,
.noe-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 */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open .current-menu-item > .wp-block-navigation-item__content,
.noe-navband .wp-block-navigation__responsive-container.is-menu-open .current-menu-ancestor > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: var(--noe-red) !important;
	font-weight: 600 !important;
	border-radius: 4px !important;
	padding: 12px 18px !important;
}

/* Fallback selectors */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open li[data-wp-state-active],
.noe-navband .wp-block-navigation-item--current > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: #9B1616 !important;
}

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

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

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

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

/* Edge case: nested submenus */
.noe-navband .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
	background-color: var(--noe-red-dark) !important;
}

/* ============================================================
   ACTIVE MENU ITEM — MOBILE OVERLAY VISIBILITY FIX (NOE)
   ============================================================ */

/* Active page in mobile menu — ensure high contrast */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-item > .wp-block-navigation-item__content,
.noe-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 */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open 
	li[data-wp-state-active],
.noe-navband .wp-block-navigation-item--current > .wp-block-navigation-item__content {
	background-color: #ffffff !important;
	color: #B91C1C !important;
}

/* Alternative indicator if background stays problematic */
.noe-navband .wp-block-navigation__responsive-container.is-menu-open 
	.current-menu-item > .wp-block-navigation-item__content::after,
.noe-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 */
.noe-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
   ========================================================================= */

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

.wp-site-blocks > main,
main.wp-block-group {
	padding-left: var(--noe-gutter);
	padding-right: var(--noe-gutter);
}

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

.noe-content h2,
.entry-content h2 {
	font-size: 27px;
	font-weight: 700;
	line-height: 1.3;
	margin-top: 30px;
	margin-bottom: 18px;
	color: var(--noe-body);
}

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

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

/* ============================================================================
   7. HEAVY SECTION RULES
   The dark full-width dividers between the project rows on the homepage.
   Use a Separator block and give it the class "noe-rule".
   ========================================================================= */

.noe-rule,
.wp-block-separator.noe-rule {
	border: none !important;
	border-top: 2px solid var(--noe-rule) !important;
	background: none !important;
	height: 0 !important;
	margin-top: 34px !important;
	margin-bottom: 34px !important;
	opacity: 1 !important;
}

/* ============================================================================
   8. IMAGE CAPTIONS
   The red bold labels under the project photos.
   Wrap the image + caption in a Figure block, or add the class to the
   figcaption element via the block's Advanced panel.
   ========================================================================= */

.noe-caption,
.wp-block-image .noe-caption,
figure.noe-figure figcaption {
	color: var(--noe-red) !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.4 !important;
	text-align: left !important;
	margin-top: 10px !important;
	padding: 0 !important;
}

/* Linked project images: no underline, subtle zoom on hover */
.noe-figure a {
	display: block;
	text-decoration: none;
	border-bottom: none;
}

.noe-figure img {
	display: block;
	width: 100%;
	height: auto;
	transition: opacity .18s ease;
}

.noe-figure a:hover img {
	opacity: .88;
}

/* ============================================================================
   9. PROJECT ROWS
   Text-and-image pairs that alternate sides down the page.
   ========================================================================= */

.noe-project-row {
	margin-top: 0;
	margin-bottom: 0;
}

.noe-project-row .wp-block-column {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* ============================================================================
   10. FOOTER
   ========================================================================= */

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

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

/* Italic thank-you line */
.noe-footer .noe-footer-thanks {
	font-size: 17px;
	font-style: italic;
	line-height: 1.5;
	color: var(--noe-muted);
	margin-bottom: 22px;
}

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

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

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

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

/* Sister-site cross link */
.noe-footer .noe-footer-crosslink {
	font-size: 15px;
	margin-bottom: 26px;
}

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

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

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

/* ============================================================================
   11. BUTTONS — hover safety net
   ========================================================================= */

.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: var(--noe-button-hov) !important;
	color: #ffffff !important;
	opacity: 1;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus {
	background-color: var(--noe-button) !important;
	border-color: var(--noe-button) !important;
	color: #ffffff !important;
	opacity: 1;
}

/* ============================================================================
   12. RESPONSIVE
   ========================================================================= */

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

	.noe-logoband img {
		max-width: 380px;
	}

	.noe-logoband {
		padding-top: 20px;
		padding-bottom: 18px;
	}

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

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

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

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

	.noe-rule {
		margin-top: 26px !important;
		margin-bottom: 26px !important;
	}

	.noe-footer .noe-footer-contact { font-size: 16px; }
	.noe-footer .noe-footer-thanks  { font-size: 15px; }

	.noe-footer {
		padding-top: 30px;
		padding-bottom: 26px;
	}
}

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

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

	.noe-logoband img {
		max-width: 290px;
	}

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