/**
 * Carbonfooter Blocks — Front-end Styles
 *
 * Styles for Gutenberg blocks rendered by the BlockRenderer class.
 * Icon/SVG styles are shared with shortcodes via carbonfooter.css
 * (classes: .cf-full__icon, .cf-full__cta-icon, .cf-sticker__cloud,
 * .cf-minimal__link-icon).
 */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
	--cf-block-container-width: 1200px;
}

/* ========================================
   Stat Blocks (emissions, trees, driving,
   pageweight, green-hosting)
   ======================================== */
.cf-block-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8px;
	line-height: 1.4;
}

.cf-block-stat__title {
	font-weight: bold;
	margin: 0;
	line-height: 1;
}

.cf-block-stat__text {
	margin: 4px 0 0;
	font-size: 0.9em;
}

/* ========================================
   Minimal Block
   ======================================== */
.cf-block-minimal {
	padding: 8px 0 16px;
	font-size: 14px;
}

.cf-block-minimal__text {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	text-align: center;
	gap: 0.25em;
	width: 90%;
	max-width: 900px;
	margin: 0 auto;
	font-size: 14px;
}

.cf-block-minimal__value {
	font-weight: bold;
}

.cf-block-minimal__link {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	color: currentColor;
	text-decoration: none;
}

.cf-block-minimal__link:hover {
	text-decoration: underline;
}

/* ========================================
   Full Block (InnerBlocks container)
   ======================================== */
.cf-block-full {
	padding: 24px 0 32px;
	font-size: 16px;
	text-align: center;
}

.cf-block-full__row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
	justify-content: center;
	align-items: stretch;
	max-width: var(--cf-block-container-width);
	margin: 0 auto;
	width: 90%;
	padding-bottom: 24px;
	border-bottom: 1px solid currentColor;
}

@media (min-width: 1024px) {
	.cf-block-full__row {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (min-width: 1280px) {
	.cf-block-full__row {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* Stat blocks inside the full container */
.cf-block-full__row .cf-block-stat {
	border: 1px solid currentColor;
	height: 100%;
}

@media (min-width: 1280px) {
	.cf-block-full__row .cf-block-stat {
		border: none;
		padding: 0;
	}
}

/* CTA area */
.cf-block-full__cta {
	display: flex;
	justify-content: center;
	align-items: baseline;
	gap: 8px;
	margin-top: 32px;
	line-height: 1;
}

.cf-block-full__cta-link {
	color: currentColor;
	text-decoration: none;
}

.cf-block-full__cta-link:hover {
	text-decoration: underline;
}

.cf-block-full__cta-link-text {
	display: flex;
	margin-top: 4px;
	justify-content: center;
}

@media (min-width: 600px) {
	.cf-block-full__cta-link-text {
		display: inline-flex;
		justify-content: start;
		margin-top: 0;
		align-items: baseline;
		gap: 4px;
	}
}

/* ========================================
   Sticker Block
   ======================================== */
.cf-block-sticker {
	aspect-ratio: 1 / 1;
	width: 100%;
	max-width: 300px;
	display: grid;
	place-items: center;
	justify-content: center;
	font-size: 16px;
	position: relative;
	line-height: 1.2;
	margin: 0 auto;
	overflow: hidden;
	color: var(--cf-color-foreground, #fff);
}

.cf-block-sticker__text {
	text-wrap: balance;
	position: relative;
	z-index: 1;
	text-align: center;
	padding: 25%;
	color: inherit;
}

.cf-block-sticker__value {
	font-weight: bold;
}

/* ========================================
   Label Block
   ======================================== */
.cf-block-label {
	display: block;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

.cf-block-label__text {
	display: inline;
}

/* ========================================
   Icon color inheritance
   Gutenberg applies textColor as `color` on the wrapper.
   `.cf-full__icon` in carbonfooter.css hardcodes
   `color: var(--cf-color-foreground)`, which breaks that
   cascade inside blocks. Reset it to `inherit` so the
   editor's text color choice reaches the SVG fill.
   ======================================== */
.cf-block-stat svg,
.cf-block-minimal svg,
.cf-block-full svg,
.cf-block-sticker svg,
.cf-block-label svg {
	color: inherit;
	fill: currentColor;
}
