/*
 * Northside: theme styles.
 *
 * Values are copied from design/desktop/index.html (1440px) and
 * design/mobile/index.html (390px). Fluid values use clamp() so they hit the
 * mobile value exactly at 390px and the desktop value exactly at 1440px.
 *
 * Breakpoints:
 *   < 782px      mobile layout (design/mobile)
 *   782–1239px   desktop layout, header nav collapsed into the menu button
 *                (5 items: Home, About, Equipment, Why Northside, Contact)
 *   >= 1240px    full desktop layout (design/desktop)
 */

/* -------------------------------------------------------------------------
 * Tokens
 * ---------------------------------------------------------------------- */
:root {
	--ns-yellow: var(--wp--preset--color--yellow, #f6be00);
	--ns-black: var(--wp--preset--color--black, #161616);
	--ns-ink: var(--wp--preset--color--ink, #0b0b0b);
	--ns-white: var(--wp--preset--color--white, #ffffff);
	--ns-stone: var(--wp--preset--color--stone, #b9b6ad);
	--ns-divider: var(--wp--custom--color--divider, #5a5850);
	--ns-control-border: var(--wp--custom--color--control-border, #3a3935);
	--ns-footer-rule: var(--wp--custom--color--footer-rule, #2a2926);
	--ns-footer-fine: var(--wp--custom--color--footer-fine, #8a877e);
	--ns-oswald: var(--wp--preset--font-family--oswald, "Oswald", "Barlow", sans-serif);
	--ns-barlow: var(--wp--preset--font-family--barlow, "Barlow", system-ui, sans-serif);

	--ns-max: 1312px;
	--ns-pad: clamp(20px, 3.6571px + 4.1905vw, 64px);
	/* Side padding that also centres content on screens wider than 1440px. */
	--ns-gutter: max(var(--ns-pad), calc((100% - var(--ns-max)) / 2));

	--ns-stripe-band: 18px;
	--ns-stripe-height: 12px;

	--ns-icon-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E");
	--ns-icon-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
	--ns-icon-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
	--ns-icon-phone-bold: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
	--ns-icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
	--ns-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}

@media (max-width: 781px) {
	:root {
		--ns-stripe-band: 12px;
		--ns-stripe-height: 10px;
	}
}

/* -------------------------------------------------------------------------
 * Base
 * ---------------------------------------------------------------------- */
html {
	-webkit-text-size-adjust: 100%;
}

body {
	overflow-x: clip;
}

/* Clip sideways overflow at the site wrapper (body clip doesn't reach the
   viewport in Chrome). "clip" isn't a scroll container, so sticky still works. */
.wp-site-blocks {
	overflow-x: clip;
}

/* Template parts and sections butt together; spacing comes from each section. */
.wp-site-blocks > *,
.ns-site-header.ns-site-header,
.ns-main.ns-main,
.ns-site-footer.ns-site-footer,
.ns-main > .entry-content > *,
.ns-main > .wp-block-post-content > * {
	margin-block: 0;
}

a:hover {
	opacity: 0.88;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--ns-yellow);
	outline-offset: 2px;
}

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

.screen-reader-text:focus {
	background: var(--ns-yellow);
	color: var(--ns-black);
}

/* Show/hide helpers (locked into patterns, not offered to the client). */
@media (max-width: 781px) {
	.ns-hide-mobile {
		display: none !important;
	}
}

@media (min-width: 782px) {
	.ns-show-mobile {
		display: none !important;
	}
}

/* Make a whole box clickable via the single link inside it. */
.ns-stretch-link {
	position: relative;
}

.ns-stretch-link a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ns-stretch-link a:focus-visible {
	outline: none;
}

.ns-stretch-link:has(a:focus-visible) {
	outline: 3px solid var(--ns-black);
	outline-offset: -6px;
}

.ns-stretch-link:hover {
	opacity: 0.88;
}

.ns-stretch-link a:hover {
	opacity: 1;
}

/* -------------------------------------------------------------------------
 * Hazard stripe
 * ---------------------------------------------------------------------- */
.ns-hazard,
.wp-block-separator.is-style-hazard {
	display: block;
	width: 100% !important;
	max-width: none !important;
	border: 0;
	opacity: 1;
	height: var(--ns-stripe-height);
	min-height: var(--ns-stripe-height);
	margin: 0 !important;
	padding: 0 !important;
	background: repeating-linear-gradient(-45deg, var(--ns-black) 0 var(--ns-stripe-band), var(--ns-yellow) var(--ns-stripe-band) calc(var(--ns-stripe-band) * 2));
}

/* -------------------------------------------------------------------------
 * Icons (CSS masks, decorative)
 * ---------------------------------------------------------------------- */
.ns-icon {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ns-icon::before {
	content: "";
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: var(--ns-icon) center / contain no-repeat;
	mask: var(--ns-icon) center / contain no-repeat;
}

.ns-icon--mail { --ns-icon: var(--ns-icon-mail); }
.ns-icon--pin { --ns-icon: var(--ns-icon-pin); }
.ns-icon--phone { --ns-icon: var(--ns-icon-phone-bold); }

/* -------------------------------------------------------------------------
 * Brand (logo badge + name), shared by header and footer
 * ---------------------------------------------------------------------- */
.ns-brand.ns-brand {
	gap: 14px;
	align-items: center;
}

.ns-brand .wp-block-site-logo {
	flex-shrink: 0;
	line-height: 0;
}

.ns-brand .wp-block-site-logo img {
	display: block;
	width: auto;
	height: 56px;
	max-width: none;
}

.ns-logo-badge a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	background: var(--ns-yellow);
	color: var(--ns-black);
	font-family: var(--ns-oswald);
	font-size: 22px;
	font-weight: 700;
	line-height: normal;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ns-brand__text.ns-brand__text {
	gap: 2px;
	align-items: flex-start;
}

.ns-brand__name {
	margin: 0;
	color: var(--ns-white);
	font-family: var(--ns-oswald);
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ns-brand__name a {
	color: inherit;
}

.ns-brand__sub {
	margin: 0;
	color: var(--ns-yellow);
	font-family: var(--ns-oswald);
	font-size: 13px;
	font-weight: 500;
	line-height: normal;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

@media (max-width: 781px) {
	.ns-brand.ns-brand {
		gap: 10px;
	}

	.ns-logo-badge a {
		width: 42px;
		height: 42px;
		font-size: 17px;
	}

	.ns-brand .wp-block-site-logo img {
		height: 42px;
	}

	.ns-brand__text.ns-brand__text {
		gap: 1px;
	}

	.ns-brand__name {
		font-size: 19px;
	}

	.ns-brand__sub {
		font-size: 11px;
	}
}

/* Editor only: show the NSW badge in place of the empty Site Logo placeholder. */
.ns-brand .wp-block-site-logo .components-placeholder {
	width: 56px !important;
	height: 56px !important;
	min-height: 0 !important;
	min-width: 0 !important;
	padding: 0 !important;
	border-radius: 0 !important;
	background: var(--ns-yellow) !important;
	box-shadow: none !important;
	overflow: hidden;
}

.ns-brand .wp-block-site-logo .components-placeholder > * {
	opacity: 0;
}

.ns-brand .wp-block-site-logo .components-placeholder::after {
	content: "NSW";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ns-black);
	font-family: var(--ns-oswald);
	font-size: 22px;
	font-weight: 700;
	pointer-events: none;
}

@media (max-width: 781px) {
	.ns-brand .wp-block-site-logo .components-placeholder {
		width: 42px !important;
		height: 42px !important;
	}

	.ns-brand .wp-block-site-logo .components-placeholder::after {
		font-size: 17px;
	}
}

/* -------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */
.ns-site-header p {
	margin: 0;
}

/* Header/footer rows stack flush (the editor's flow layout would add gaps). */
.ns-utility.ns-utility,
.ns-masthead.ns-masthead,
.ns-tapbar.ns-tapbar,
.ns-footer.ns-footer,
.ns-footer > * {
	margin-block: 0 !important;
}

/* Utility bar (desktop only) */
.ns-utility.ns-utility {
	height: 40px;
	padding: 0 var(--ns-gutter);
	gap: 28px;
	background: var(--ns-ink);
	color: var(--ns-stone);
	font-size: 14px;
	line-height: normal;
}

.ns-utility__group.ns-utility__group {
	gap: 28px;
}

.ns-utility__group--divided > p + p::before {
	content: "|";
	margin-right: 28px;
	color: var(--ns-divider);
}

/* Masthead */
.ns-masthead.ns-masthead {
	height: 96px;
	padding-left: var(--ns-gutter);
	gap: 0;
	align-items: stretch;
	background: var(--ns-black);
}

.ns-masthead > .ns-brand {
	align-self: center;
}

/* Primary navigation (desktop) */
.ns-nav.ns-nav {
	align-self: center;
	gap: 40px;
	color: var(--ns-white);
	font-family: var(--ns-oswald);
	font-size: 17px;
	font-weight: 500;
	line-height: normal;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ns-nav .wp-block-navigation__container {
	gap: 40px;
}

.ns-nav .wp-block-navigation-item__content {
	padding: 0;
}

.ns-nav .current-menu-item > .wp-block-navigation-item__content,
.ns-nav .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--ns-yellow);
}

/* Menu button (replaces core icon with the design's 3-line icon) */
.ns-nav .wp-block-navigation__responsive-container-open {
	width: 48px;
	height: 48px;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--ns-control-border);
	background: transparent;
	color: var(--ns-white);
	cursor: pointer;
}

.ns-nav .wp-block-navigation__responsive-container-open svg,
.ns-nav .wp-block-navigation__responsive-container-close svg {
	display: none;
}

.ns-nav .wp-block-navigation__responsive-container-open::before,
.ns-nav .wp-block-navigation__responsive-container-close::before {
	content: "";
	width: 24px;
	height: 24px;
	background-color: currentColor;
	-webkit-mask: var(--ns-icon-menu) center / contain no-repeat;
	mask: var(--ns-icon-menu) center / contain no-repeat;
}

.ns-nav .wp-block-navigation__responsive-container-close::before {
	-webkit-mask-image: var(--ns-icon-close);
	mask-image: var(--ns-icon-close);
}

/* Mobile menu overlay */
.ns-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: 0;
	background: var(--ns-black);
	color: var(--ns-white);
}

.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
	max-width: none;
}

.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.ns-nav .wp-block-navigation__responsive-container-close {
	top: 10px;
	right: 16px;
	background: transparent;
	display: flex;
	width: 48px;
	height: 48px;
	align-items: center;
	justify-content: center;
	border: 2px solid var(--ns-control-border);
	color: var(--ns-white);
}

.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding: 96px 20px 40px;
	border-top: 0;
	align-items: stretch;
}

.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 0;
	width: 100%;
	align-items: stretch;
}

.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	border-bottom: 1px solid var(--ns-control-border);
}

.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 18px 0;
	font-size: 28px;
	font-weight: 600;
	line-height: 1.1;
}

/* Collapse the nav into the menu button below 1240px (core's default is 600px). */
@media (min-width: 600px) and (max-width: 1239px) {
	.ns-nav .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.ns-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

@media (min-width: 782px) {
	.ns-nav .wp-block-navigation__responsive-container-close {
		top: 64px;
		right: calc(var(--ns-pad) + 24px);
	}

	.ns-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		padding: 160px var(--ns-pad) 64px;
	}
}

@media (max-width: 1239px) {
	.ns-masthead > .ns-nav {
		margin-left: auto;
		margin-right: 24px;
	}
}

/* "Call the shop" block (desktop) */
.ns-callbox.ns-callbox {
	display: grid;
	grid-template-columns: 48px auto;
	grid-template-rows: auto auto;
	align-content: center;
	column-gap: 16px;
	row-gap: 2px;
	padding: 0 40px 0 32px;
	background: var(--ns-yellow);
	color: var(--ns-black);
	font-family: var(--ns-oswald);
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ns-callbox::before {
	content: "";
	grid-row: 1 / 3;
	align-self: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--ns-black) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f6be00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
}

.ns-callbox__label {
	grid-column: 2;
	font-size: 13px;
	font-weight: 600;
	line-height: normal;
	letter-spacing: 0.14em;
}

.ns-callbox__number {
	grid-column: 2;
	font-size: 30px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

/* "Tap to call" bar (mobile) */
.ns-tapbar.ns-tapbar {
	height: 60px;
	gap: 12px;
	align-items: center;
	background: var(--ns-yellow);
	color: var(--ns-black);
	font-family: var(--ns-oswald);
	line-height: normal;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ns-tapbar__label {
	gap: 12px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.1em;
}

.ns-tapbar__label::before {
	width: 22px;
	height: 22px;
}

.ns-tapbar__number {
	font-size: 26px;
	font-weight: 700;
	white-space: nowrap;
}

/* Header states */
@media (min-width: 782px) {
	.ns-tapbar.ns-tapbar {
		display: none;
	}
}

@media (max-width: 781px) {
	.ns-utility.ns-utility,
	.ns-callbox.ns-callbox {
		display: none;
	}

	.ns-masthead.ns-masthead {
		height: 68px;
		padding: 0 16px;
		align-items: center;
	}

	.ns-masthead > .ns-nav {
		margin-right: 0;
	}
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */
.ns-footer.ns-footer {
	background: var(--ns-ink);
	color: var(--ns-stone);
	font-size: 17px;
	line-height: normal;
}

.ns-footer p {
	margin: 0;
}

.ns-footer__main.ns-footer__main {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: 64px;
	margin: 0;
	padding: 88px var(--ns-gutter) 64px;
}

.ns-footer__col.ns-footer__col {
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 0;
}

.ns-footer__col > * {
	margin: 0 !important;
}

.ns-footer__col--brand.ns-footer__col--brand {
	gap: 22px;
}

.ns-footer__about {
	line-height: 1.6;
}

.ns-footer__phone {
	color: var(--ns-yellow);
	font-family: var(--ns-oswald);
	font-size: 36px;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.ns-footer__heading.ns-footer__heading {
	margin-bottom: 6px !important;
	color: var(--ns-white);
	font-size: 20px;
	font-weight: 600;
	line-height: normal;
	letter-spacing: 0.06em;
}

.ns-footer__col--contact p:first-of-type {
	line-height: 1.55;
}

.ns-footer__col--links.ns-footer__col--links {
	gap: 14px;
}

.ns-footer__col--links .ns-footer__heading {
	margin-bottom: 10px !important;
}

.ns-footer__nav.ns-footer__nav,
.ns-footer__nav .wp-block-navigation__container {
	gap: 14px;
	font-family: var(--ns-barlow);
	font-size: 17px;
	font-weight: 400;
	line-height: normal;
	letter-spacing: 0;
	text-transform: none;
}

.ns-footer__nav .wp-block-navigation-item__content {
	padding: 0;
	font-weight: 400;
}

.ns-footer__nav .wp-block-navigation-item__content:hover,
.ns-footer__nav .wp-block-navigation-item__content:focus {
	color: var(--ns-white);
}

.ns-footer__bottom.ns-footer__bottom {
	margin: 0;
	padding: 24px var(--ns-gutter);
	gap: 16px;
	border-top: 1px solid var(--ns-footer-rule);
	color: var(--ns-footer-fine);
	font-size: 15px;
}

/* Footer: 782–1199 two columns */
@media (min-width: 782px) and (max-width: 1199px) {
	.ns-footer__main.ns-footer__main {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 56px 64px;
	}
}

/* Footer: mobile */
@media (max-width: 781px) {
	.ns-footer.ns-footer {
		font-size: 16px;
	}

	.ns-footer__main.ns-footer__main {
		display: flex;
		flex-direction: column;
		gap: 36px;
		padding: 48px 20px 32px;
	}

	.ns-footer__col.ns-footer__col {
		gap: 12px;
	}

	.ns-footer__col--brand.ns-footer__col--brand {
		gap: 16px;
	}

	.ns-footer .ns-brand__sub {
		display: none;
	}

	/* Mobile design shows the full company name on one line. */
	.ns-footer .ns-brand__name {
		font-size: 20px;
		line-height: normal;
	}

	.ns-footer .ns-brand__name::after {
		content: " Inc.";
	}

	.ns-footer__about {
		line-height: 1.55;
	}

	.ns-footer__phone {
		font-size: 30px;
	}

	.ns-footer__heading.ns-footer__heading {
		margin-bottom: 4px !important;
		font-size: 18px;
	}

	.ns-footer__col--contact p:first-of-type {
		line-height: 1.5;
	}

	.ns-footer__col--links.ns-footer__col--links {
		gap: 4px;
	}

	.ns-footer__col--links .ns-footer__heading {
		margin-bottom: 6px !important;
	}

	.ns-footer__nav.ns-footer__nav,
	.ns-footer__nav .wp-block-navigation__container {
		width: 100%;
	}

	.ns-footer__nav .wp-block-navigation__container {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 16px;
		row-gap: 0;
		font-size: 16px;
	}

	.ns-footer__nav .wp-block-navigation-item__content {
		display: flex;
		align-items: center;
		min-height: 44px;
	}

	.ns-footer__bottom.ns-footer__bottom {
		padding: 20px;
		font-size: 14px;
	}
}
