/**
 * MAS Core - single Excel Function.
 *
 * 0.7.0 adds the meta header and footer that MAS_Core_Function_Single wraps
 * around the body: lead line, signature, facts row, related links, back link.
 * The .mas-fn__* rules at the end cover those; everything above them styles
 * the body blocks the editor produces.
 *
 * Retuned 2026-09-08 for the Industry design. The previous version painted code
 * blocks light-on-dark, which was right when the page ground was #112240 and is
 * wrong now that it is paper. The design sets code on a neutral-200 fill with no
 * radius, so formulas read as inline objects rather than as terminal output.
 *
 * The function template's tables (Arguments) are framed and styled by
 * mas-frames.css (0.11.0), shared with posts, plays and models.
 */

.entry-content pre.wp-block-code {
	overflow-x: auto;
	padding: 10px 12px;
	border: 1px solid var(--mas-rule);
	border-radius: 0;
	background-color: var(--mas-rule-soft);
	color: var(--mas-ink);
	font-family: var(--mas-mono);
	font-size: 15px;
	line-height: 1.6;
}

.entry-content pre.wp-block-code code {
	background: none;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
}

/* Inline formulas inside body copy. */
.entry-content :not(pre) > code {
	padding: 1px 5px;
	border-radius: 0;
	background-color: var(--mas-rule-soft);
	color: var(--mas-ink);
	font-family: var(--mas-mono);
	font-size: 0.92em;
}

/* Arguments table: framed and styled by mas-frames.css since 0.11.0. */

/* Meta header and footer (MAS_Core_Function_Single). */

.mas-fn {
	color: var(--mas-ink);
}

.mas-fn *,
.mas-fn *::before,
.mas-fn *::after {
	box-sizing: border-box;
}

/*
 * "Short answer" box (0.11.0): the design's 1d blueprint box. Holds the lead
 * line and the signature; corner marks come from .mas-blueprint.
 */
.mas-fn__answer {
	margin: 6px 6px 1.5rem;
	padding: 14px 16px 16px;
}

/* .entry-content raises specificity over the theme's paragraph margins. */
.entry-content .mas-fn__answer .mas-fn__answer-label {
	margin: 0 0 6px;
	color: var(--mas-accent-hover);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.entry-content .mas-fn__answer .mas-fn__lead {
	margin-top: 0;
	color: var(--mas-ink);
	font-size: 16px;
	margin-bottom: 10px;
}

.mas-fn__answer .mas-fn__syntax {
	margin-bottom: 0;
}

/* The one-line definition, set as a lead: larger and muted, under the H1. */
.mas-fn__lead {
	margin: 0 0 1rem;
	color: var(--mas-muted);
	font-size: 18px;
	line-height: 1.5;
}

/* The signature gets the same treatment as a code block in the body. */
.mas-fn__syntax {
	overflow-x: auto;
	margin: 0 0 1rem;
	padding: 10px 12px;
	border: 1px solid var(--mas-rule);
	border-radius: 0;
	background-color: var(--mas-rule-soft);
	color: var(--mas-ink);
	font-family: var(--mas-mono);
	font-size: 15px;
	line-height: 1.6;
}

.mas-fn__syntax code {
	background: none;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
}

/*
 * Facts row: category, version, aliases as an inline definition list on a
 * hairline, closing the header before the body starts.
 */
.mas-fn__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 28px;
	margin: 0 0 2rem;
	padding: 0 0 12px;
	border-bottom: 1px solid var(--mas-rule);
	font-size: 14px;
	line-height: 1.5;
}

.mas-fn__fact {
	display: flex;
	flex-wrap: wrap;
	gap: 0 8px;
	margin: 0;
}

.mas-fn__fact-label {
	margin: 0;
	color: var(--mas-muted);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 21px;
	text-transform: uppercase;
}

.mas-fn__fact-value {
	margin: 0;
	color: var(--mas-ink);
}

/* Aliases are written for the search index, so they sit back a step on the page. */
.mas-fn__fact--aliases .mas-fn__fact-value {
	color: var(--mas-muted);
}

.mas-fn__category {
	color: var(--mas-accent);
	text-decoration: none;
	border-bottom: 1px solid var(--mas-accent-400);
}

.mas-fn__category:hover {
	color: var(--mas-accent-hover);
	border-bottom-color: var(--mas-accent-hover);
}

/* Related links, below the body, above the back link. */

.mas-fn__related {
	margin: 2rem 0 0;
	padding: 1.5rem 0 0;
	border-top: 1px solid var(--mas-rule);
}

.mas-fn__related-title {
	margin: 0 0 0.5rem;
	color: var(--mas-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-transform: uppercase;
}

.mas-fn__related-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mas-fn__related-item {
	margin: 0 0 6px;
	font-size: 15px;
	line-height: 1.5;
}

.mas-fn__related-link {
	color: var(--mas-accent);
	text-decoration: none;
	border-bottom: 1px solid var(--mas-accent-400);
}

.mas-fn__related-link:hover {
	color: var(--mas-accent-hover);
	border-bottom-color: var(--mas-accent-hover);
}

.mas-fn__back {
	margin: 2rem 0 0;
	padding: 1rem 0 0;
	border-top: 1px solid var(--mas-rule);
	font-size: 14px;
}

.mas-fn__back-link {
	color: var(--mas-muted);
	text-decoration: none;
}

.mas-fn__back-link:hover {
	color: var(--mas-ink);
}
