/* ==========================================================================
   Mofe Block Theme — block layer
   base.css carries the full design system from the static site. This file only
   bridges core blocks to those classes, so the templates render exactly like
   the static pages they were ported from.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Block shells
   -------------------------------------------------------------------------- */
/* Do not reset margins on every group: the design classes (.section-head,
   .hero-copy, .cards, ...) are groups too, and a blanket reset erases the whole
   vertical rhythm. Only the container needs its centring protected. */
.wp-block-group.container {
	margin-inline: auto;
}

/* Brand lockup (logo + wordmark) */
.mofe-brand {
	display: flex;
	align-items: center;
	gap: 9px;
	flex: 0 0 auto;
}

.mofe-brand .wp-block-site-logo img {
	width: 110px;
	height: 42px;
	max-height: 42px;
	object-fit: contain;
	object-position: left center;
}

.mofe-brand:has(.wp-block-site-logo) .wp-block-site-title {
	display: none;
}

.mofe-brand .wp-block-site-title {
	margin: 0;
}

.mofe-brand .wp-block-site-title a {
	color: var(--ink);
	text-decoration: none;
}

/* Header nav sits on the right, CTA last */
.nav-wrap .nav {
	margin-left: auto;
}

.nav-wrap .nav-link-home a {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.035em;
	color: #454047;
	text-decoration: none;
}

.nav-wrap .nav-link-home {
	margin: 0;
}

.nav-wrap .nav-instock {
	margin: 16px 0 0;
}

.wp-block-group > :last-child {
	margin-bottom: 0;
}

.editor-styles-wrapper .wp-block-group,
.editor-styles-wrapper .wp-block-column {
	min-width: 0;
}

/* The design uses CSS grid container classes. Applying them to core Columns
   keeps the visual result identical and still gives the editor real columns. */
.wp-block-columns.cards,
.wp-block-columns.feature-grid,
.wp-block-columns.two-col,
.wp-block-columns.split,
.wp-block-columns.steps,
.wp-block-columns.material-family-grid,
.wp-block-columns.product-layout,
.wp-block-columns.mofe-catalogue,
.wp-block-columns.footer-grid {
	display: grid;
	margin: 0;
}

.wp-block-columns.cards > .wp-block-column,
.wp-block-columns.feature-grid > .wp-block-column,
.wp-block-columns.two-col > .wp-block-column,
.wp-block-columns.split > .wp-block-column,
.wp-block-columns.steps > .wp-block-column,
.wp-block-columns.material-family-grid > .wp-block-column,
.wp-block-columns.product-layout > .wp-block-column,
.wp-block-columns.mofe-catalogue > .wp-block-column,
.wp-block-columns.footer-grid > .wp-block-column {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
}

/* --------------------------------------------------------------------------
   2. Dynamic blocks
   -------------------------------------------------------------------------- */
.wp-block-post-title {
	margin: 0;
	font-family: "Manrope", "DM Sans", sans-serif;
	letter-spacing: -0.055em;
}

.wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.wp-block-post-excerpt__excerpt {
	margin: 0;
}

.wp-block-post-excerpt__more-link:empty {
	display: none;
}

.wp-block-post-terms {
	font-size: 10px;
	line-height: 1.4;
}

.wp-block-post-terms a {
	color: inherit;
	text-decoration: none;
}

.wp-block-post-featured-image {
	margin: 0;
	height: 100%;
}

.wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wp-block-post-content > :first-child {
	margin-top: 0;
}

.wp-block-post-content img {
	border-radius: var(--r-sm);
}

.wp-block-post-content h2,
.wp-block-post-content h3 {
	margin-top: 1.6em;
}

/* --------------------------------------------------------------------------
   3. Query loops
   -------------------------------------------------------------------------- */
.mofe-query .wp-block-post-template {
	display: grid;
	gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(var(--mofe-min, 280px), 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.mofe-query .wp-block-post-template > li {
	margin: 0;
	min-width: 0;
	height: 100%;
}

.mofe-query .wp-block-query-pagination {
	margin-top: 34px;
	gap: 16px;
	font-size: 12px;
	font-weight: 700;
}

.mofe-query .wp-block-query-pagination a {
	color: var(--accent-dark);
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   4. Catalogue layout with sidebar (from the catalogue reference)
   -------------------------------------------------------------------------- */
.wp-block-columns.mofe-catalogue {
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 34px;
	align-items: start;
	margin-top: 8px;
}

.mofe-catalogue-aside {
	position: sticky;
	top: 104px;
	align-self: start;
}

.mofe-catalogue-main {
	min-width: 0;
}

.mofe-sidebar {
	display: grid;
	gap: 18px;
}

.mofe-sidebar .wp-block-heading {
	margin: 0 0 12px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.mofe-sidebar .wp-block-details {
	border-bottom: 1px solid var(--line);
	padding: 0;
	margin: 0;
}

.mofe-sidebar .wp-block-details:last-of-type {
	border-bottom: 0;
}

.mofe-sidebar .wp-block-details summary {
	cursor: pointer;
	padding: 12px 0;
	font-size: 12px;
	font-weight: 700;
	color: var(--ink);
	list-style: none;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.mofe-sidebar .wp-block-details summary::-webkit-details-marker {
	display: none;
}

.mofe-sidebar .wp-block-details summary::after {
	content: "+";
	color: var(--muted);
	font-weight: 400;
	font-size: 16px;
}

.mofe-sidebar .wp-block-details[open] summary::after {
	content: "−";
}

.mofe-sidebar .wp-block-details .wp-block-list {
	list-style: none;
	padding: 0 0 12px;
	margin: 0;
	display: grid;
	gap: 2px;
}

.mofe-sidebar .wp-block-details .wp-block-list a {
	display: block;
	padding: 5px 0;
	font-size: 11px;
	color: var(--muted);
	text-decoration: none;
}

.mofe-sidebar .wp-block-details .wp-block-list a:hover {
	color: var(--accent-dark);
}

.mofe-sidebar .mofe-sidebar-note p {
	font-size: 11px;
	line-height: 1.8;
	color: var(--muted);
	margin: 0;
}

/* Filter bar rendered as real links instead of JS filtering */
.filter-bar .wp-block-buttons {
	gap: 8px;
	margin: 0;
}

.filter-bar .wp-block-button__link.is-active,
.filter-bar .current-menu-item > .wp-block-button__link {
	background: var(--ink);
	color: #fff;
	border-color: var(--ink);
}

.mofe-search {
	margin-left: auto;
}

.mofe-search .wp-block-search__inside-wrapper {
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	background: var(--paper);
	overflow: hidden;
	min-width: 220px;
}

.mofe-search .wp-block-search__input {
	border: 0;
	background: transparent;
	padding: 9px 14px;
	font-size: 11px;
}

.mofe-search .wp-block-search__button {
	border-radius: 0;
	min-height: 0;
	padding: 0 14px;
	font-size: 10px;
}

/* --------------------------------------------------------------------------
   5. Runtime pieces (shortcodes)
   -------------------------------------------------------------------------- */
.mofe-empty-state p {
	font-size: 12px;
	color: var(--muted);
}

/* Inquiry form (shortcode output) */
.mofe-form-wrap {
	display: grid;
	gap: 10px;
}

.mofe-form-title {
	font-size: 15px;
	margin: 0;
}

.mofe-form-intro {
	font-size: 11px;
	line-height: 1.7;
	color: var(--muted);
	margin: 0;
}

.mofe-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mofe-sidebar-form {
	display: grid;
	gap: 10px;
}

.mofe-sidebar-form .optional {
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
	color: #a0949a;
}

.mofe-sidebar-form .mofe-form-actions {
	display: grid;
	gap: 8px;
	margin-top: 2px;
}

.mofe-submit {
	width: 100%;
	min-height: 40px;
	border: 0;
	border-radius: var(--r-control);
	background: var(--ink);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.mofe-submit:hover {
	background: var(--accent-dark);
}

.mofe-form-privacy {
	font-size: 9px;
	line-height: 1.6;
	color: #9c9196;
}

.mofe-form-privacy a {
	color: var(--accent-dark);
}

.mofe-form-status {
	margin: 0;
	padding: 10px 12px;
	border-radius: var(--r-sm);
	font-size: 11px;
	line-height: 1.6;
}

.mofe-form-status.is-success {
	background: #eaf1e6;
	color: #35502f;
	border: 1px solid #cbdcc2;
}

.mofe-form-status.is-error {
	background: #fbe9ec;
	color: #7d2c3c;
	border: 1px solid #f0c8d0;
}

.mofe-inquiry-form.form-grid {
	gap: 14px;
}

.mofe-inquiry-form.form-grid .mofe-form-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	margin-top: 17px;
}

.mofe-inquiry-form.form-grid .mofe-submit {
	width: auto;
	background: var(--accent);
	padding: 0 22px;
	min-height: 48px;
}

/* --------------------------------------------------------------------------
   6. Helpers used by the templates
   -------------------------------------------------------------------------- */
.mofe-product-gallery:has(.wp-block-post-featured-image) .mofe-gallery-fallback {
	display: none;
}

.mofe-gallery-fallback img {
	border-radius: var(--r-sm);
	background: var(--sand);
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.mofe-spec-note {
	font-size: 10px;
	color: var(--muted);
}

.mofe-pill-row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.mofe-pill-row a {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: var(--r-pill);
	padding: 6px 11px;
	font-size: 10px;
	color: #756971;
	text-decoration: none;
}

.mofe-pill-row a:hover {
	border-color: var(--accent);
	color: var(--accent-dark);
}

.mofe-main-front {
	padding-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Responsive adjustments for the block layer
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
	.wp-block-columns.mofe-catalogue {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.mofe-catalogue-aside {
		position: static;
		order: 2;
	}

	.mofe-catalogue-main {
		order: 1;
	}

	.mofe-sidebar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.mofe-sidebar {
		grid-template-columns: 1fr;
	}

	.mofe-search {
		margin-left: 0;
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   8. Article cards and home extras
   -------------------------------------------------------------------------- */
.mofe-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-card);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.mofe-card-media {
	height: 220px;
	overflow: hidden;
	background: var(--sand);
	margin: 0;
}

.mofe-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mofe-card-kicker {
	font-size: 9px;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--accent-dark);
	font-weight: 800;
	margin: 16px 18px 0;
}

.mofe-card-kicker a {
	color: inherit;
	text-decoration: none;
}

.mofe-card .wp-block-post-title {
	margin: 8px 18px 10px;
	font-size: 19px;
	line-height: 1.25;
}

.mofe-card .wp-block-post-excerpt {
	margin: 0 18px 18px;
}

.mofe-card .wp-block-post-excerpt__excerpt {
	font-size: 11px;
	line-height: 1.8;
	color: var(--muted);
}

.mofe-after-grid {
	margin-top: 26px;
}

.mofe-card-link {
	margin: 0;
}

/* Product summary quick spec (product single) */
.mofe-quick-spec {
	margin-top: 22px;
	border-top: 1px solid var(--line);
	display: grid;
}

.mofe-spec-row {
	display: grid;
	grid-template-columns: 34% 1fr;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
	align-items: baseline;
}

.mofe-spec-key {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #65565e;
	margin: 0;
}

.mofe-spec-value {
	font-size: 11px;
	color: var(--muted);
	margin: 0;
}

.mofe-spec-value a {
	color: var(--ink);
	text-decoration: none;
}

.mofe-spec-value .wp-block-post-terms__separator {
	opacity: 0.4;
}

/* --------------------------------------------------------------------------
   9. Core Buttons mapped onto the design's .btn system
   -------------------------------------------------------------------------- */
.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 11px;
	margin: 0;
}

.wp-block-button {
	margin: 0;
}

.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 48px;
	padding: 0 19px;
	border: 1px solid transparent;
	border-radius: var(--r-control);
	background-color: var(--accent);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.025em;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.wp-block-button__link:hover {
	background-color: var(--accent-dark);
	color: #fff;
	transform: translateY(-1px);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border-color: #c9babe;
	color: var(--ink);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: #fff;
	border-color: var(--accent);
	color: var(--ink);
}

.wp-block-button.btn-light > .wp-block-button__link {
	background: #fff9f6;
	color: var(--ink);
}

.wp-block-button.nav-cta > .wp-block-button__link {
	min-height: 0;
	padding: 13px 17px;
	border-radius: 8px;
	font-size: 10px;
	letter-spacing: 0.06em;
}

/* Card level links rendered by core/read-more */
.wp-block-read-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 11px;
	font-weight: 800;
	color: var(--accent-dark);
	text-decoration: none;
}

.product-body .wp-block-read-more {
	margin-top: auto;
	border-bottom: 1px solid #d0abb5;
	padding-bottom: 4px;
	width: fit-content;
}
