/* NHLA block styles. Reasoning lives in includes/block-styles.php. */

:root {
	--nhla-card: #fff;
	--nhla-warm: #fdfcfa;
	--nhla-forest: #1e3a2f;
	--nhla-shadow: 0 8px 28px rgba(28, 36, 24, 0.08);
	--nhla-body-font: var(--theme-font-family);
}

/* Site-wide: rule under content H2s */
:is(.entry-content, .editor-styles-wrapper) h2.wp-block-heading:not(.has-text-align-center, .is-style-nhla-title, .has-background, .has-background *, .wp-block-cover *, .stk-block *, [style*="background-image"] *) {
	border-bottom: 2px solid var(--theme-palette-color-8);
	padding-bottom: 0.4rem;
}

/* Title size: the Customizer's H1 size and line height (Blocksy sets them on the tag only). */
.wp-block-heading.is-style-nhla-title {
	--theme-font-size: 56px;
	--theme-line-height: 1.15;
}

/* Card and Panel */
.is-style-nhla-card,
.is-style-nhla-panel {
	background: var(--nhla-card);
	border: 1px solid var(--theme-palette-color-8);
	display: flex;
	flex-direction: column;
}

.is-style-nhla-card {
	border-radius: 16px;
	padding: 1.75rem 1.6rem 1.5rem;
	box-shadow: var(--nhla-shadow);
}

.is-style-nhla-panel {
	border-radius: 12px;
	padding: 1.25rem 1.2rem;
}

/* two classes: Blocksy's flow-layout heading margins load later at one */
:is(.wp-block-column, .wp-block-group):is(.is-style-nhla-card, .is-style-nhla-panel) > *,
.is-style-nhla-card > .wp-block-woocommerce-single-product > * {
	margin-block: 0;
}

.is-style-nhla-card :is(h3.wp-block-heading, h3.wp-block-post-title) {
	--theme-font-size: 1.65rem;
	--theme-line-height: 1.3;
	margin-bottom: 0.35rem;
}

:is(.wp-block-column, .wp-block-group).is-style-nhla-panel h3 {
	--theme-font-size: 1.3rem;
	--theme-font-weight: 600;
	--theme-line-height: 1.3;
	margin-bottom: 0.6rem;
}

.is-style-nhla-panel ul {
	padding-left: 1.1rem;
	font-size: 0.95rem;
}

.is-style-nhla-panel li + li {
	margin-top: 0.35rem;
}

/* A product inside a Card: price in green, button pinned to the bottom so cards in a row line up */
.is-style-nhla-card > .wp-block-woocommerce-single-product {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.is-style-nhla-card .wc-block-components-product-price {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--nhla-forest);
	margin: 0.4rem 0 0.9rem;
}

.is-style-nhla-card .wp-block-woocommerce-product-summary {
	flex-grow: 1;
	font-size: 0.98rem;
	margin-bottom: 1.25rem;
}

.is-style-nhla-card .wp-block-buttons {
	margin-top: auto;
}

/* full width in a card, as in the mockup */
.is-style-nhla-card .wp-block-buttons > .wp-block-button {
	width: 100%;
}

.is-style-nhla-card .wp-block-button__link {
	width: 100%;
	padding-block: 0.75rem;
}

/* Callout */
.is-style-nhla-callout {
	background: var(--nhla-warm);
	border-left: 3px solid var(--theme-palette-color-1);
	border-radius: 0 10px 10px 0;
	padding: 1rem 1.25rem;
	font-size: 0.95rem;
}

.wp-block-group.is-style-nhla-callout > * {
	margin-block: 0;
}

.wp-block-group.is-style-nhla-callout > * + * {
	margin-top: 0.75rem;
}

/* FAQ item */
.is-style-nhla-faq {
	background: var(--nhla-card);
	border: 1px solid var(--theme-palette-color-8);
	border-radius: 12px;
	overflow: hidden;
}

.wp-block-group.is-style-nhla-faq > * {
	margin-block: 0;
}

.is-style-nhla-faq > :is(h2, h3, h4) {
	--theme-font-family: var(--nhla-body-font);
	--theme-font-size: 1.05rem;
	--theme-font-weight: 600;
	--theme-line-height: 1.4;
	background: var(--nhla-warm);
	padding: 1rem 1.25rem;
	border: 0;
}

.is-style-nhla-faq > :not(h2, h3, h4) {
	padding: 0.9rem 1.25rem 1.1rem;
	border-top: 1px solid var(--theme-palette-color-8);
	font-size: 0.98rem;
}

/* Eyebrow and Label */
.is-style-nhla-eyebrow,
.is-style-nhla-label {
	color: var(--theme-palette-color-2);
	font-weight: 700;
	line-height: 1.4;
	text-transform: uppercase;
}

.is-style-nhla-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.72rem;
	letter-spacing: 0.2em;
}

/* tight to the heading it labels; the block gap is 1.5em of the heading's size */
.is-style-nhla-eyebrow {
	margin-bottom: 0;
}

.is-style-nhla-eyebrow + :is(h1, h2, h3) {
	margin-block-start: 0.75rem;
}

/* plain text only: a flex paragraph drops the spaces around a link */
.is-style-nhla-eyebrow::after {
	content: "";
	flex: none;
	width: 28px;
	height: 8px;
	background: var(--theme-palette-color-1);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 8'%3E%3Cpath d='M0 3.5h28v1H0z'/%3E%3Cpath d='M14 0l4 4-4 4-4-4z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 8'%3E%3Cpath d='M0 3.5h28v1H0z'/%3E%3Cpath d='M14 0l4 4-4 4-4-4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.is-style-nhla-label {
	font-size: 0.7rem;
	letter-spacing: 0.12em;
}

/* after the card resets, which would otherwise win */
p.is-style-nhla-label {
	margin-bottom: 0.4rem;
}

.is-style-nhla-card p.is-style-nhla-label {
	margin-bottom: 0.4rem;
}
