/* ==========================================================================
   Homepage Layout
   Main homepage sections in visual order: hero, cards, help, CTAs and footer.
   ========================================================================== */
.cm-home {
	overflow: hidden;
	background: var(--cm-soft-white);
}

/* Three homepage top cards below the hero. */
.cm-top-cards {
	position: relative;
	z-index: 3;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.2rem;
	width: min(1120px, calc(100% - 2rem));
	margin: -6rem auto 5rem;
}

.cm-top-cards article,
.cm-post-card {
	background: rgba(251, 250, 247, 0.96);
	border: 1px solid rgba(7, 50, 54, 0.08);
	border-radius: 8px;
	box-shadow: var(--cm-shadow);
}

.cm-top-cards article {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 0 1rem;
	align-items: start;
	padding: 1.25rem;
}

.cm-card-icon {
	grid-row: span 3;
	width: 58px;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--cm-ash);
	position: relative;
}

.cm-card-icon::before,
.cm-help span::before {
	content: "";
	position: absolute;
	inset: 16px;
	border: 2px solid var(--cm-teal);
	border-radius: 50%;
}

.cm-top-cards h2,
.cm-top-cards p {
	margin: 0;
}

.cm-top-cards h2 {
	font-size: 1.55rem;
}

.cm-top-cards p {
	margin-top: 0.35rem;
	color: var(--cm-muted);
}

.cm-top-cards a,
.cm-help a,
.cm-section-heading a {
	font-family: var(--wp--preset--font-family--manrope, system-ui, sans-serif);
	font-weight: 600;
	color: var(--cm-teal);
}

/* Shared section width and spacing wrapper. */
.cm-section {
	width: min(1160px, calc(100% - 2rem));
	margin: 0 auto;
	padding: 0 0 clamp(3rem, 6vw, 5rem) 0;
}

/* "How I can help" service grid. */
.cm-help>h2 {
	text-align: center;
	margin: 0 0 2rem;
	font-size: clamp(2rem, 3.5vw, 3.5rem);
}

.cm-help-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2rem 1.2rem;
}

.cm-help article {
	position: relative;
	min-height: 250px;
	padding: 0.4rem 1.2rem 0;
	text-align: center;
	border-right: 1px solid var(--cm-border);
}

.cm-help article:nth-child(4n) {
	border-right: 0;
}

.cm-help span {
	position: relative;
	display: block;
	width: 62px;
	aspect-ratio: 1;
	margin: 0 auto 1rem;
}

.cm-help h3 {
	max-width: 13ch;
	margin: 0 auto 0.7rem;
	font-size: 1.35rem;
	line-height: 1.05;
}

.cm-help p {
	min-height: 6.6rem;
	margin: 0 0 1rem;
	color: var(--cm-muted);
	font-size: 0.98rem;
	line-height: 1.45;
}

/* Mid-page dark CTA strip and final almond CTA share layout structure. */
.cm-cta-strip,
.cm-final-cta {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	width: min(1180px, calc(100% - 2rem));
	margin: 1rem auto clamp(3rem, 7vw, 6rem);
	padding: clamp(1.4rem, 3vw, 2.3rem) clamp(1.5rem, 5vw, 5rem);
	border-radius: 8px;
}

.cm-cta-strip {
	position: relative;
	overflow: hidden;
	background: linear-gradient(90deg, var(--cm-dark-teal), var(--cm-teal));
	color: var(--cm-soft-white);
}

.cm-cta-strip::before,
.cm-cta-strip::after {
	content: "";
	position: absolute;
	width: 180px;
	aspect-ratio: 1;
	background: rgba(186, 212, 207, 0.12);
	border-radius: 44% 56% 55% 45%;
}

.cm-cta-strip::before {
	left: -60px;
	top: -85px;
}

.cm-cta-strip::after {
	right: -70px;
	bottom: -90px;
}

.cm-cta-strip>*,
.cm-final-cta>* {
	position: relative;
	z-index: 1;
}

.cm-cta-strip h2,
.cm-cta-strip p,
.cm-final-cta h2,
.cm-final-cta p {
	margin: 0;
}

.cm-cta-strip h2 {
	color: var(--cm-soft-white);
	font-size: clamp(2rem, 3vw, 3rem);
}

/* Experience feature: blob-backed copy beside supporting imagery. */
.cm-experience {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
	align-items: center;
	gap: clamp(1.5rem, 4vw, 4rem);
	width: min(1180px, calc(100% - 2rem));
	margin: 0 auto clamp(3rem, 6vw, 5rem);
}

.cm-experience-copy {
	position: relative;
	padding: clamp(2.2rem, 5vw, 4.5rem);
	isolation: isolate;
}

.cm-experience-copy::before {
	content: "";
	position: absolute;
	inset: -6%;
	z-index: -1;
	background: rgba(186, 212, 207, 0.34);
	filter: drop-shadow(0 18px 32px rgba(7, 50, 54, 0.14));
	mask: url("../../images/shapes/blob-01.svg") center / 100% 100% no-repeat;
	-webkit-mask: url("../../images/shapes/blob-01.svg") center / 100% 100% no-repeat;
}

.cm-experience h2 {
	margin: 0 0 0.7rem;
	font-size: clamp(2rem, 3.2vw, 3.2rem);
}

.cm-experience ul {
	margin: 1rem 0 1.4rem;
	padding-left: 1.2rem;
}

.cm-experience li {
	margin: 0.45rem 0;
}

.cm-experience img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 48% 52% 46% 54% / 56% 44% 56% 44%;
	box-shadow: var(--cm-shadow);
}

/* Placeholder testimonial band kept intentionally generic until real copy exists. */
.cm-testimonial-placeholder {
	width: min(1140px, calc(100% - 2rem));
	margin: 0 auto;
	padding: clamp(2rem, 2.2vw, 3rem) 0;
	text-align: center;
}

.cm-testimonial-placeholder p {
	max-width: 26ch;
	margin: 0 auto;
	color: var(--cm-dark-teal);
    font-size: clamp(2.2rem, 3.2vw, 4rem);
	line-height: 1.25;
}

/* Section heading rows with optional inline action links. */
.cm-section-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.2rem;
}

.cm-section-heading h2 {
	margin: 0;
	font-size: clamp(2rem, 3vw, 3rem);
}

/* Latest Insights query cards. */
.cm-query .cm-post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.4rem;
}

.cm-post-card {
	overflow: hidden;
	padding: 0 0 1.2rem;
}

.cm-post-card:not(:has(.wp-block-post-featured-image img))::before {
	content: "";
	display: block;
	aspect-ratio: 3 / 2;
	background: linear-gradient(180deg, rgba(7, 50, 54, 0.04), rgba(7, 50, 54, 0.2)), url("/wp-content/themes/capallmara/images/spot/Sea.png") center / cover no-repeat;
}

.cm-post-card>*:not(.wp-block-post-featured-image) {
	margin-left: 1rem;
	margin-right: 1rem;
}

.cm-post-card h3 {
	font-size: 1.2rem;
	line-height: 1.15;
}

.cm-empty-insights {
	padding: 1.2rem;
	border: 1px dashed var(--cm-border);
	border-radius: 8px;
	color: var(--cm-muted);
}

/* Publication/book feature block. */
.cm-book-feature {
	display: grid;
	grid-template-columns: minmax(200px, 320px) minmax(0, 520px);
	justify-content: center;
	align-items: center;
	gap: clamp(2rem, 5vw, 5rem);
	width: min(960px, calc(100% - 2rem));
	margin: 0 auto clamp(3rem, 6vw, 5rem);
}

.cm-book-feature img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: contain;
	background: var(--cm-soft-white);
	border-radius: 8px;
	box-shadow: var(--cm-shadow);
}

.cm-book-feature h2 {
	margin: 0 0 0.7rem;
	font-size: clamp(1.8rem, 3vw, 3rem);
}

.cm-final-cta {
	background: var(--cm-almond);
}

.cm-final-cta h2 {
	font-size: clamp(1.8rem, 3vw, 2.8rem);
}

