/* =================================================================
   Hydropath Case Studies — Grid Styles v7
   Country flag overlay, KPI block, single CTA + circular PDF, filter
   card with always-visible dropdowns. Brand-locked palette.
   ================================================================= */

.hcs-grid-wrapper {
	/* Brand palette */
	--hcs-navy:        #0a2540;
	--hcs-navy-700:    #122e4d;
	--hcs-navy-50:     #f3f6fa;
	--hcs-cyan:        #00b8d4;
	--hcs-cyan-600:    #009fb8;
	--hcs-cyan-soft:   #b3e5f5;
	--hcs-cyan-bg:     #ecf7fb;
	--hcs-card-bg:     #ffffff;
	--hcs-text:        #0f1f33;
	--hcs-text-muted:  #5a6b7d;
	--hcs-text-soft:   #8898a8;
	--hcs-border:      #e2e8ed;
	--hcs-border-soft: #eef2f5;
	--hcs-shadow-sm:   0 1px 2px rgba(10, 37, 64, 0.05);
	--hcs-shadow-md:   0 6px 24px rgba(10, 37, 64, 0.08);
	--hcs-shadow-lg:   0 24px 60px rgba(10, 37, 64, 0.18);
	--hcs-radius:      20px;
	--hcs-radius-sm:   12px;
	--hcs-radius-pill: 9999px;

	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
	color: var(--hcs-text);
	max-width: 1280px;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
	-webkit-font-smoothing: antialiased;
}

.hcs-grid-wrapper *,
.hcs-grid-wrapper *::before,
.hcs-grid-wrapper *::after {
	box-sizing: border-box;
}

.hcs-grid-wrapper a {
	text-decoration: none;
}

/* ===== Filter card (wraps pills + dropdowns + result count) ===== */

.hcs-grid-wrapper .hcs-filter-card {
	background: var(--hcs-card-bg);
	border: 1px solid var(--hcs-border);
	border-radius: var(--hcs-radius);
	padding: 1.25rem 1.5rem;
	margin: 0 0 2rem;
	box-shadow: var(--hcs-shadow-sm);
}

/* ===== Pill bar (Industry tabs) ===== */

.hcs-grid-wrapper .hcs-pill-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
}

.hcs-grid-wrapper .hcs-pill-bar:not(:last-child) {
	margin: 0 0 1rem;
	padding: 0 0 1rem;
	border-bottom: 1px solid var(--hcs-border-soft);
}

.hcs-grid-wrapper .hcs-pill {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: inherit;
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--hcs-text-muted);
	background: transparent;
	border: 1px solid var(--hcs-border);
	padding: 0.55rem 1rem;
	border-radius: var(--hcs-radius-pill);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
	line-height: 1.2;
}

.hcs-grid-wrapper .hcs-pill:hover {
	color: var(--hcs-navy);
	border-color: var(--hcs-cyan-soft);
	background: var(--hcs-cyan-bg);
}

.hcs-grid-wrapper .hcs-pill.is-active {
	color: #fff;
	background: var(--hcs-navy);
	border-color: var(--hcs-navy);
	box-shadow: 0 4px 12px rgba(10, 37, 64, 0.18);
}

.hcs-grid-wrapper .hcs-pill .hcs-pill-icon {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

/* ===== Filter row (dropdowns + clear + count) ===== */

.hcs-grid-wrapper .hcs-filter-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.hcs-grid-wrapper .hcs-filter-dropdowns {
	display: flex;
	gap: 0.6rem;
	flex-wrap: wrap;
	flex: 1;
	min-width: 0;
}

.hcs-grid-wrapper .hcs-select-wrap {
	position: relative;
	min-width: 150px;
	flex: 1 1 150px;
	max-width: 220px;
}

.hcs-grid-wrapper .hcs-select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	width: 100%;
	font-family: inherit;
	font-size: 0.92rem;
	font-weight: 500;
	color: var(--hcs-navy);
	background-color: var(--hcs-navy-50);
	border: 1px solid var(--hcs-border);
	border-radius: var(--hcs-radius-sm);
	padding: 0.7rem 2.2rem 0.7rem 0.95rem;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%230a2540' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='1 1 5 5 9 1'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.hcs-grid-wrapper .hcs-select:hover {
	border-color: var(--hcs-cyan-soft);
	background-color: #fff;
}

.hcs-grid-wrapper .hcs-select:focus {
	outline: none;
	border-color: var(--hcs-cyan);
	box-shadow: 0 0 0 3px rgba(0, 184, 212, 0.15);
	background-color: #fff;
}

.hcs-grid-wrapper .hcs-select::-ms-expand {
	display: none;
}

.hcs-grid-wrapper .hcs-filter-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	white-space: nowrap;
}

.hcs-grid-wrapper .hcs-clear-all {
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--hcs-text-muted);
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 500;
	cursor: pointer;
	padding: 0.4rem 0.6rem;
	border-radius: var(--hcs-radius-sm);
	transition: color 0.15s ease, background 0.15s ease;
}

.hcs-grid-wrapper .hcs-clear-all:hover {
	color: var(--hcs-navy);
	background: var(--hcs-navy-50);
}

.hcs-grid-wrapper .hcs-result-count {
	font-size: 0.85rem;
	color: var(--hcs-text-muted);
	font-variant-numeric: tabular-nums;
}

.hcs-grid-wrapper .hcs-result-count-number {
	color: var(--hcs-navy);
	font-weight: 700;
	font-size: 0.95rem;
}

/* ===== Grid ===== */
/*  We use data-hcs-columns (NOT data-columns) because Divi's salvattore
    matches [data-columns] and physically moves child nodes. With our
    own attribute name it leaves us alone. !important kept as a belt
    against any Divi blog-grid CSS that might still try to interfere. */

.hcs-grid-wrapper .hcs-grid {
	display: grid !important;
	gap: 1.75rem !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	width: 100% !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.hcs-grid-wrapper .hcs-grid[data-hcs-columns="1"] { grid-template-columns: 1fr !important; }
.hcs-grid-wrapper .hcs-grid[data-hcs-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.hcs-grid-wrapper .hcs-grid[data-hcs-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.hcs-grid-wrapper .hcs-grid[data-hcs-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }

.hcs-grid-wrapper .hcs-grid > .hcs-card {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	clear: none !important;
}

.hcs-grid-wrapper .hcs-grid.is-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ===== Card ===== */

.hcs-grid-wrapper .hcs-card {
	display: flex;
	flex-direction: column;
	background: var(--hcs-card-bg);
	border: 1px solid var(--hcs-border);
	border-radius: var(--hcs-radius);
	overflow: hidden;
	transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
	            box-shadow 0.35s ease,
	            border-color 0.35s ease;
	position: relative;
}

.hcs-grid-wrapper .hcs-card:hover {
	transform: translateY(-8px);
	box-shadow: var(--hcs-shadow-lg);
	border-color: transparent;
}

.hcs-grid-wrapper .hcs-card-image-link {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	/* Soft cyan placeholder. Used while images are loading or when there's no
	   thumbnail at all. Previously navy, but Divi's Visual Builder doesn't
	   always render featured images cleanly inside its iframe, exposing the
	   placeholder colour — light cyan reads as "loading" rather than "broken". */
	background: linear-gradient(135deg, var(--hcs-cyan-bg) 0%, var(--hcs-cyan-soft) 100%);
}

.hcs-grid-wrapper .hcs-card-image,
.hcs-grid-wrapper .hcs-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hcs-grid-wrapper .hcs-card:hover .hcs-card-image img {
	transform: scale(1.05);
}

.hcs-grid-wrapper .hcs-card-image--placeholder {
	background: linear-gradient(135deg, var(--hcs-cyan-bg) 0%, var(--hcs-cyan-soft) 60%, #d4eef5 100%);
}

.hcs-grid-wrapper .hcs-card-image-link::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(10, 37, 64, 0) 50%, rgba(10, 37, 64, 0.45) 100%);
	pointer-events: none;
}

/* ===== Card overlay (country chip + industry chip) ===== */

.hcs-grid-wrapper .hcs-card-overlay {
	position: absolute;
	top: 1rem;
	left: 1rem;
	right: 1rem;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 0.5rem;
	z-index: 2;
	pointer-events: none;
}

/* When only the industry chip is shown (country removed), keep it on the
   right where it always sat instead of letting flex drift it to the left. */
.hcs-grid-wrapper .hcs-card-overlay--industry-only {
	justify-content: flex-end;
}

.hcs-grid-wrapper .hcs-country-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	background: rgba(255, 255, 255, 0.96);
	color: var(--hcs-navy);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.4rem 0.75rem;
	border-radius: var(--hcs-radius-pill);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 2px 8px rgba(10, 37, 64, 0.15);
	max-width: 60%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hcs-grid-wrapper .hcs-country-chip .hcs-flag {
	font-size: 1.05rem;
	line-height: 1;
	letter-spacing: 0;
	flex-shrink: 0;
}

.hcs-grid-wrapper .hcs-country-chip .hcs-country-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hcs-grid-wrapper .hcs-industry-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--hcs-cyan);
	color: #fff;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	padding: 0.4rem 0.75rem;
	border-radius: var(--hcs-radius-pill);
	box-shadow: 0 4px 12px rgba(0, 184, 212, 0.4);
	max-width: 60%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.hcs-grid-wrapper .hcs-industry-chip .hcs-pill-icon {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

/* ===== Card body ===== */

.hcs-grid-wrapper .hcs-card-body {
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	flex: 1;
}

.hcs-grid-wrapper .hcs-card-title {
	font-family: inherit;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--hcs-navy) !important;
	margin: 0 0 0.7rem;
	letter-spacing: -0.015em;
}

.hcs-grid-wrapper .hcs-card-title a {
	color: inherit !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
	background-image: none;
}

.hcs-grid-wrapper .hcs-card-title a:hover {
	color: var(--hcs-cyan-600) !important;
}

.hcs-grid-wrapper .hcs-card-excerpt {
	color: var(--hcs-text-muted);
	font-size: 0.92rem;
	line-height: 1.55;
	margin: 0 0 1.3rem;
}

.hcs-grid-wrapper .hcs-card-excerpt p {
	margin: 0 0 0.5rem;
}

.hcs-grid-wrapper .hcs-card-excerpt p:last-child {
	margin-bottom: 0;
}

/* ===== KPI block ===== */

.hcs-grid-wrapper .hcs-kpis {
	display: grid;
	gap: 0;
	padding: 1rem 0;
	border-top: 1px solid var(--hcs-border-soft);
	border-bottom: 1px solid var(--hcs-border-soft);
	margin: 0 0 1.25rem;
}

.hcs-grid-wrapper .hcs-kpis--1up { grid-template-columns: 1fr; }
.hcs-grid-wrapper .hcs-kpis--2up { grid-template-columns: 1fr 1fr; }
.hcs-grid-wrapper .hcs-kpis--3up { grid-template-columns: repeat(3, 1fr); }

.hcs-grid-wrapper .hcs-kpi {
	text-align: center;
	padding: 0 0.5rem;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
	min-height: 3rem;
}

.hcs-grid-wrapper .hcs-kpi + .hcs-kpi::before {
	content: '';
	position: absolute;
	left: 0;
	top: 18%;
	bottom: 18%;
	width: 1px;
	background: var(--hcs-border-soft);
}

.hcs-grid-wrapper .hcs-kpi-value {
	display: block;
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--hcs-navy);
	letter-spacing: -0.02em;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.hcs-grid-wrapper .hcs-kpi-value--accent {
	color: var(--hcs-cyan-600);
}

.hcs-grid-wrapper .hcs-kpi-label {
	display: block;
	font-size: 0.7rem;
	font-weight: 500;
	color: var(--hcs-text-soft);
	letter-spacing: 0.04em;
	line-height: 1.3;
}

/* When the KPI is label-only (no big value), make it a normal short
   line of body text rather than a tiny grey blip. */
.hcs-grid-wrapper .hcs-kpi:not(:has(.hcs-kpi-value)) .hcs-kpi-label {
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--hcs-navy);
	letter-spacing: 0;
}

/* ===== Card footer (CTA + PDF) ===== */

.hcs-grid-wrapper .hcs-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin-top: auto;
}

.hcs-grid-wrapper .hcs-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: var(--hcs-navy) !important;
	text-decoration: none !important;
	transition: gap 0.2s ease, color 0.2s ease;
	background-image: none !important;
}

.hcs-grid-wrapper .hcs-card-cta:hover {
	gap: 0.7rem;
	color: var(--hcs-cyan-600) !important;
}

.hcs-grid-wrapper .hcs-card-cta-arrow {
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.hcs-grid-wrapper .hcs-card-cta:hover .hcs-card-cta-arrow {
	transform: translateX(2px);
}

.hcs-grid-wrapper .hcs-card-pdf {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--hcs-cyan-bg);
	color: var(--hcs-navy) !important;
	text-decoration: none !important;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
	flex-shrink: 0;
	background-image: none !important;
}

.hcs-grid-wrapper .hcs-card-pdf:hover {
	background: var(--hcs-cyan);
	color: #fff !important;
	transform: translateY(-1px);
}

/* ===== Load more ===== */

.hcs-grid-wrapper .hcs-load-more-wrap {
	display: flex;
	justify-content: center;
	margin: 2.5rem 0 0;
}

.hcs-grid-wrapper .hcs-load-more {
	-webkit-appearance: none;
	appearance: none;
	background: var(--hcs-navy);
	color: #fff;
	border: 0;
	padding: 0.95rem 2rem;
	border-radius: var(--hcs-radius-pill);
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: var(--hcs-shadow-md);
}

.hcs-grid-wrapper .hcs-load-more:hover {
	background: var(--hcs-cyan);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 184, 212, 0.3);
}

.hcs-grid-wrapper .hcs-load-more:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ===== No results ===== */

.hcs-grid-wrapper .hcs-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 1.5rem;
	color: var(--hcs-text-muted);
	font-size: 1rem;
	background: var(--hcs-navy-50);
	border: 1px dashed var(--hcs-border);
	border-radius: var(--hcs-radius);
}

/* =================================================================
   Responsive — tablet, mobile, small mobile
   ================================================================= */

/* ===== Tablet (≤1024px) ===== */
@media (max-width: 1024px) {
	.hcs-grid-wrapper {
		max-width: 100%;
	}

	.hcs-grid-wrapper .hcs-grid {
		gap: 1.25rem !important;
	}

	.hcs-grid-wrapper .hcs-grid[data-hcs-columns="3"],
	.hcs-grid-wrapper .hcs-grid[data-hcs-columns="4"] {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.hcs-grid-wrapper .hcs-card-body {
		padding: 1.25rem;
	}

	.hcs-grid-wrapper .hcs-card-title {
		font-size: 1.2rem;
	}

	.hcs-grid-wrapper .hcs-kpi-value {
		font-size: 1.25rem;
	}
}

/* ===== Mobile (≤640px) — 1 column, compact ===== */
@media (max-width: 640px) {
	.hcs-grid-wrapper .hcs-grid,
	.hcs-grid-wrapper .hcs-grid[data-hcs-columns="1"],
	.hcs-grid-wrapper .hcs-grid[data-hcs-columns="2"],
	.hcs-grid-wrapper .hcs-grid[data-hcs-columns="3"],
	.hcs-grid-wrapper .hcs-grid[data-hcs-columns="4"] {
		grid-template-columns: 1fr !important;
		gap: 1rem !important;
	}

	.hcs-grid-wrapper .hcs-filter-card {
		padding: 1rem;
		border-radius: var(--hcs-radius-sm);
		margin: 0 0 1.5rem;
	}

	.hcs-grid-wrapper .hcs-pill-bar {
		gap: 0.4rem;
	}

	.hcs-grid-wrapper .hcs-pill-bar:not(:last-child) {
		margin: 0 0 0.85rem;
		padding: 0 0 0.85rem;
	}

	.hcs-grid-wrapper .hcs-pill {
		font-size: 0.82rem;
		padding: 0.5rem 0.85rem;
	}

	.hcs-grid-wrapper .hcs-filter-row {
		gap: 0.85rem;
	}

	.hcs-grid-wrapper .hcs-filter-dropdowns {
		gap: 0.5rem;
	}

	.hcs-grid-wrapper .hcs-select-wrap {
		flex: 1 1 calc(50% - 0.25rem);
		min-width: 0;
		max-width: none;
	}

	.hcs-grid-wrapper .hcs-select {
		font-size: 0.88rem;
		padding: 0.65rem 2rem 0.65rem 0.85rem;
	}

	.hcs-grid-wrapper .hcs-filter-actions {
		justify-content: space-between;
		flex: 1 1 100%;
	}

	.hcs-grid-wrapper .hcs-card-image-link {
		aspect-ratio: 16 / 10;
	}

	.hcs-grid-wrapper .hcs-country-chip,
	.hcs-grid-wrapper .hcs-industry-chip {
		font-size: 0.68rem;
		padding: 0.35rem 0.65rem;
	}

	.hcs-grid-wrapper .hcs-country-chip .hcs-flag {
		font-size: 0.95rem;
	}

	.hcs-grid-wrapper .hcs-card-body {
		padding: 1.1rem;
	}

	.hcs-grid-wrapper .hcs-card-title {
		font-size: 1.1rem;
		margin: 0 0 0.6rem;
	}

	.hcs-grid-wrapper .hcs-card-excerpt {
		font-size: 0.9rem;
		margin: 0 0 1rem;
	}

	.hcs-grid-wrapper .hcs-kpis {
		padding: 0.85rem 0;
		margin: 0 0 1rem;
	}

	.hcs-grid-wrapper .hcs-kpi {
		padding: 0 0.4rem;
		min-height: 2.6rem;
	}

	.hcs-grid-wrapper .hcs-kpi-value {
		font-size: 1.15rem;
	}

	.hcs-grid-wrapper .hcs-kpi-label {
		font-size: 0.66rem;
	}

	.hcs-grid-wrapper .hcs-card-cta {
		font-size: 0.88rem;
	}

	.hcs-grid-wrapper .hcs-card-pdf {
		width: 34px;
		height: 34px;
	}

	.hcs-grid-wrapper .hcs-load-more-wrap {
		margin: 2rem 0 0;
	}

	.hcs-grid-wrapper .hcs-load-more {
		padding: 0.85rem 1.6rem;
		font-size: 0.9rem;
	}
}

/* ===== Small mobile (≤400px) ===== */
@media (max-width: 400px) {
	.hcs-grid-wrapper .hcs-pill-bar {
		gap: 0.3rem;
	}

	.hcs-grid-wrapper .hcs-pill {
		font-size: 0.78rem;
		padding: 0.45rem 0.7rem;
	}

	.hcs-grid-wrapper .hcs-select-wrap {
		flex: 1 1 100%;
	}

	.hcs-grid-wrapper .hcs-card:hover {
		transform: none;
	}

	.hcs-grid-wrapper .hcs-kpi-value {
		font-size: 1.05rem;
	}
}

/* =================================================================
   Single-post shortcodes (live OUTSIDE .hcs-grid-wrapper):
   - .hcs-kpi-bar           [hcs_kpi_bar]
   - .hcs-related           [hcs_related_case_studies]
   - .hcs-post-tags         [hcs_post_tags] (with --lines and links)

   These each declare brand vars on themselves so they don't depend
   on being nested inside .hcs-grid-wrapper.
   ================================================================= */

.hcs-kpi-bar,
.hcs-related,
.hcs-post-tags,
.hcs-project-details {
	--hcs-navy:        #0a2540;
	--hcs-navy-700:    #122e4d;
	--hcs-navy-50:     #f3f6fa;
	--hcs-cyan:        #00b8d4;
	--hcs-cyan-600:    #009fb8;
	--hcs-cyan-soft:   #b3e5f5;
	--hcs-cyan-bg:     #ecf7fb;
	--hcs-text:        #0f1f33;
	--hcs-text-muted:  #5a6b7d;
	--hcs-text-soft:   #8898a8;
	--hcs-border:      #e2e8ed;
	--hcs-border-soft: #eef2f5;
	--hcs-shadow-md:   0 6px 24px rgba(10, 37, 64, 0.08);
	--hcs-shadow-lg:   0 24px 60px rgba(10, 37, 64, 0.18);
	--hcs-radius:      20px;
	--hcs-radius-sm:   12px;
	--hcs-radius-pill: 9999px;

	font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
	color: var(--hcs-text);
	box-sizing: border-box;
}

.hcs-kpi-bar *,
.hcs-related *,
.hcs-post-tags *,
.hcs-project-details *,
.hcs-kpi-bar *::before,
.hcs-related *::before,
.hcs-project-details *::before,
.hcs-kpi-bar *::after,
.hcs-related *::after,
.hcs-project-details *::after {
	box-sizing: border-box;
}

/* ===== KPI Bar ===== */

.hcs-kpi-bar {
	display: block;
	background: #fff;
	border: 1px solid var(--hcs-border);
	border-radius: var(--hcs-radius);
	padding: 2rem 2.5rem;
	box-shadow: var(--hcs-shadow-md);
	margin: 0 0 2rem;
}

.hcs-kpi-bar-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hcs-cyan-600);
	margin: 0 0 1.25rem;
}

.hcs-kpi-bar-eyebrow::before {
	content: '';
	width: 6px;
	height: 6px;
	background: var(--hcs-cyan);
	border-radius: 50%;
	box-shadow: 0 0 0 4px rgba(0, 184, 212, 0.18);
	flex-shrink: 0;
}

.hcs-kpi-bar-grid {
	display: grid;
	gap: 0;
}

.hcs-kpi-bar--1up .hcs-kpi-bar-grid { grid-template-columns: 1fr; }
.hcs-kpi-bar--2up .hcs-kpi-bar-grid { grid-template-columns: 1fr 1fr; }
.hcs-kpi-bar--3up .hcs-kpi-bar-grid { grid-template-columns: repeat(3, 1fr); }

.hcs-kpi-bar-item {
	text-align: center;
	padding: 0 1.5rem;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 4rem;
}

.hcs-kpi-bar-item + .hcs-kpi-bar-item::before {
	content: '';
	position: absolute;
	left: 0;
	top: 10%;
	bottom: 10%;
	width: 1px;
	background: var(--hcs-border-soft);
}

.hcs-kpi-bar-value {
	display: block;
	font-size: clamp(2rem, 4.5vw, 3rem);
	font-weight: 800;
	color: var(--hcs-navy);
	letter-spacing: -0.03em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.hcs-kpi-bar-value--accent { color: var(--hcs-cyan-600); }

.hcs-kpi-bar-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--hcs-text-muted);
	letter-spacing: 0.02em;
	line-height: 1.4;
}

/* When a KPI has no big number (just a statement like "No new sea life"),
   the label needs to sit visually between the big value (~3rem) and the
   small caption (~0.85rem) of its numeric siblings — otherwise the cell
   looks empty. We aim for roughly 75% of the value size. */
.hcs-kpi-bar-item--label-only .hcs-kpi-bar-label {
	font-size: clamp(1.5rem, 3.5vw, 2.25rem);
	font-weight: 700;
	color: var(--hcs-navy);
	letter-spacing: -0.015em;
	line-height: 1.2;
	max-width: 100%;
}

@media (max-width: 700px) {
	.hcs-kpi-bar {
		padding: 1.5rem 1.25rem;
	}
	.hcs-kpi-bar--3up .hcs-kpi-bar-grid,
	.hcs-kpi-bar--2up .hcs-kpi-bar-grid {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
	.hcs-kpi-bar-item {
		padding: 0;
		min-height: 0;
	}
	.hcs-kpi-bar-item + .hcs-kpi-bar-item::before {
		top: -0.625rem;
		bottom: auto;
		left: 25%;
		right: 25%;
		width: auto;
		height: 1px;
	}
}

/* ===== Related case studies ===== */

.hcs-related {
	display: block;
	margin: 3rem 0 0;
}

/* Optional title — most users will add their own heading via Divi to match
   the theme. Render plain when present. */
.hcs-related-title {
	font-family: inherit;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--hcs-navy) !important;
	margin: 0 0 1.5rem;
	letter-spacing: -0.015em;
}

/* Footer (CTA) — centred under the grid. Also displayed on its own when
   there are no related cards (i.e. just the "See all case studies" button). */
.hcs-related-footer {
	display: flex;
	justify-content: center;
	margin-top: 2rem;
}

.hcs-related--empty .hcs-related-footer {
	margin-top: 0;
}

.hcs-related-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff !important;
	background: var(--hcs-navy);
	padding: 0.85rem 1.6rem;
	border-radius: var(--hcs-radius-pill);
	text-decoration: none !important;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	background-image: none !important;
	box-shadow: var(--hcs-shadow-md);
}

.hcs-related-cta:hover {
	background: var(--hcs-cyan);
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(0, 184, 212, 0.3);
}

.hcs-related-cta svg {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.hcs-related-cta:hover svg {
	transform: translateX(2px);
}

.hcs-related-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}

@media (max-width: 900px) {
	.hcs-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.hcs-related-grid { grid-template-columns: 1fr; }
}

.hcs-related-card {
	display: flex !important;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--hcs-border);
	border-radius: var(--hcs-radius-sm);
	overflow: hidden;
	text-decoration: none !important;
	color: inherit !important;
	background-image: none !important;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hcs-related-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--hcs-shadow-md);
	border-color: transparent;
}

.hcs-related-image {
	aspect-ratio: 16 / 10;
	/* Soft cyan placeholder, same reasoning as the main grid card. */
	background: linear-gradient(135deg, var(--hcs-cyan-bg) 0%, var(--hcs-cyan-soft) 100%);
	overflow: hidden;
}

.hcs-related-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hcs-related-card:hover .hcs-related-image img {
	transform: scale(1.04);
}

.hcs-related-image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--hcs-cyan-bg) 0%, var(--hcs-cyan-soft) 60%, #d4eef5 100%);
}

.hcs-related-body {
	padding: 1rem 1.25rem 1.15rem;
}

.hcs-related-meta {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--hcs-cyan-600);
	margin: 0 0 0.4rem;
}

.hcs-related-flag {
	font-size: 0.95rem;
	margin-right: 0.25rem;
	letter-spacing: 0;
}

.hcs-related-meta-sep {
	color: var(--hcs-text-soft);
	margin: 0 0.15rem;
}

.hcs-related-card-title {
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	color: var(--hcs-navy) !important;
	line-height: 1.35;
	margin: 0;
	letter-spacing: -0.01em;
}

/* ===== [hcs_post_tags] — both inline and lines variants ===== */

.hcs-post-tags {
	display: inline;
	color: var(--hcs-text);
}

.hcs-post-tags--lines {
	display: block;
}

.hcs-post-tags--lines .hcs-post-tag {
	display: block;
	margin-bottom: 0.25rem;
}

.hcs-post-tags--lines .hcs-post-tag:last-child {
	margin-bottom: 0;
}

/* The tag itself: span (no link) or anchor (link="yes") */
.hcs-post-tag {
	color: inherit;
	text-decoration: none;
}

a.hcs-post-tag {
	color: var(--hcs-navy);
	transition: color 0.18s ease;
	background-image: none !important;
}

a.hcs-post-tag:hover,
a.hcs-post-tag:focus {
	color: var(--hcs-cyan-600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* When [hcs_post_tags] is dropped INTO a dark sidebar (like the Project
   Details box on the single-post template), ensure links stay readable.
   Add the .hcs-on-dark class to the surrounding container if needed. */
.hcs-on-dark a.hcs-post-tag,
.hcs-post-tags.hcs-on-dark a.hcs-post-tag {
	color: #fff;
}

.hcs-on-dark a.hcs-post-tag:hover,
.hcs-post-tags.hcs-on-dark a.hcs-post-tag:hover {
	color: var(--hcs-cyan-soft);
}

/* =================================================================
   [hcs_project_details] — full sidebar panel
   ================================================================= */

.hcs-project-details {
	display: block;
	background: var(--hcs-navy);
	color: #fff;
	border-radius: var(--hcs-radius);
	padding: 1.75rem;
	box-shadow: var(--hcs-shadow-md);
}

.hcs-project-details--sticky {
	position: sticky;
	top: 1.5rem;
	align-self: start;
}

.hcs-project-details-title {
	font-family: inherit;
	font-size: 1.2rem;
	font-weight: 700;
	color: #fff !important;
	margin: 0 0 1.25rem;
	letter-spacing: -0.01em;
}

.hcs-project-details-rows {
	display: flex;
	flex-direction: column;
}

.hcs-project-details-row {
	display: flex;
	gap: 0.85rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hcs-project-details-row:first-child {
	padding-top: 0;
}

.hcs-project-details-row:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.hcs-project-details-icon {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	background: rgba(0, 184, 212, 0.16);
	color: var(--hcs-cyan);
	border-radius: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.hcs-project-details-content {
	min-width: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.hcs-project-details-key {
	display: block;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
}

.hcs-project-details-val {
	display: block;
	font-size: 0.95rem;
	font-weight: 600;
	color: #fff;
	line-height: 1.45;
}

/* Make in-sidebar tag links white (they're already wrapped in
   .hcs-on-dark by the shortcode, but be explicit here too). */
.hcs-project-details a.hcs-post-tag {
	color: #fff !important;
	text-decoration: none;
	background-image: none !important;
}

.hcs-project-details a.hcs-post-tag:hover,
.hcs-project-details a.hcs-post-tag:focus {
	color: var(--hcs-cyan-soft) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Actions: stacked buttons */

.hcs-project-details-actions {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hcs-project-details-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.85rem 1.25rem;
	border-radius: var(--hcs-radius-pill);
	font-family: inherit;
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none !important;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
	background-image: none !important;
	line-height: 1.2;
	border: 1px solid transparent;
	text-align: center;
}

.hcs-project-details-btn--primary {
	background: var(--hcs-cyan);
	color: #fff !important;
	border-color: var(--hcs-cyan);
}

.hcs-project-details-btn--primary:hover {
	background: #00d6f2;
	border-color: #00d6f2;
	transform: translateY(-1px);
}

.hcs-project-details-btn--secondary {
	background: transparent;
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.25);
}

.hcs-project-details-btn--secondary:hover {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.4);
}

.hcs-project-details-btn svg {
	flex-shrink: 0;
}

/* Mobile: tighter padding, slightly smaller icon */
@media (max-width: 640px) {
	.hcs-project-details {
		padding: 1.25rem;
		border-radius: var(--hcs-radius-sm);
	}

	.hcs-project-details-title {
		font-size: 1.1rem;
		margin: 0 0 1rem;
	}

	.hcs-project-details-icon {
		width: 32px;
		height: 32px;
	}

	.hcs-project-details-icon svg {
		width: 16px;
		height: 16px;
	}

	.hcs-project-details-row {
		padding: 0.75rem 0;
		gap: 0.75rem;
	}

	.hcs-project-details-val {
		font-size: 0.9rem;
	}

	.hcs-project-details-btn {
		padding: 0.8rem 1rem;
		font-size: 0.88rem;
	}

	/* Don't keep this sticky on phones — leaves no room for the actual content. */
	.hcs-project-details--sticky {
		position: static;
	}
}
