/* ==========================================================================
   MWM Astra Child - styles
   Black, clean. Every color comes from the logo.
   ========================================================================== */

/* ---------- Fonts (SIL OFL - licenses in assets/fonts) ---------- */
@font-face {
	font-family: "MWM Sans";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2");
}
@font-face {
	font-family: "MWM Serif";
	font-style: italic;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/pt-serif-latin-400-italic.woff2") format("woff2");
}

/* ---------- Colorway ---------- */
:root {
	/* Blacks */
	--mwm-black:    #0a0a0a;   /* page */
	--mwm-port:     #000000;   /* portholes */
	--mwm-surface:  #141414;   /* cards, panels */
	--mwm-raised:   #1c1c1c;   /* inputs, hover surfaces */
	--mwm-line:     #2a2a2a;   /* hairlines, borders */

	/* Greys - from the dots and wordmark */
	--mwm-head:     #f2f2f2;   /* headings                      17.7:1 */
	--mwm-body:     #bdbdbd;   /* body - WEB MARKETING grey      10.5:1 */
	--mwm-muted:    #8c8c8c;   /* captions - "Get found" grey     5.9:1 */
	--mwm-dot:      #9a9a9a;   /* logo dots, icons                7.0:1 */

	/* Reds - from the ball */
	--mwm-red:      #e31414;   /* brand: wordmark, large type, rules (4.1:1 - large/UI only) */
	--mwm-red-hi:   #ff3a2a;   /* links, focus, accents          5.6:1 */
	--mwm-red-btn:  #c40000;   /* button fill, white text        6.3:1 */
	--mwm-red-deep: #9e0000;   /* pressed, borders on red */

	--mwm-spot: .1625;         /* header spotlight strength */

	--mwm-font-head: "MWM Sans", "Barlow Semi Condensed", "Arial Narrow", system-ui, sans-serif;
	--mwm-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mwm-ease: cubic-bezier(.2, .7, .2, 1);

	/* ---- Astra's palette, mapped to the colorway ----
	   Overriding here keeps the front end right whatever the Customizer holds.
	   Set the same values in Customizer > Global > Colors so the block editor matches. */
	--ast-global-color-0: var(--mwm-red-hi);   /* accent: links, borders, focus */
	--ast-global-color-1: var(--mwm-red);      /* accent hover */
	--ast-global-color-2: var(--mwm-head);     /* headings */
	--ast-global-color-3: var(--mwm-body);     /* body text */
	--ast-global-color-4: var(--mwm-black);    /* page background */
	--ast-global-color-5: var(--mwm-surface);  /* secondary background */
	--ast-global-color-6: var(--mwm-raised);
	--ast-global-color-7: var(--mwm-line);
	--ast-global-color-8: var(--mwm-muted);
	--ast-global-color-primary:   var(--mwm-black);
	--ast-global-color-secondary: var(--mwm-surface);
	--ast-global-color-alternate-background: var(--mwm-raised);
	--ast-global-color-subtle-background:    var(--mwm-surface);
	--ast-border-color: var(--mwm-line);
	--ast-code-block-background: var(--mwm-surface);
	--ast-widget-bg-color: var(--mwm-surface);
	--ast-comment-inputs-background: var(--mwm-raised);
}

/* ---------- Page and spotlight ---------- */
html, body,
.ast-separate-container,
.ast-plain-container,
.ast-page-builder-template {
	background-color: var(--mwm-black);
}
body {
	position: relative;
	color: var(--mwm-body);
	font-family: var(--mwm-font-body);
}
/* The spotlight belongs to the page, not the header, so it fades into the content with no seam. */
body::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 1000px;
	pointer-events: none;
	z-index: 0;
	background:
		radial-gradient(ellipse 38% 300px at 14% 90px, rgba(255, 255, 255, var(--mwm-spot)), transparent 70%),
		radial-gradient(ellipse 70% 680px at 22% 0, rgba(255, 255, 255, calc(var(--mwm-spot) * .45)), transparent 75%);
}
#page { position: relative; z-index: 1; }

/* Let the spotlight show through Astra's content wrappers */
.site-content,
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container .comments-area,
.ast-separate-container .ast-author-box,
.ast-plain-container .site-content,
.ast-separate-container .site-main > .ast-row,
.ast-separate-container #primary,
.ast-separate-container .ast-archive-description {
	background-color: transparent;
}

/* ---------- Header ---------- */
.mwm-header { position: relative; }
.mwm-header__inner {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px 24px 8px;
}
.mwm-brand { position: relative; max-width: 940px; }
.mwm-logo-link { display: block; line-height: 0; text-decoration: none; }
.mwm-logo-link:focus-visible { outline: 2px solid var(--mwm-red-hi); outline-offset: 6px; }
#mwm-logo { display: block; width: 100%; height: auto; overflow: visible; }

#mwm-logo .mwm-dots { fill: var(--mwm-dot); }
#mwm-logo .mwm-port {
	fill: var(--mwm-port);
	stroke: var(--mwm-line);
	stroke-width: 1;
	transition: stroke .25s var(--mwm-ease);
}
#mwm-logo .mwm-port.is-lit { stroke: var(--mwm-red); }
#mwm-logo .mwm-wm {
	/* thin black edge so the wordmark reads as in front of the ball */
	stroke: var(--mwm-black);
	stroke-width: 1.6px;
	paint-order: stroke;
	stroke-linejoin: round;
}
#mwm-logo .mwm-wm--name { font: 600 22.5px var(--mwm-font-head); fill: var(--mwm-red); }
#mwm-logo .mwm-wm--sub  { font: 600 22.5px var(--mwm-font-head); fill: var(--mwm-body); }
#mwm-logo .mwm-wm--tag  { font: italic 400 18px "MWM Serif", Georgia, serif; fill: var(--mwm-muted); }

/* Ball waits off-stage until the script starts it. If the script never runs, it appears after 3s. */
.mwm-logo-pending #mwm-ball { opacity: 0; animation: mwm-ball-fallback 0s 3s forwards; }
@keyframes mwm-ball-fallback { to { opacity: 1; } }

/* Menus shared */
.mwm-header .mwm-menu { list-style: none; margin: 0; padding: 0; }
.mwm-header .mwm-menu a {
	font: 600 13px/1 var(--mwm-font-head);
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--mwm-muted);
	text-decoration: none;
	transition: color .2s var(--mwm-ease);
}
.mwm-header .mwm-menu a:hover,
.mwm-header .mwm-menu a:focus-visible { color: var(--mwm-head); }
.mwm-header .mwm-menu .current-menu-item > a,
.mwm-header .mwm-menu a[aria-current="page"] { color: var(--mwm-red-hi); }

/* Utility links, top right where the phone number used to be */
.mwm-utility { position: absolute; top: 18px; right: 24px; z-index: 2; }
.mwm-utility .mwm-menu { display: flex; gap: 22px; }
.mwm-utility .mwm-menu a { font-size: 12px; }

/* Services: one label under each porthole. Positions are porthole centers as % of the 940-wide logo. */
.mwm-services { position: absolute; left: 0; right: 0; top: 66%; height: 0; }
.mwm-services .mwm-menu li { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.mwm-services .mwm-menu li:nth-child(1) { left: 51.649%; }  /* 485.5 / 940 */
.mwm-services .mwm-menu li:nth-child(2) { left: 62.287%; }  /* 585.5 */
.mwm-services .mwm-menu li:nth-child(3) { left: 72.926%; }  /* 685.5 */
.mwm-services .mwm-menu li:nth-child(4) { left: 83.564%; }  /* 785.5 */
.mwm-services .mwm-menu li:nth-child(5) { left: 94.202%; }  /* 885.5 */
.mwm-services .mwm-menu li:nth-child(n+6) { display: none; } /* five portholes, five items */
.mwm-services .mwm-menu a { display: inline-block; padding: 6px 2px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6,
.entry-content :where(h1, h2, h3, h4, h5, h6),
.entry-title, .site-title, .widget-title {
	font-family: var(--mwm-font-head);
	font-weight: 600;
	color: var(--mwm-head);
	line-height: 1.15;
	letter-spacing: .005em;
}
.entry-title, .entry-title a { color: var(--mwm-head); }

a,
.entry-content a,
.ast-single-post .entry-content a,
.page-title { color: var(--mwm-red-hi); }
a:hover,
a:focus,
.entry-content a:hover,
.ast-single-post .entry-content a:hover { color: var(--mwm-head); }
.entry-content a { text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--mwm-red-hi); outline-offset: 3px; }
::selection { background: var(--mwm-red-btn); color: #fff; }

hr, .wp-block-separator { border-color: var(--mwm-line); background-color: var(--mwm-line); }
.wp-block-separator.is-style-mwm-rule { width: 48px; height: 3px; border: 0; background: var(--mwm-red); margin-left: 0; }
blockquote, .wp-block-quote { border-left-color: var(--mwm-red); color: var(--mwm-head); }

/* ---------- Buttons ---------- */
body .wp-block-button .wp-block-button__link,
body .wp-element-button,
body .ast-button,
body .button,
body button:not(.menu-toggle):not(.ast-mobile-popup-close),
body input[type="submit"],
body input[type="button"],
body input[type="reset"] {
	background-color: var(--mwm-red-btn);
	border: 1px solid var(--mwm-red-btn);
	color: #fff;
	font-family: var(--mwm-font-head);
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-radius: 3px;
	transition: background-color .2s var(--mwm-ease), border-color .2s var(--mwm-ease), color .2s;
}
body .wp-block-button .wp-block-button__link:hover,
body .wp-element-button:hover,
body .ast-button:hover,
body .button:hover,
body button:not(.menu-toggle):not(.ast-mobile-popup-close):hover,
body input[type="submit"]:hover,
body input[type="button"]:hover {
	background-color: var(--mwm-red);
	border-color: var(--mwm-red);
	color: #fff;
}
body .wp-block-button .wp-block-button__link:active,
body button:active,
body input[type="submit"]:active { background-color: var(--mwm-red-deep); border-color: var(--mwm-red-deep); }

/* Outline style button */
body .wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border: 1px solid var(--mwm-line);
	color: var(--mwm-head);
}
body .wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: var(--mwm-red); background: transparent; }

/* ---------- Forms (Contact Form 7, comments, search) ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
input[type="search"], input[type="number"], input[type="password"],
textarea, select {
	background-color: var(--mwm-raised);
	border: 1px solid var(--mwm-line);
	color: var(--mwm-head);
	border-radius: 3px;
}
input:focus, textarea:focus, select:focus { border-color: var(--mwm-red-hi); outline: none; }
::placeholder { color: var(--mwm-muted); opacity: 1; }
.wpcf7-not-valid-tip { color: var(--mwm-red-hi); }
.wpcf7 form .wpcf7-response-output { border-color: var(--mwm-line); color: var(--mwm-body); }

/* ---------- Footer ---------- */
.site-footer,
.site-footer .site-primary-footer-wrap,
.site-footer .site-above-footer-wrap,
.site-footer .site-below-footer-wrap,
.ast-small-footer {
	background-color: transparent;
	color: var(--mwm-muted);
}
.site-footer { border-top: 1px solid #161616; }
.site-footer a { color: var(--mwm-muted); text-decoration: none; }
.site-footer a:hover { color: var(--mwm-head); }

/* ---------- Narrow screens ----------
   The logo script crops the SVG to the logo alone; the portholes go and the
   services become a plain row under the logo. */
@media (max-width: 720px) {
	.mwm-header__inner { padding: 14px 18px 4px; }
	.mwm-brand { max-width: 380px; }
	.mwm-utility { position: static; margin-bottom: 10px; }
	.mwm-utility .mwm-menu { justify-content: flex-end; gap: 16px; }
	.mwm-services { position: static; height: auto; margin-top: 12px; }
	.mwm-services .mwm-menu { display: flex; flex-wrap: wrap; gap: 4px 18px; }
	.mwm-services .mwm-menu li { position: static; transform: none; }
	#mwm-logo .mwm-ports { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
	.mwm-logo-pending #mwm-ball { opacity: 1; }
}
