/*
 * Failure Pattern Archive Repipe Widgets — frontend styles
 * Scoped under .fpaw-* classes so they coexist with theme styles.
 */

:root {
	--fpaw-color-primary: #34373e;
	--fpaw-color-secondary: #88898d;
	--fpaw-color-light: #FFFFFF;
	--fpaw-color-accent: #4a4e58;
	--fpaw-color-text-dark: #222;
	--fpaw-font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--fpaw-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

	--color-primary: #34373e;
	--color-secondary: #88898d;
	--color-light: #FFFFFF;
	--color-accent: #4a4e58;
	--color-text-dark: #222;
}

.fpaw-hero,
.fpaw-section,
.fpaw-image-divider {
	font-family: var(--fpaw-font-main);
	color: var(--fpaw-color-text-dark);
	line-height: 1.6;
	box-sizing: border-box;
}

.fpaw-hero *,
.fpaw-section *,
.fpaw-image-divider * {
	box-sizing: border-box;
}

.fpaw-hero h1,
.fpaw-hero h2,
.fpaw-section h1,
.fpaw-section h2,
.fpaw-section h3,
.fpaw-section h4,
.fpaw-section h5 {
	line-height: 1.2;
	margin-bottom: 1rem;
	color: var(--fpaw-color-primary);
}

.fpaw-hero p,
.fpaw-section p {
	margin-bottom: 1rem;
	font-size: 1.125rem;
	color: #444;
}

.fpaw-section ul {
	margin-bottom: 1rem;
	padding-left: 1.5rem;
}

.fpaw-section li {
	margin-bottom: 0.5rem;
	color: #444;
}

/* HERO */
.fpaw-hero.hero {
	background-color: var(--fpaw-color-primary);
	color: var(--fpaw-color-light);
	min-height: 80vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	position: relative;
	overflow: hidden;
}

.fpaw-hero.hero[style*="background-image"] {
	background: var(--fpaw-color-primary);
}

.fpaw-hero.hero.has-overlay { background-color: var(--fpaw-color-primary); }
.fpaw-hero.hero.has-overlay > .hero-content { position: relative; z-index: 2; }

.fpaw-hero.hero.has-overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(0,0,0,0.55), rgba(0,0,0,0.7));
	z-index: 1;
}

.fpaw-hero.hero:not(.has-overlay)::before,
.fpaw-hero.hero:not(.has-overlay)::after {
	content: '';
	position: absolute;
	background: linear-gradient(135deg, rgba(136,137,141,0.2) 0%, rgba(255,255,255,0.05) 100%);
	border-radius: 20px;
	transform: rotate(-15deg) skewX(10deg);
	z-index: 0;
	box-shadow: 0 20px 50px rgba(0,0,0,0.3);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.fpaw-hero.hero:not(.has-overlay)::before {
	width: 50vw; height: 50vw;
	top: -20%; right: -10%;
	animation: fpaw-float 12s ease-in-out infinite;
}

.fpaw-hero.hero:not(.has-overlay)::after {
	width: 40vw; height: 40vw;
	bottom: -15%; left: -10%;
	animation: fpaw-float 15s ease-in-out infinite reverse;
}

.fpaw-hero .badge {
	display: inline-block;
	padding: 0.5rem 1.5rem;
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 100px;
	color: var(--fpaw-color-light);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 1.5rem;
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
}

.fpaw-hero .hero-content {
	position: relative;
	z-index: 1;
	max-width: 900px;
	margin: 0 auto;
	text-align: center;
}

.fpaw-hero h1 {
	color: var(--fpaw-color-light);
	font-size: clamp(2.5rem, 5vw, 4.5rem);
	margin-bottom: 2rem;
	letter-spacing: -0.02em;
	text-shadow: 2px 4px 10px rgba(0,0,0,0.3);
	line-height: 1.15;
}

.fpaw-hero p,
.fpaw-hero .fpaw-hero-body p {
	color: rgba(255,255,255,0.9);
	font-size: clamp(1.1rem, 2vw, 1.3rem);
	font-weight: 300;
	max-width: 800px;
	margin: 0 auto 1.5rem;
}

.fpaw-hero a { color: #fff; text-decoration: underline; }

/* SECTION */
.fpaw-section { padding: 5rem 2rem; position: relative; }

.fpaw-section .container { max-width: 1200px; margin: 0 auto; }

.fpaw-section .section-title {
	text-align: center;
	font-size: clamp(2.5rem, 4vw, 3.5rem);
	margin-bottom: 3rem;
	position: relative;
	display: block;
	font-weight: 700;
	max-width: 1000px;
	line-height: 1.15;
	margin-left: auto;
	margin-right: auto;
}

.fpaw-section .section-title.fpaw-section-title-sm {
	font-size: clamp(2rem, 3vw, 2.8rem);
}

.fpaw-section .section-title::after {
	content: '';
	display: block;
	margin: 10px auto 0;
	width: 60%;
	height: 4px;
	background: linear-gradient(90deg, transparent, var(--fpaw-color-secondary), transparent);
	border-radius: 2px;
}

/* BACKGROUND VARIANTS */
.fpaw-section.bg-light,
.fpaw-image-divider.bg-light { background-color: #f7f8fa; }

.fpaw-section.bg-gradient,
.fpaw-image-divider.bg-gradient { background: linear-gradient(135deg, #f7f8fa 0%, #e2e3e6 100%); }

.fpaw-section.bg-dark,
.fpaw-image-divider.bg-dark {
	background-color: var(--fpaw-color-primary);
	color: var(--fpaw-color-light);
}

.fpaw-image-divider.bg-none { background: transparent; padding: 0; }

.fpaw-section.bg-dark p,
.fpaw-section.bg-dark h1,
.fpaw-section.bg-dark h2,
.fpaw-section.bg-dark h3,
.fpaw-section.bg-dark h4 { color: var(--fpaw-color-light); }

.fpaw-section.bg-dark p { color: rgba(255,255,255,0.85); }

/* PURPOSE GRID + CARDS */
.fpaw-section .fpaw-intro { margin-top: 0; }

.fpaw-section .purpose-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 2rem;
	margin-top: 3rem;
}

.fpaw-section .purpose-card {
	background: var(--fpaw-color-light);
	border-radius: 15px;
	padding: 2rem;
	box-shadow: 0 10px 30px rgba(0,0,0,0.05);
	border-top: 4px solid var(--fpaw-color-secondary);
}

.fpaw-section .purpose-card h3 {
	font-size: 1.4rem;
	color: var(--fpaw-color-primary);
}

/* ARCHIVE GRID + CASE-STUDY TILES */
.fpaw-section .archive-container {
	max-width: 1400px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2rem;
}

.fpaw-section a.case-study {
	display: block;
	text-decoration: none;
	color: inherit;
	background: var(--fpaw-color-light);
	border: 1px solid rgba(136,137,141,0.2);
	border-radius: 15px;
	overflow: hidden;
	box-shadow: 0 10px 30px rgba(0,0,0,0.05);
	transition: var(--fpaw-transition);
	transform-style: preserve-3d;
	perspective: 1000px;
}

.fpaw-section a.case-study:hover {
	box-shadow: 0 20px 40px rgba(0,0,0,0.15);
	transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
	border-color: var(--fpaw-color-secondary);
}

.fpaw-section a.case-study .case-title {
	padding: 2rem;
	font-size: 1.3rem;
	font-weight: 600;
	color: var(--fpaw-color-primary);
	margin: 0;
	display: flex;
	align-items: center;
	background: linear-gradient(to right, rgba(255,255,255,1), rgba(247,248,250,1));
	min-height: 120px;
}

/* IMAGE DIVIDER */
.fpaw-image-divider { padding: 4rem 2rem; }
.fpaw-image-divider.bg-none { padding: 0; }
.fpaw-image-divider .fpaw-image-divider-inner { max-width: 1200px; margin: 0 auto; }
.fpaw-image-divider.layout-full-width .fpaw-image-divider-inner { max-width: 100%; }

.fpaw-image-figure { margin: 0; text-align: center; }

.fpaw-image-figure img {
	max-width: 100%;
	height: auto;
	border-radius: 18px;
	display: block;
	margin: 0 auto;
	box-shadow: 0 15px 40px rgba(52,55,62,0.12);
}

.fpaw-image-divider.layout-full-width .fpaw-image-figure img {
	border-radius: 0;
	width: 100%;
}

.fpaw-image-caption {
	margin-top: 1rem;
	font-size: 1rem;
	color: #555;
	font-style: italic;
}

.fpaw-image-divider.bg-dark .fpaw-image-caption { color: rgba(255,255,255,0.8); }

/* REVEAL */
.fpaw-section.reveal,
.fpaw-image-divider.reveal,
.fpaw-hero.reveal,
.fpaw-section a.case-study.reveal {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fpaw-section.reveal.active,
.fpaw-image-divider.reveal.active,
.fpaw-hero.reveal.active,
.fpaw-section a.case-study.reveal.active {
	opacity: 1;
	transform: translateY(0);
}

@keyframes fpaw-float {
	0%   { transform: translateY(0) rotate(-15deg) skewX(10deg); }
	50%  { transform: translateY(-20px) rotate(-10deg) skewX(12deg); }
	100% { transform: translateY(0) rotate(-15deg) skewX(10deg); }
}

.elementor-editor-active .fpaw-section.reveal,
.elementor-editor-active .fpaw-image-divider.reveal,
.elementor-editor-active .fpaw-hero.reveal,
.elementor-editor-active .fpaw-section a.case-study.reveal {
	opacity: 1;
	transform: none;
}

/* RESPONSIVE */
@media (max-width: 992px) {
	.fpaw-section .archive-container {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.fpaw-section { padding: 3rem 1.5rem; }
	.fpaw-section .archive-container { grid-template-columns: 1fr; }

	.fpaw-section a.case-study .case-title {
		padding: 1.5rem;
		font-size: 1.1rem;
		min-height: auto;
	}

	.fpaw-hero.hero {
		min-height: auto;
		padding: 4rem 1.2rem;
		display: block;
	}

	.fpaw-hero h1 {
		font-size: clamp(1.7rem, 6vw, 2.4rem);
		line-height: 1.25;
	}

	.fpaw-hero p { font-size: 1.05rem; }
}

@media (max-width: 480px) {
	.fpaw-hero h1 { font-size: 1.6rem; line-height: 1.3; }
	.fpaw-section .section-title { font-size: 1.7rem; }
}
