/**
 * Site Footer — Premium Melius-inspired design
 *
 * Features:
 *   - Large brand watermark with gradient hover effect
 *   - Three-column layout (brand, nav/social, newsletter)
 *   - Full dark/light mode support
 *   - Reusable newsletter form styles
 *
 * Dependencies: child theme style.css (design tokens)
 *
 * @package BlockskyChild
 */

/* ============================================
   FOOTER — Base
   ============================================ */

.pfp-footer {
	position: relative;
	overflow: hidden;
	background: var(--color-bg-primary);
	border-top: 1px solid var(--color-border);
	padding-top: 14rem;
}

/* ============================================
   WATERMARK — Large brand text behind content
   Sits in the tall padding-top zone. The content
   grid overlaps the bottom portion of the text,
   matching the Melius layout.
   ============================================ */

.pfp-footer__watermark {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	pointer-events: none;
	user-select: none;
	z-index: 0;
}

.pfp-footer__watermark-text {
	font-size: clamp(5rem, 15vw, 16rem);
	font-weight: 900;
	letter-spacing: -0.03em;
	line-height: 1;
	white-space: nowrap;
	color: transparent;
	-webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.06);
	pointer-events: auto;
	position: relative;
	padding-top: 1.5rem;
}

/*
 * Gradient spotlight overlay — a pseudo-element that sits on top
 * of the base stroked text. JS applies a radial-gradient to this
 * layer so the base text always remains visible underneath.
 */
.pfp-footer__watermark-text::after {
	content: attr(data-text);
	position: absolute;
	inset: 0;
	padding-top: inherit;
	font: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	white-space: inherit;
	color: transparent;
	-webkit-text-stroke: 0;
	background: var(--spot-gradient, transparent);
	-webkit-background-clip: text;
	background-clip: text;
	pointer-events: none;
	z-index: 1;
}

/* Light mode — darker stroke for visibility */
[data-theme="light"] .pfp-footer__watermark-text {
	-webkit-text-stroke: 2px rgba(15, 23, 42, 0.12);
}

/* ============================================
   CONTAINER
   ============================================ */

.pfp-footer__container {
	position: relative;
	z-index: 1;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 var(--spacing-sm);
}

@media (min-width: 1024px) {
	.pfp-footer__container {
		padding: 0 var(--spacing-lg);
	}
}

/* ============================================
   GRID — Three columns
   ============================================ */

.pfp-footer__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem;
	padding-bottom: 3rem;
}

@media (min-width: 768px) {
	.pfp-footer__grid {
		grid-template-columns: 1.3fr 0.8fr 1fr;
		gap: 3rem;
	}
}

@media (min-width: 1024px) {
	.pfp-footer__grid {
		gap: 4rem;
	}
}

/* ============================================
   COLUMN — Brand (Col 1)
   ============================================ */

.pfp-footer__brand-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1.25rem;
}

.pfp-footer__logo {
	width: 68px;
	height: 68px;
	object-fit: contain;
	flex-shrink: 0;
}

.pfp-footer__brand-name {
	font-size: var(--font-size-base);
	font-weight: 700;
	color: var(--color-text-primary);
	line-height: 1.3;
}

.pfp-footer__desc {
	font-size: var(--font-size-sm);
	line-height: 1.7;
	color: var(--color-text-muted);
	margin-bottom: 1.5rem;
	max-width: 360px;
}

.pfp-footer__contact-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: var(--font-size-sm);
	font-weight: 600;
	color: var(--color-accent);
	text-decoration: none;
	transition: color var(--transition-base), transform var(--transition-base);
}

.pfp-footer__contact-link:hover {
	color: var(--color-text-primary);
	transform: translateX(2px);
}

.pfp-footer__contact-link i {
	font-size: 0.85rem;
}

/* ============================================
   COLUMN — Navigation & Social (Col 2)
   ============================================ */

.pfp-footer__col-title {
	font-size: var(--font-size-sm);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-text-muted);
	margin: 0 0 1.25rem;
}

.pfp-footer__col--newsletter .pfp-footer__socials {
	margin-top: 1.25rem;
}

.pfp-footer__links {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.pfp-footer__links a {
	font-size: var(--font-size-sm);
	color: var(--color-text-secondary);
	text-decoration: none;
	transition: color var(--transition-base), transform var(--transition-base);
	display: inline-block;
}

.pfp-footer__links a:hover {
	color: var(--color-text-primary);
	transform: translateX(3px);
}

/* Social icons */
.pfp-footer__socials {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.pfp-footer__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--color-bg-surface);
	border: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: 0.95rem;
	text-decoration: none;
	transition: all var(--transition-base);
}

.pfp-footer__social-link:hover {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

/* ============================================
   COLUMN — Newsletter (Col 3)
   ============================================ */

.pfp-footer__newsletter-desc {
	font-size: var(--font-size-sm);
	line-height: 1.6;
	color: var(--color-text-muted);
	margin: 0 0 1.25rem;
}

/* ============================================
   REUSABLE NEWSLETTER FORM COMPONENT
   Shared styles for the newsletter form partial.
   ============================================ */

/* Pill-shaped row: border + bg on the outer row, button inside */
.pfp-newsletter-form__row {
	display: flex;
	align-items: center;
	background: var(--color-bg-surface);
	border: 1px solid var(--color-border);
	border-radius: 999px;
	padding: 4px;
	transition: border-color var(--transition-base),
	            box-shadow var(--transition-base);
}

.pfp-newsletter-form__row:focus-within {
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

[data-theme="light"] .pfp-newsletter-form__row {
	background: #ffffff;
}

/* Input: transparent, no border — lives inside the pill */
.pfp-newsletter-form__input,
.pfp-newsletter-form__input:focus {
	flex: 1;
	min-width: 0;
	padding: 0.7rem 1rem;
	font-size: var(--font-size-sm);
	font-family: inherit;
	color: var(--color-text-primary);
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.pfp-newsletter-form__input::placeholder {
	color: var(--color-text-muted);
}

[data-theme="light"] .pfp-newsletter-form__input {
	color: var(--slate-900) !important;
}

[data-theme="light"] .pfp-newsletter-form__input::placeholder {
	color: var(--slate-400);
}

/* Submit button: pill-shaped, sits inside the row */
.pfp-newsletter-form__submit {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.7rem 1.25rem;
	font-size: var(--font-size-sm);
	font-weight: 700;
	font-family: inherit;
	color: #ffffff;
	background: var(--color-accent);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	transition: opacity var(--transition-base);
}

.pfp-newsletter-form__submit:hover {
	opacity: 0.85;
}

.pfp-newsletter-form__submit:active {
	opacity: 0.75;
}

.pfp-newsletter-form__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Input wrapper for positioning inline error */
.pfp-newsletter-form__input-wrap {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.pfp-newsletter-form__input-wrap .pfp-newsletter-form__input {
	flex: none;
	width: 100%;
}

/* Input error state — applied on the outer row */
.pfp-newsletter-form__row:has(.pfp-newsletter-form__input--error) {
	border-color: #ef4444 !important;
	box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.pfp-newsletter-form__input-error {
	display: block;
	font-size: 0.78rem;
	color: #ef4444;
	margin-top: 0.3rem;
	padding-left: 1rem;
	min-height: 0;
	line-height: 1.3;
}

/* Turnstile widget spacing */
.pfp-newsletter-form__turnstile {
	margin-top: 0.75rem;
}

.pfp-newsletter-form__feedback {
	margin-top: 0.5rem;
	font-size: var(--font-size-sm);
	font-weight: 600;
	min-height: 1.4em;
}

.pfp-newsletter-form__feedback--success {
	color: #22c55e;
}

.pfp-newsletter-form__feedback--error {
	color: #ef4444;
}

/* Compact variant (footer) — stack on small screens */
@media (max-width: 479px) {
	.pfp-newsletter-form--compact .pfp-newsletter-form__row {
		flex-direction: column;
		border-radius: var(--radius-xl);
		padding: 4px;
	}

	.pfp-newsletter-form--compact .pfp-newsletter-form__submit {
		width: 100%;
		justify-content: center;
		border-radius: 999px;
	}
}

/* ============================================
   BOTTOM BAR
   ============================================ */

.pfp-footer__bottom {
	position: relative;
	z-index: 1;
	border-top: 1px solid var(--color-border);
	padding: 1.5rem 0;
}

.pfp-footer__bottom-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 var(--spacing-sm);
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	align-items: center;
	text-align: center;
}

@media (min-width: 768px) {
	.pfp-footer__bottom-container {
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
		padding: 0 var(--spacing-lg);
	}
}

.pfp-footer__copyright {
	font-size: 0.8rem;
	color: var(--color-text-muted);
	margin: 0;
}

.pfp-footer__legal {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.8rem;
}

.pfp-footer__legal a {
	color: var(--color-text-muted);
	text-decoration: none;
	transition: color var(--transition-base);
}

.pfp-footer__legal a:hover {
	color: var(--color-text-primary);
}

.pfp-footer__legal-sep {
	color: var(--color-border);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
	.pfp-footer {
		padding-top: 3rem;
	}

	.pfp-footer {
		padding-top: 6rem;
	}

	.pfp-footer__watermark-text {
		font-size: clamp(3rem, 16vw, 6rem);
	}

	.pfp-footer__grid {
		gap: 2rem;
		padding-bottom: 2rem;
	}

}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
	.pfp-footer__watermark-text {
		transition: none;
	}

	.pfp-footer__links a,
	.pfp-footer__contact-link,
	.pfp-footer__social-link,
	.pfp-newsletter-form__submit {
		transition: none;
		transform: none !important;
	}
}

/* ============================================
   HIDE BLOCKSY DEFAULT FOOTER
   ============================================ */

footer[data-id="type-1"],
.ct-footer {
	display: none !important;
}
