/**
 * Clean Peak — "Our Work" page design.
 *
 * Classes are prefixed `cpw-` (Clean Peak Work) to avoid any collision with
 * Divi or third-party `.cp-`/popup styles.
 */

.cpw-page {
	--cpw-green-dark: #283020;
	--cpw-green: #3b442f;
	--cpw-primary: #586547;
	--cpw-primary-h: #48533b;
	--cpw-sage: #8fa772;
	--cpw-sage-h: #7d9560;
	--cpw-cream: #f2f2e8;
	--cpw-cream2: #fafaf6;
	--cpw-mist: #e9eedf;
	--cpw-body: #4a5040;
	--cpw-border: #cfd5c4;
	--cpw-heading-font: "Headline One", "Oswald", sans-serif;
	--cpw-display-font: "Oswald", sans-serif;
	--cpw-body-font: "Raleway", sans-serif;

	font-family: var(--cpw-body-font);
	color: #3a3f33;
	background: #fff;
}

.cpw-page * { box-sizing: border-box; }

.cpw-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------------------------------------------------------- Typography */

.cpw-eyebrow {
	font-family: var(--cpw-display-font);
	font-size: 17px;
	line-height: 1.5;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: var(--cpw-green);
	font-weight: 600;
	margin: 0 0 12px;
}

.cpw-eyebrow--sage { color: var(--cpw-sage); }

.cpw-page .cpw-display {
	font-family: var(--cpw-heading-font);
	font-weight: 500;
	text-transform: uppercase;
	font-size: 64px;
	line-height: 1.02;
	margin: 0;
	color: #fff;
}

.cpw-page .cpw-h2 {
	font-family: var(--cpw-heading-font);
	font-weight: 500;
	text-transform: uppercase;
	font-size: 40px;
	line-height: 1.1;
	color: var(--cpw-green);
	margin: 0;
}

/* Scoped to match the base rule's specificity so the white actually wins. */
.cpw-page .cpw-h2--light { color: #fff; }

.cpw-page .cpw-h3 {
	font-family: var(--cpw-heading-font);
	font-weight: 500;
	text-transform: uppercase;
	font-size: 22px;
	line-height: 1.2;
	color: var(--cpw-green);
	margin: 0;
}

.cpw-h3--lg { font-size: 32px; }

.cpw-lede {
	font-size: 17px;
	line-height: 1.65;
	color: var(--cpw-body);
	max-width: 680px;
	margin: 16px auto 0;
}

.cpw-lede--light { color: #e4e9dc; margin-left: 0; }

.cpw-body {
	font-size: 15px;
	line-height: 1.65;
	color: var(--cpw-body);
	margin: 0;
}

.cpw-head {
	text-align: center;
	margin-bottom: 48px;
}

/* -------------------------------------------------------------- Buttons */

.cpw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 36px;
	border-radius: 6px;
	font-family: var(--cpw-display-font);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .2s, border-color .2s, color .2s;
}

.cpw-btn--sage { background: var(--cpw-sage); border-color: var(--cpw-sage); color: #fff; }
.cpw-btn--sage:hover { background: var(--cpw-sage-h); border-color: var(--cpw-sage-h); color: #fff; }
.cpw-btn--primary { background: var(--cpw-primary); border-color: var(--cpw-primary); color: #fff; }
.cpw-btn--primary:hover { background: var(--cpw-primary-h); border-color: var(--cpw-primary-h); color: #fff; }
.cpw-btn--outline { border-color: var(--cpw-primary); color: var(--cpw-green); background: transparent; }
.cpw-btn--outline:hover { background: var(--cpw-mist); color: var(--cpw-green); }
.cpw-btn--ghost { border-color: #fff; color: #fff; background: transparent; }
.cpw-btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.cpw-btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.cpw-link {
	color: var(--cpw-primary);
	font-weight: 500;
	text-decoration: none;
	font-size: 14px;
	font-family: var(--cpw-heading-font);
	text-transform: uppercase;
	letter-spacing: .08em;
}
.cpw-link:hover { color: var(--cpw-green); }

.cpw-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 16px rgba(0, 0, 0, .07);
}

.cpw-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.cpw-pill {
	display: inline-flex;
	align-items: center;
	font-size: 12px;
	font-weight: 600;
	color: var(--cpw-green);
	background: var(--cpw-mist);
	border-radius: 50px;
	padding: 5px 12px;
}

/* ----------------------------------------------------------------- Hero */

.cpw-hero {
	position: relative;
	background-color: var(--cpw-green-dark);
	color: #fff;
	padding: 40px 0 112px;
	overflow: hidden;
}

.cpw-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--cpw-hero-bg, none);
	background-size: cover;
	background-position: center;
	opacity: .38;
}

.cpw-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(40, 48, 32, .85) 0%, rgba(40, 48, 32, .55) 60%, rgba(40, 48, 32, .25) 100%);
}

.cpw-hero .cpw-wrap { position: relative; z-index: 1; }

.cpw-crumb { font-size: 13px; color: #cfd8c2; margin: 0 0 72px; }
.cpw-crumb a { color: #cfd8c2; }

.cpw-hero__copy { max-width: 760px; }
.cpw-hero__intro {
	font-size: 18px;
	line-height: 1.65;
	color: #e4e9dc;
	max-width: 600px;
	margin: 24px 0 32px;
}

/* ------------------------------------------------------- Case studies */

.cpw-section { padding: 96px 0; }
.cpw-section--cases { background: var(--cpw-cream); }

.cpw-lead {
	display: flex;
	flex-wrap: wrap;
	overflow: hidden;
}
.cpw-lead__media { flex: 1 1 560px; min-height: 440px; position: relative; overflow: hidden; }
.cpw-lead__body {
	flex: 1 1 380px;
	padding: 44px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.cpw-lead__cta { align-self: flex-start; margin-top: auto; }

.cpw-csgrid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin-top: 24px;
}

.cpw-csitem { overflow: hidden; display: flex; flex-direction: column; }
.cpw-csitem.is-hidden { display: none; }
.cpw-csitem__media { height: 260px; position: relative; overflow: hidden; }
.cpw-csitem__body { padding: 28px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.cpw-csitem__body .cpw-link { margin-top: auto; }

.cpw-more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	margin-top: 40px;
}
.cpw-more__count { font-size: 14px; color: var(--cpw-body); margin: 0; }

/* ------------------------------------------------- Before/after slider */

.cpw-ba { position: relative; width: 100%; height: 100%; overflow: hidden; background: #c9d3b8; }
.cpw-csitem__media .cpw-ba,
.cpw-lead__media .cpw-ba { position: absolute; inset: 0; }

.cpw-ba__after,
.cpw-ba__before {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cpw-ba--single .cpw-ba__after { position: absolute; }

.cpw-ba__tag {
	position: absolute;
	top: 14px;
	font-family: var(--cpw-body-font);
	font-size: 12px;
	font-weight: 600;
	color: var(--cpw-green);
	background: rgba(242, 242, 232, .92);
	padding: 6px 10px;
	border-radius: 6px;
	z-index: 3;
	pointer-events: none;
}
.cpw-ba__tag--left { left: 14px; }
.cpw-ba__tag--right { right: 14px; }

.cpw-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 4px;
	margin-left: -2px;
	background: #fff;
	z-index: 2;
	pointer-events: none;
}
.cpw-ba__handle {
	position: absolute;
	top: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
	color: var(--cpw-green);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	pointer-events: none;
}
.cpw-ba--card .cpw-ba__handle { width: 40px; height: 40px; margin: -20px 0 0 -20px; }

.cpw-ba__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
	z-index: 4;
}

/* Placeholder when no images yet */
.cpw-ph {
	background-color: #c9d3b8;
	background-image: repeating-linear-gradient(45deg, rgba(59, 68, 47, .09) 0 10px, transparent 10px 20px);
	display: flex;
	align-items: center;
	justify-content: center;
}
.cpw-ph__label {
	font-family: var(--cpw-body-font);
	font-size: 12px;
	font-weight: 600;
	color: var(--cpw-green);
	background: rgba(242, 242, 232, .92);
	padding: 6px 10px;
	border-radius: 6px;
}

/* ------------------------------------------------------- Photo gallery */

.cpw-section--gallery { background: #fff; }

.cpw-filters {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px;
	border: 1px solid #e3e7da;
	border-radius: 14px;
	background: var(--cpw-cream2);
}
.cpw-filters__row { display: flex; align-items: flex-start; gap: 16px; }
.cpw-filters__label {
	font-family: var(--cpw-display-font);
	text-transform: uppercase;
	letter-spacing: .1em;
	font-size: 13px;
	color: var(--cpw-green);
	width: 200px;
	flex: none;
	display: flex;
	align-items: center;
	min-height: 44px;
}
.cpw-chiprow {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	flex: 1 1 0;
	min-width: 0;
	overflow-x: auto;
	padding-bottom: 4px;
}

.cpw-chip {
	display: inline-flex;
	align-items: center;
	flex: none;
	white-space: nowrap;
	min-height: 44px;
	padding: 0 18px;
	border-radius: 50px;
	font-family: var(--cpw-body-font);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	background: #fff;
	color: var(--cpw-green);
	border: 1.5px solid var(--cpw-border);
	transition: background .15s, color .15s, border-color .15s;
}
.cpw-chip.is-active { background: var(--cpw-primary); color: #fff; border-color: var(--cpw-primary); }

.cpw-gallery__count { font-size: 14px; color: var(--cpw-body); margin: 20px 0; }

.cpw-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}

.cpw-tile {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font: inherit;
	color: inherit;
}
.cpw-tile.is-hidden { display: none; }
.cpw-tile__media {
	position: relative;
	display: block;
	height: 220px;
	border-radius: 10px;
	width: 100%;
	overflow: hidden;
}
.cpw-tile__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpw-tile:hover .cpw-tile__media { outline: 3px solid var(--cpw-sage); outline-offset: -3px; }
.cpw-tile__cap { font-size: 13px; font-weight: 600; color: var(--cpw-green); }

.cpw-badge {
	position: absolute;
	left: 10px;
	top: 10px;
	font-family: var(--cpw-body-font);
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	border-radius: 6px;
	padding: 6px 10px;
}
.cpw-badge--render { background: #5d7444; }

.cpw-gallery__empty {
	text-align: center;
	padding: 48px 24px;
	border: 1px dashed var(--cpw-border);
	border-radius: 12px;
	color: var(--cpw-body);
	margin-top: 8px;
}

/* ----------------------------------------------------------- Lightbox */

.cpw-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(20, 24, 16, .92);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.cpw-lightbox[hidden] { display: none; }
.cpw-lightbox__btn {
	position: absolute;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cpw-lightbox__close { top: 16px; right: 16px; width: 48px; height: 48px; }
.cpw-lightbox__prev { left: 16px; top: 50%; margin-top: -26px; width: 52px; height: 52px; }
.cpw-lightbox__next { right: 16px; top: 50%; margin-top: -26px; width: 52px; height: 52px; }
.cpw-lightbox__btn:hover { background: rgba(255, 255, 255, .22); }
.cpw-lightbox__img {
	max-width: min(1200px, 100%);
	max-height: calc(100vh - 200px);
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.cpw-lightbox__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px 24px;
	margin-top: 20px;
	color: #fff;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
}
.cpw-lightbox__pos { font-size: 13px; color: #cfd8c2; font-weight: 400; }
.cpw-lightbox__cta { min-height: 44px; padding: 0 20px; font-size: 14px; }

/* ---------------------------------------------------------------- CTA */

.cpw-cta {
	position: relative;
	background: var(--cpw-green);
	color: #fff;
	padding: 112px 0;
	overflow: hidden;
}
.cpw-cta::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: var(--cpw-cta-bg, none);
	background-size: cover;
	background-position: center;
}
.cpw-cta::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(40, 48, 32, .78);
}
.cpw-cta__grid {
	position: relative;
	z-index: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 56px;
}
.cpw-cta__copy { flex: 1 1 480px; min-width: 0; }

.cpw-formcard {
	flex: 0 1 420px;
	min-width: 280px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 2px 16px rgba(0, 0, 0, .18);
	padding: 28px;
	color: var(--cpw-green);
	overflow: hidden;
}
.cpw-formcard__title {
	font-family: var(--cpw-heading-font);
	font-size: 22px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin: 0 0 6px;
	text-align: center;
}
.cpw-formcard__sub { text-align: center; font-size: 14px; color: var(--cpw-body); margin: 0 0 20px; }

/* Built-in native form (matches the design; swappable via the Quote form field) */
.cpw-form { display: grid; gap: 14px; }
.cpw-form__field label { display: block; font-size: 13px; font-weight: 600; color: var(--cpw-green); margin: 0 0 6px; }
.cpw-form__field input,
.cpw-form__field textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--cpw-border);
	border-radius: 6px;
	padding: 11px 12px;
	font-family: var(--cpw-body-font);
	font-size: 14px;
	background: var(--cpw-cream2);
	color: var(--cpw-green);
}
.cpw-form__field textarea { resize: vertical; min-height: 84px; }
.cpw-form__field input:focus,
.cpw-form__field textarea:focus { outline: 2px solid var(--cpw-sage); outline-offset: 1px; border-color: var(--cpw-sage); }
.cpw-form__submit { width: 100%; margin-top: 4px; }

.cpw-cta__note { font-size: 14px; color: #cfd8c2; margin: 20px 0 0; }

/* Embedded form (iframe/shortcode swap) sits flush in the card */
.cpw-formcard__frame { width: 100% !important; max-width: 100% !important; border: 0; display: block; background: transparent; }
.cpw-formcard .ep-iFrameContainer,
.cpw-formcard .ep-wrapper { width: 100% !important; max-width: 100% !important; }

/* --------------------------------------------------------- Responsive */

@media (max-width: 1000px) {
	.cpw-csgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
	.cpw-page .cpw-display { font-size: 44px; }
	.cpw-filters__row { flex-direction: column; gap: 8px; }
	.cpw-filters__label { width: auto; min-height: 0; }
}

@media (max-width: 640px) {
	.cpw-section { padding: 64px 0; }
	.cpw-csgrid { grid-template-columns: minmax(0, 1fr); }
	.cpw-lead__body { padding: 28px; }
	.cpw-lead__media { flex-basis: 100%; min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
	.cpw-btn, .cpw-chip { transition: none; }
}

/* ---- Gravity Forms embedded in the quote card: match the design ---- */
.cpw-formcard .gform_wrapper { margin: 0; }
.cpw-formcard .gform_wrapper .gform_title,
.cpw-formcard .gform_wrapper .gform_description,
.cpw-formcard .gform_wrapper .gform_required_legend { display: none; }
.cpw-formcard .gform_wrapper .gform_fields { display: grid; gap: 14px; grid-template-columns: 1fr; }
.cpw-formcard .gform_wrapper .gfield_label {
	display: block; font-size: 13px; font-weight: 600; color: var(--cpw-green); margin: 0 0 6px;
}
.cpw-formcard .gform_wrapper input:not([type="submit"]):not([type="button"]):not([type="radio"]):not([type="checkbox"]),
.cpw-formcard .gform_wrapper textarea,
.cpw-formcard .gform_wrapper select {
	width: 100%; box-sizing: border-box; border: 1px solid var(--cpw-border); border-radius: 6px;
	padding: 11px 12px; font-family: var(--cpw-body-font); font-size: 14px; background: var(--cpw-cream2); color: var(--cpw-green);
}
.cpw-formcard .gform_wrapper textarea { resize: vertical; min-height: 84px; }
.cpw-formcard .gform_wrapper input:focus, .cpw-formcard .gform_wrapper textarea:focus { outline: 2px solid var(--cpw-sage); outline-offset: 1px; border-color: var(--cpw-sage); }
.cpw-formcard .gform_wrapper .gform_footer { margin: 12px 0 0; padding: 0; }
.cpw-formcard .gform_wrapper input[type="submit"],
.cpw-formcard .gform_wrapper .gform_button {
	width: 100%; background: var(--cpw-primary); border: 1px solid var(--cpw-primary); color: #fff; border-radius: 6px;
	min-height: 52px; font-family: var(--cpw-display-font); text-transform: uppercase; letter-spacing: 1px;
	font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer; transition: background .2s;
}
.cpw-formcard .gform_wrapper input[type="submit"]:hover, .cpw-formcard .gform_wrapper .gform_button:hover { background: var(--cpw-primary-h); border-color: var(--cpw-primary-h); }
.cpw-formcard .gform_wrapper .gfield_description.validation_message,
.cpw-formcard .gform_wrapper .gform_validation_errors { font-size: 13px; color: #a3401f; }
