/* ==========================================================================
   Masterfit theme — core block styles.
   Loaded on the front end AND in the block editor (add_editor_style), so it only uses the
   --wp--preset--* / --wp--custom--* variables that theme.json emits in both contexts.
   Layout → text → buttons → columns/group → table → details → quote → media → misc
   ========================================================================== */

/* ---------- 1. Constrained content column (classic-theme equivalent of a root layout) ---------- */
.mf-prose { max-width: none; }
.mf-prose > * {
	max-width: var(--wp--style--global--content-size, 760px);
	margin-left: auto;
	margin-right: auto;
}
.mf-prose > .alignwide { max-width: var(--wp--style--global--wide-size, 1240px); }
.mf-prose > .alignfull { max-width: none; }
.mf-prose > .alignleft { float: left; margin: 0 24px 16px 0; max-width: 50%; }
.mf-prose > .alignright { float: right; margin: 0 0 16px 24px; max-width: 50%; }
.mf-prose::after { content: ""; display: table; clear: both; }
.mf-prose > * + * { margin-top: var(--wp--style--block-gap, 24px); }
.mf-prose > h2 { margin-top: 48px; }
.mf-prose > h3,
.mf-prose > h4 { margin-top: 32px; }
.mf-prose > h2 + *,
.mf-prose > h3 + *,
.mf-prose > h4 + * { margin-top: 12px; }
.mf-prose > :first-child { margin-top: 0; }

/* Cart / checkout / account render Woo shortcodes, not block content. */
.woocommerce-cart .mf-prose > *,
.woocommerce-checkout .mf-prose > *,
.woocommerce-account .mf-prose > * { max-width: none; }

/* ---------- 2. Text ---------- */
.mf-prose p,
.editor-styles-wrapper p { margin-top: 0; margin-bottom: 0; }
.mf-prose p + p { margin-top: 16px; }
.mf-prose ul,
.mf-prose ol,
.wp-block-list { padding-left: 1.4em; }
.mf-prose li + li,
.wp-block-list li + li { margin-top: 6px; }
.mf-prose li::marker,
.wp-block-list li::marker { color: var(--wp--preset--color--blue); }
.mf-prose a:not(.wp-block-button__link),
.wp-block-paragraph a,
.wp-block-list a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--wp--preset--color--blue-line); }
.mf-prose a:not(.wp-block-button__link):hover { text-decoration-color: currentColor; }
.wp-block-heading.has-text-align-center { margin-left: auto; margin-right: auto; }

/* Eyebrow: H6 or a paragraph with the "mf-eyebrow" class */
.mf-prose h6,
.wp-block-paragraph.mf-eyebrow,
.editor-styles-wrapper h6 {
	font-family: var(--wp--preset--font-family--poppins);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--blue);
}

.has-small-font-size,
.has-x-small-font-size { line-height: 1.5; }

/* ---------- 3. Buttons ---------- */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	cursor: pointer;
	transition: background var(--wp--custom--ease, 0.18s ease), border-color var(--wp--custom--ease, 0.18s ease), color var(--wp--custom--ease, 0.18s ease), box-shadow var(--wp--custom--ease, 0.18s ease);
}
.wp-block-button__link:hover { box-shadow: 0 6px 16px rgba(33, 62, 146, 0.4); }
.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background: transparent;
	color: var(--wp--preset--color--blue);
	border: 1.5px solid var(--wp--preset--color--blue);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
	box-shadow: none;
}
.wp-block-button.is-style-mf-accent .wp-block-button__link {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--navy);
}
.wp-block-button.is-style-mf-accent .wp-block-button__link:hover {
	background: #5aa732;
	border-color: #5aa732;
	color: var(--wp--preset--color--navy);
	box-shadow: 0 4px 12px rgba(110, 189, 67, 0.35);
}
.wp-block-button.is-style-mf-dark .wp-block-button__link {
	background: var(--wp--preset--color--navy);
	border-color: var(--wp--preset--color--navy);
}
.wp-block-button.is-style-mf-dark .wp-block-button__link:hover {
	background: var(--wp--preset--color--blue);
	border-color: var(--wp--preset--color--blue);
	box-shadow: none;
}
.wp-block-buttons { gap: 12px 16px; }
/* Buttons on a navy/blue group */
.has-navy-background-color .wp-block-button__link:not(.has-background),
.has-navy-900-background-color .wp-block-button__link:not(.has-background),
.has-blue-background-color .wp-block-button__link:not(.has-background) {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--navy);
}
.has-navy-background-color .is-style-outline .wp-block-button__link:not(.has-background),
.has-navy-900-background-color .is-style-outline .wp-block-button__link:not(.has-background),
.has-blue-background-color .is-style-outline .wp-block-button__link:not(.has-background) {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.6);
	color: var(--wp--preset--color--white);
}

/* ---------- 4. Columns + group ---------- */
.wp-block-columns { gap: 32px; }
.wp-block-columns.are-vertically-aligned-center { align-items: center; }
.wp-block-column > * + * { margin-top: 16px; }
.wp-block-column > :first-child { margin-top: 0; }

.wp-block-group.has-background {
	padding: 32px;
	border-radius: var(--wp--custom--radius--card, 12px);
}
.wp-block-group.has-background > * + * { margin-top: 16px; }
.wp-block-group.has-background > :first-child { margin-top: 0; }

/* Card style: hairline card on white */
.wp-block-group.is-style-mf-card,
.wp-block-column.is-style-mf-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--card, 12px);
	padding: 28px;
	box-shadow: var(--wp--preset--shadow--sm);
}
/* Tinted panel style (matches the hero band / summary cards) */
.wp-block-group.is-style-mf-panel,
.wp-block-column.is-style-mf-panel {
	background: var(--wp--preset--color--tint);
	border-radius: var(--wp--custom--radius--card, 12px);
	padding: 28px;
}
.wp-block-group.is-style-mf-panel > * + *,
.wp-block-group.is-style-mf-card > * + * { margin-top: 12px; }
.wp-block-group.is-style-mf-panel > :first-child,
.wp-block-group.is-style-mf-card > :first-child { margin-top: 0; }

/* Text colors on dark backgrounds */
.has-navy-background-color,
.has-navy-900-background-color,
.has-blue-background-color,
.has-blue-600-background-color { color: var(--wp--preset--color--white); }
.has-navy-background-color :is(h1, h2, h3, h4, h5, h6),
.has-navy-900-background-color :is(h1, h2, h3, h4, h5, h6),
.has-blue-background-color :is(h1, h2, h3, h4, h5, h6),
.has-blue-600-background-color :is(h1, h2, h3, h4, h5, h6) { color: var(--wp--preset--color--white); }
.has-navy-background-color a:not(.wp-block-button__link),
.has-navy-900-background-color a:not(.wp-block-button__link),
.has-blue-background-color a:not(.wp-block-button__link),
.has-blue-600-background-color a:not(.wp-block-button__link) { color: var(--wp--preset--color--accent-light); }
.has-navy-background-color h6,
.has-navy-900-background-color h6,
.has-blue-background-color h6 { color: var(--wp--preset--color--accent-light); }

/* ---------- 5. Table ---------- */
.wp-block-table { overflow-x: auto; }
.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md, 10px);
	overflow: hidden;
}
.wp-block-table thead { border-bottom: 2px solid var(--wp--preset--color--blue-line); }
.wp-block-table th,
.wp-block-table td {
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	text-align: left;
	vertical-align: top;
}
.wp-block-table th {
	font-family: var(--wp--preset--font-family--poppins);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--tint);
}
.wp-block-table tbody tr:last-child td { border-bottom: 0; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--wp--preset--color--subtle); }
.wp-block-table.is-style-stripes table { border: 1px solid var(--wp--preset--color--border); }
.wp-block-table.is-style-stripes td { border-bottom: 0; }
.wp-block-table tfoot td { font-weight: 700; color: var(--wp--preset--color--navy); background: var(--wp--preset--color--subtle); }
.wp-block-table figcaption { margin-top: 8px; }

/* ---------- 6. Details (FAQ accordion) ---------- */
.wp-block-details {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md, 10px);
	background: var(--wp--preset--color--white);
	padding: 0;
	overflow: hidden;
}
.mf-prose > .wp-block-details + .wp-block-details { margin-top: 10px; }
.wp-block-details > summary {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	font-family: var(--wp--preset--font-family--poppins);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--wp--preset--color--navy);
	cursor: pointer;
	list-style: none;
	transition: background var(--wp--custom--ease, 0.18s ease);
}
.wp-block-details > summary::-webkit-details-marker { display: none; }
.wp-block-details > summary::after {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	margin-top: 6px;
	margin-right: 4px;
	border-right: 2px solid var(--wp--preset--color--blue);
	border-bottom: 2px solid var(--wp--preset--color--blue);
	transform: rotate(45deg);
	transition: transform var(--wp--custom--ease, 0.18s ease);
}
.wp-block-details[open] > summary::after { transform: rotate(225deg); margin-top: 10px; }
.wp-block-details > summary:hover { background: var(--wp--preset--color--subtle); }
.wp-block-details[open] > summary { border-bottom: 1px solid var(--wp--preset--color--border); }
.wp-block-details > :not(summary) { padding: 0 20px; }
.wp-block-details > summary + * { padding-top: 16px; }
.wp-block-details > :last-child:not(summary) { padding-bottom: 18px; }
.wp-block-details > * + *:not(summary) { margin-top: 12px; }
.wp-block-details > summary:focus-visible { outline: 2px solid var(--wp--preset--color--blue); outline-offset: -2px; }

/* ---------- 7. Quote ---------- */
.wp-block-quote { margin-left: 0; margin-right: 0; font-style: normal; }
.wp-block-quote p { margin: 0; }
.wp-block-quote p + p { margin-top: 12px; }
.wp-block-quote cite,
.wp-block-pullquote cite {
	display: block;
	margin-top: 12px;
	font-family: var(--wp--preset--font-family--poppins);
	font-size: 13px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--text-2);
}
.wp-block-pullquote { padding: 28px 0; text-align: left; }
.wp-block-pullquote blockquote { margin: 0; }
.wp-block-pullquote p { margin: 0; font-size: inherit; line-height: 1.35; }

/* ---------- 8. Media ---------- */
.wp-block-image img,
.wp-block-video video,
.wp-block-embed iframe { border-radius: var(--wp--custom--radius--card, 12px); }
.wp-block-image figcaption { margin-top: 8px; text-align: center; }
.wp-block-image.is-style-rounded img { border-radius: 999px; }
.wp-block-cover,
.wp-block-media-text { border-radius: var(--wp--custom--radius--card, 12px); overflow: hidden; }
.wp-block-cover .wp-block-cover__inner-container > * + * { margin-top: 16px; }
.wp-block-media-text .wp-block-media-text__content { padding: 32px; }
.wp-block-media-text .wp-block-media-text__content > * + * { margin-top: 16px; }
.wp-block-gallery { gap: 16px; }

/* ---------- 9. Misc ---------- */
.wp-block-separator {
	border: 0;
	border-top: 1px solid currentColor;
	margin-top: 32px;
	margin-bottom: 32px;
	opacity: 1;
}
.wp-block-separator:not(.is-style-wide):not(.is-style-dots) { width: 96px; max-width: 96px; }
.wp-block-separator.is-style-dots { border: 0; text-align: center; }
.wp-block-separator.is-style-dots::before { color: var(--wp--preset--color--blue-line); }

.wp-block-code code,
.wp-block-preformatted {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 14px;
	white-space: pre-wrap;
}

.wp-block-list.is-style-mf-checks { list-style: none; padding-left: 0; }
.wp-block-list.is-style-mf-checks li { position: relative; padding-left: 30px; }
.wp-block-list.is-style-mf-checks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.3em;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent-tint);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d7f1f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
	background-size: 11px;
	background-repeat: no-repeat;
	background-position: center;
}

/* Contact Form 7 / theme contact form inside block pages inherit the Woo-style fields */
.mf-prose input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.mf-prose textarea,
.mf-prose select {
	width: 100%;
	font: inherit;
	color: var(--wp--preset--color--navy);
	background: var(--wp--preset--color--white);
	border: 1px solid #d3d8e0;
	border-radius: var(--wp--custom--radius--input, 8px);
	padding: 11px 14px;
}
.mf-prose textarea { min-height: 140px; }
.mf-prose input:focus,
.mf-prose textarea:focus,
.mf-prose select:focus { outline: 2px solid var(--wp--preset--color--blue); outline-offset: 0; border-color: var(--wp--preset--color--blue); }

/* ---------- 10. Responsive ---------- */
@media (max-width: 781px) {
	.wp-block-columns { gap: 24px; }
	.wp-block-group.has-background,
	.wp-block-group.is-style-mf-card,
	.wp-block-group.is-style-mf-panel,
	.wp-block-column.is-style-mf-card,
	.wp-block-column.is-style-mf-panel { padding: 22px; }
	.wp-block-media-text .wp-block-media-text__content { padding: 24px; }
	.mf-prose > .alignleft,
	.mf-prose > .alignright { float: none; max-width: none; margin: 0 auto; }
	.wp-block-table th,
	.wp-block-table td { padding: 10px 12px; font-size: 14px; }
	.wp-block-details > summary { padding: 14px 16px; font-size: 15px; }
	.wp-block-details > :not(summary) { padding-left: 16px; padding-right: 16px; }
}
