/* ==========================================================================
   CIP Capabilities Menu - Style 2 (orange split panel + square photo tiles)
   All selectors are namespaced with .cip-caps so nothing leaks into Avada.
   ========================================================================== */

.cip-caps {
	--cip-orange: #e8881f;
	--cip-orange-dark: #cf7418;
	--cip-navy: #0f172a;
	--cip-line: rgba(255, 255, 255, .15);
	--cip-cols: 4;
	--cip-intro-w: 38%;
	display: flex;
	align-items: stretch;
	width: 100%;
	margin: 0;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.cip-caps *,
.cip-caps *::before,
.cip-caps *::after {
	box-sizing: border-box;
}

/* ---------- Orange panel ---------- */

.cip-caps__intro {
	flex: 0 0 var(--cip-intro-w);
	max-width: var(--cip-intro-w);
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(44px, 5vw, 80px) clamp(24px, 4vw, 60px);
	background: linear-gradient(135deg, var(--cip-orange), var(--cip-orange-dark));
	color: #fff;
}

.cip-caps__eyebrow {
	display: block;
	font-size: .75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: rgba(255, 255, 255, .72);
	margin: 0 0 12px;
}

.cip-caps__title {
	font-size: clamp(1.6rem, 3.4vw, 2.75rem);
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 20px;
	padding: 0;
	color: #fff;
}

.cip-caps__text {
	font-size: clamp(.9rem, 1.15vw, .95rem);
	line-height: 1.7;
	color: rgba(255, 255, 255, .82);
	margin: 0;
	max-width: 42ch;
}

.cip-caps__watermark {
	position: absolute;
	bottom: -60px;
	right: -40px;
	width: 280px;
	height: 280px;
	opacity: .08;
	pointer-events: none;
	transform: rotate(15deg);
}

.cip-caps__watermark img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: brightness(0) invert(1) blur(2px);
}

/* ---------- Tile grid ---------- */

.cip-caps__nav {
	flex: 1 1 0%;
	min-width: 0;
}

.cip-caps__grid {
	display: grid;
	grid-template-columns: repeat(var(--cip-cols), minmax(0, 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
}

.cip-caps__item {
	margin: 0;
	padding: 0;
	min-width: 0;
	list-style: none;
}

.cip-caps__item::before,
.cip-caps__item::marker {
	content: none;
	display: none;
}

.cip-caps__cell {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--cip-navy);
	border-right: 1px solid var(--cip-line);
	border-bottom: 1px solid var(--cip-line);
	text-decoration: none;
	color: #fff;
}

.cip-caps__cell:hover,
.cip-caps__cell:focus,
.cip-caps__cell:active {
	color: #fff;
	text-decoration: none;
}

.cip-caps__cell:focus-visible {
	outline: 3px solid var(--cip-orange);
	outline-offset: -3px;
}

/* Fallback for browsers without aspect-ratio (class added by the JS). */
.cip-caps--no-aspect .cip-caps__cell {
	aspect-ratio: auto;
	height: 0;
	padding-bottom: 100%;
}

.cip-caps__media {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
}

.cip-caps__media img {
	width: 100%;
	height: 100%;
	max-width: none;
	display: block;
	object-fit: cover;
	transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}

.cip-caps__media::after {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .35) 50%, rgba(0, 0, 0, .15) 100%);
	transition: background .4s;
}

.cip-caps__name {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 14px;
	z-index: 2;
	font-size: clamp(.78rem, 1.05vw, .875rem);
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.cip-caps__arrow {
	position: absolute;
	top: 12px;
	right: 14px;
	z-index: 2;
	font-size: .8rem;
	line-height: 1;
	color: rgba(255, 255, 255, .55);
	transition: color .4s, transform .4s;
}

.cip-caps__cell[aria-current="page"] .cip-caps__name {
	color: var(--cip-orange);
}

/* Hover effects only where there is a real pointer, so phones never get
   stuck in a hover state after a tap. */
@media (hover: hover) {
	.cip-caps__cell:hover .cip-caps__media img {
		transform: scale(1.05);
	}

	.cip-caps__cell:hover .cip-caps__media::after {
		background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .2) 50%, rgba(0, 0, 0, .05) 100%);
	}

	.cip-caps__cell:hover .cip-caps__arrow {
		color: var(--cip-orange);
		transform: translate(2px, -2px);
	}
}

/* ---------- Optional orange CTA tile ---------- */

.cip-caps__cell--cta {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 14px;
	background: linear-gradient(135deg, var(--cip-orange), var(--cip-orange-dark));
}

.cip-caps__cell--cta .cip-caps__name {
	position: static;
	left: auto;
	right: auto;
	bottom: auto;
	text-shadow: none;
	font-size: clamp(.82rem, 1.1vw, .95rem);
}

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

@media only screen and (max-width: 1200px) {
	.cip-caps {
		--cip-intro-w: 36%;
	}
}

@media only screen and (max-width: 1024px) {
	.cip-caps {
		--cip-intro-w: 40%;
		--cip-cols: 3;
	}
}

@media only screen and (max-width: 900px) {
	.cip-caps {
		flex-direction: column;
		--cip-intro-w: 100%;
		--cip-cols: 4;
	}

	.cip-caps__intro {
		flex: 0 0 auto;
		max-width: none;
	}

	.cip-caps__watermark {
		width: 200px;
		height: 200px;
		bottom: -40px;
		right: -28px;
	}
}

@media only screen and (max-width: 768px) {
	.cip-caps {
		--cip-cols: 3;
	}
}

@media only screen and (max-width: 560px) {
	.cip-caps {
		--cip-cols: 2;
	}

	.cip-caps__name {
		font-size: .8rem;
		left: 12px;
		right: 12px;
		bottom: 12px;
	}

	.cip-caps__arrow {
		top: 10px;
		right: 12px;
		font-size: .75rem;
	}
}

@media only screen and (max-width: 400px) {
	.cip-caps__intro {
		padding: 40px 20px;
	}
}

/* ---------- Optional stacked list layout for phones ---------- */

@media only screen and (max-width: 560px) {
	.cip-caps--mobile-list {
		--cip-cols: 1;
	}

	.cip-caps--mobile-list .cip-caps__cell {
		aspect-ratio: auto;
		height: auto;
		min-height: 76px;
		padding: 12px 44px 12px 104px;
		display: flex;
		align-items: center;
		border-right: 0;
	}

	.cip-caps--mobile-list .cip-caps__media {
		right: auto;
		width: 88px;
	}

	.cip-caps--mobile-list .cip-caps__media::after {
		background: linear-gradient(to right, rgba(15, 23, 42, .15) 0%, rgba(15, 23, 42, .55) 70%, #0f172a 100%);
	}

	.cip-caps--mobile-list .cip-caps__name {
		position: static;
		left: auto;
		right: auto;
		bottom: auto;
		font-size: .95rem;
		text-shadow: none;
	}

	.cip-caps--mobile-list .cip-caps__arrow {
		top: 50%;
		right: 18px;
		transform: translateY(-50%);
		color: var(--cip-orange);
	}

	.cip-caps--mobile-list .cip-caps__cell--cta {
		min-height: 0;
		padding: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cip-caps *,
	.cip-caps *::after {
		transition: none !important;
	}
}
