/*
Theme Name: Machined Parts
Theme URI: https://machinedpartsonline.com/
Author: Machined Parts Inc.
Description: Lightweight block theme for Machined Parts Inc. — CNC machining services, quote requests with CAD file upload, FAQs. No page builder, no slider, no shop.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 2.0.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: machined-parts
*/

/* ---------- Headings: navy on light backgrounds, inherit on coloured sections ---------- */
:where(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--navy);
}
/* Text inside dark sections always follows the section's text color,
   even if a site-wide heading or paragraph color is set in Styles. */
.has-text-color :is(h1, h2, h3, h4, h5, h6, p, li),
.has-navy-background-color :is(h1, h2, h3, h4, h5, h6, p, li),
.has-ink-background-color :is(h1, h2, h3, h4, h5, h6, p, li),
.wp-block-cover:not(.is-light) :is(h1, h2, h3, h4, h5, h6, p, li) {
	color: inherit;
}
.has-navy-background-color,
.has-ink-background-color {
	color: var(--wp--preset--color--white);
}
.has-ink-background-color.has-line-color {
	color: var(--wp--preset--color--line);
}

/* ---------- Top bar ---------- */
.mp-topbar p {
	margin: 0;
}
.mp-topbar a {
	color: inherit;
	text-decoration: none;
}
.mp-topbar a:hover,
.mp-topbar a:focus {
	text-decoration: underline;
}

/* ---------- Header ---------- */
.mp-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
}
.mp-header {
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .mp-site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}
.mp-header .wp-block-site-title a {
	text-decoration: none;
	color: var(--wp--preset--color--navy);
}
.mp-header .wp-block-navigation a:hover,
.mp-header .wp-block-navigation a:focus {
	color: var(--wp--preset--color--accent-strong);
}

/* ---------- Sections on dark backgrounds ---------- */
.has-navy-background-color a:where(:not(.wp-element-button)),
.has-ink-background-color a:where(:not(.wp-element-button)) {
	color: inherit;
}
.mp-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 700;
}
.has-navy-background-color p.mp-eyebrow,
.has-ink-background-color p.mp-eyebrow,
.wp-block-cover:not(.is-light) p.mp-eyebrow {
	color: var(--wp--preset--color--accent);
}

/* ---------- Outline button variant on dark backgrounds ---------- */
.has-navy-background-color .is-style-outline .wp-block-button__link,
.wp-block-cover:not(.is-light) .is-style-outline .wp-block-button__link {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.7);
}

/* ---------- Cards ---------- */
.mp-card {
	height: 100%;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	background: var(--wp--preset--color--white);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mp-card:hover {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 6px 20px rgba(15, 42, 74, 0.08);
}
.mp-card > :first-child {
	margin-top: 0;
}

/* ---------- Process steps ---------- */
.mp-step-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-strong);
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	margin-bottom: 0.5rem;
}

/* ---------- Plain lists (footer, link lists) ---------- */
.mp-plain-list {
	list-style: none;
	padding-left: 0;
}
.mp-plain-list li {
	margin-bottom: 0.4rem;
}

/* ---------- Check lists ---------- */
.mp-check-list {
	list-style: none;
	padding-left: 0;
}
.mp-check-list li {
	position: relative;
	padding-left: 1.6rem;
	margin-bottom: 0.5rem;
}
.mp-check-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 0.9rem;
	height: 0.5rem;
	border-left: 3px solid var(--wp--preset--color--accent-strong);
	border-bottom: 3px solid var(--wp--preset--color--accent-strong);
	transform: rotate(-45deg);
}

/* ---------- FAQ accordion (core Details block) ---------- */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 1rem 0;
}
.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--navy);
}
.wp-block-details[open] summary {
	margin-bottom: 0.75rem;
}

/* ---------- Footer ---------- */
.mp-footer a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration: none;
}
.mp-footer a:where(:not(.wp-element-button)):hover,
.mp-footer a:where(:not(.wp-element-button)):focus {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}
.mp-footer .mp-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---------- Placeholder notes left for the site owner ---------- */
.mp-todo {
	border-left: 4px solid var(--wp--preset--color--accent);
	background: #EEF5FB;
	padding: 0.75rem 1rem;
}

/* ---------- No gap between header, main and footer ---------- */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Small screens: keep the header on one line ---------- */
@media (max-width: 640px) {
	.mp-header .wp-block-buttons {
		display: none;
	}
	.mp-header .wp-block-site-title {
		font-size: 1.05rem;
	}
}

/* ---------- Footer: keep the email address on one line ---------- */
.mp-footer a[href^="mailto:"] {
	white-space: nowrap;
}
@media (min-width: 782px) {
	.mp-footer .wp-block-columns > .wp-block-column:last-child {
		flex-grow: 1.35;
	}
}
@media (min-width: 782px) and (max-width: 1100px) {
	.mp-footer a[href^="mailto:"] {
		font-size: 0.9em;
	}
}

/* ---------- Contact cards: keep email addresses on one line ---------- */
.mp-card a[href^="mailto:"] {
	white-space: nowrap;
}

/* ---------- Galleries: square bordered tiles ---------- */
.wp-block-gallery .wp-block-image img {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 0;
	background: #fff;
	box-sizing: border-box;
	transition: border-color 0.15s ease;
}
.wp-block-gallery .wp-block-image:hover img,
.wp-block-gallery .wp-block-image a:focus img {
	border-color: var(--wp--preset--color--accent-strong);
}
