/**
 * Carbonfooter Blocks — Front-end Styles
 *
 * Shared styles for all Gutenberg blocks rendered by the
 * BlockRenderer class. Reuses the same design language as
 * the legacy shortcode widgets.
 */

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
	--cf-block-icon-size: 40px;
	--cf-block-icon-size-md: 60px;
	--cf-block-icon-size-lg: 80px;
	--cf-block-cta-icon-size: 20px;
	--cf-block-minimal-icon-size: 24px;
	--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__icon {
	display: block;
	width: auto;
	height: var(--cf-block-icon-size);
	margin-bottom: 12px;
	fill: currentColor;
}

@media (min-width: 768px) {
	.cf-block-stat__icon {
		height: var(--cf-block-icon-size-md);
	}
}

@media (min-width: 1024px) {
	.cf-block-stat__icon {
		height: var(--cf-block-icon-size-lg);
	}
}

.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;
}

.cf-minimal__link-icon {
	width: var(--cf-block-minimal-icon-size);
	height: var(--cf-block-minimal-icon-size);
	fill: currentColor;
}

/* ========================================
   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;
	}
}

.cf-block-full__cta-icon {
	width: var(--cf-block-cta-icon-size);
	height: var(--cf-block-cta-icon-size);
	fill: currentColor;
}

/* ========================================
   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;
}

.cf-block-sticker__cloud {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: 0;
	fill: currentColor;
}

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

.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;
}
