/*!
 * Gradient Fallback Featured Image — front-end banner styles.
 * Every visual value (gradient/height/radius/opacity/color/alignment/font)
 * is injected per-banner as a CSS custom property via the inline style
 * attribute — this file only defines how those variables are used.
 *
 * Every selector below is scoped under .gffi-banner (2 classes deep) rather
 * than flat single-class rules, so this survives being dropped into any
 * theme's own content-area typography (e.g. a common `.entry-content h2 {…}`
 * rule has higher specificity than a bare `.gffi-banner-title {…}` would).
 */

.gffi-banner {
	--gffi-height: 320px;
	--gffi-radius: 12px;
	--gffi-overlay-opacity: 0.35;
	--gffi-overlay-color: #000000;
	--gffi-title-color: #ffffff;
	--gffi-title-align: center;
	--gffi-content-align: center;
	--gffi-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: var(--gffi-height);
	margin: 0 0 1.5em;
	padding: 0;
	border: 0;
	border-radius: var(--gffi-radius);
	overflow: hidden;
	isolation: isolate;
	background-color: transparent;
	background-image: var(--gffi-gradient);
	background-size: 200% 200%;
	background-position: 0% 50%;
	font-family: var(--gffi-font-family);
	line-height: 1.2;
	box-sizing: border-box;
	list-style: none;
}

.gffi-banner,
.gffi-banner * {
	box-sizing: border-box;
}

.gffi-banner *:before,
.gffi-banner *:after {
	box-sizing: border-box;
}

@media (max-width: 768px) {
	.gffi-banner {
		height: 260px;
	}
}

@media (max-width: 480px) {
	.gffi-banner {
		height: 220px;
	}
}

.gffi-banner .gffi-banner-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	margin: 0;
	padding: 0;
	background-color: var(--gffi-overlay-color);
	opacity: var(--gffi-overlay-opacity);
	pointer-events: none;
}

.gffi-banner .gffi-banner-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: var(--gffi-content-align);
	justify-content: center;
	gap: clamp(0.5rem, 1.2vw, 1rem);
	width: 100%;
	max-width: 90%;
	margin: 0;
	padding: clamp(1rem, 4vw, 2.5rem);
	border: 0;
	text-align: var(--gffi-title-align);
	list-style: none;
}

/* Glassmorphism variant */
.gffi-banner.gffi-glass .gffi-banner-content {
	background: rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	backdrop-filter: blur(14px) saturate(140%);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: calc(var(--gffi-radius) * 0.6);
	box-shadow: 0 8px 32px -12px rgba(0, 0, 0, 0.35);
	padding: clamp(1.25rem, 4vw, 2.5rem) clamp(1.5rem, 5vw, 3rem);
}

.gffi-banner .gffi-banner-logo {
	max-height: 48px;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: contain;
}

.gffi-banner .gffi-banner-category {
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0.3rem 0.85rem;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	color: #ffffff;
	font-family: inherit;
	font-size: clamp(0.7rem, 0.6rem + 0.4vw, 0.85rem);
	font-weight: 700;
	font-style: normal;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.gffi-banner .gffi-banner-category:hover,
.gffi-banner .gffi-banner-category:focus-visible {
	background: rgba(255, 255, 255, 0.32);
	color: #ffffff;
}

.gffi-banner .gffi-banner-title {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--gffi-title-color);
	font-family: inherit;
	font-size: clamp(1.35rem, 1rem + 1.8vw, 2.5rem);
	font-weight: 800;
	font-style: normal;
	line-height: 1.2;
	letter-spacing: -0.02em;
	max-width: 42ch;
	text-transform: none;
}

.gffi-banner .gffi-banner-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: var(--gffi-content-align);
	gap: clamp(0.5rem, 1.5vw, 1.25rem);
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: clamp(0.75rem, 0.65rem + 0.3vw, 0.9rem);
	color: var(--gffi-title-color);
	opacity: 0.92;
	list-style: none;
}

.gffi-banner .gffi-meta-item {
	margin: 0;
	padding: 0;
	border: 0;
	color: inherit;
	font: inherit;
	text-decoration: none;
}

.gffi-banner a.gffi-meta-item:hover,
.gffi-banner a.gffi-meta-item:focus-visible {
	color: inherit;
	text-decoration: underline;
}

/* Optional animation — a slow gradient pan, off by default */
@media (prefers-reduced-motion: no-preference) {
	.gffi-banner.gffi-animated {
		animation: gffi-gradient-pan 12s ease infinite;
	}
}

@keyframes gffi-gradient-pan {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

/*
 * Card-sized thumbnail placeholder — produced by filter_post_thumbnail_html()
 * (the automatic `post_thumbnail_html` filter), the `[gffi_thumbnail]`
 * shortcode, and gffi_render_thumbnail(). Deliberately much simpler than
 * .gffi-banner: no logo/meta/overlay, just a gradient background and an
 * optional title chip, sized for an archive grid rather than a full hero.
 */
.gffi-thumbnail {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 200px;
	margin: 0;
	padding: 1rem;
	border: 0;
	border-radius: 8px;
	overflow: hidden;
	box-sizing: border-box;
	background-color: transparent;
	background-size: cover;
	background-position: center;
}

.gffi-thumbnail,
.gffi-thumbnail * {
	box-sizing: border-box;
}

.gffi-thumbnail .gffi-thumbnail-title {
	position: relative;
	z-index: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	max-width: 90%;
	margin: 0;
	background: rgba(255, 255, 255, 0.92);
	color: #0f172a;
	font-family: inherit;
	font-weight: 600;
	line-height: 1.4;
	padding: 0.65rem 1rem;
	border-radius: 8px;
	box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.35);
}

/* Dark mode support — deepen the overlay and keep text readable */
.gffi-banner.gffi-dark-support {
	color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
	.gffi-banner.gffi-dark-support .gffi-banner-overlay {
		opacity: calc(var(--gffi-overlay-opacity) + 0.15);
	}

	.gffi-banner.gffi-dark-support.gffi-glass .gffi-banner-content {
		background: rgba(15, 15, 20, 0.35);
		border-color: rgba(255, 255, 255, 0.15);
	}
}
