/**
 * Case Studies page -- page-scoped stylesheet.
 *
 * Loaded only by page-templates/template-case-studies.php (via a
 * <link> that template prints itself), matching the same per-page-CSS
 * convention as about.css / contact.css / insights.css / s4hana-*.css.
 *
 * Deliberately does NOT include a closing contact-form CTA section --
 * this page ends straight into the footer, by explicit request.
 *
 * @package sap-migration-theme
 */

/* Manual <br>s (via sapmig_text_with_breaks()) only apply above tablet,
   same rule as every other page-scoped stylesheet in this theme.
   Class corrected to what WordPress actually renders for this template
   (confirmed directly against the live <body> class): body_class()
   turns page-templates/template-case-studies.php into
   "page-template-template-case-studies" -- "template" appears
   twice, once from WordPress's own "page-template-" prefix and once
   because the file itself is named template-case-studies.php. The
   old single-"template" selector below never matched anything, so
   manual breaks were silently never hidden on tablet/mobile here. */
.page-template-template-case-studies .home-break {
	display: inline;
}

@media (max-width: 1024px) {
	.page-template-template-case-studies .home-break {
		display: none;
	}
}

/* ==========================================================================
   Hero -- same pattern as the Contact/Insights pages' heroes: pulled up
   behind the floating sticky header, optional uploaded background image
   at 0.85 opacity, or a soft radial-gradient backdrop when none is set.
   ========================================================================== */

.case-studies-hero {
	position: relative;
	overflow: hidden;
	padding: 220px var(--header-padding-x) 130px;
	text-align: center;
	background:
		radial-gradient(circle at 50% 0%, rgba(1, 174, 240, 0.14) 0%, rgba(1, 174, 240, 0) 60%),
		radial-gradient(circle at 50% 20%, #eef4fb 0%, #ffffff 70%);
	margin-top: -96px;
}

.case-studies-hero.case-studies-hero--has-bg {
	background: #ffffff;
}

@media (max-width: 1024px) {
	.case-studies-hero {
		padding: 170px var(--header-padding-x-tablet) 84px;
	}
}

@media (max-width: 640px) {
	.case-studies-hero {
		margin-top: -88px;
		padding: 140px var(--header-padding-x-mobile) 60px;
	}
}

.case-studies-hero__bg-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	opacity: 0.85;
}

/* Padding lives on .case-studies-hero itself (see above), not here -- bundling
   both max-width and padding onto __inner would eat into the 1280px
   content width at every viewport instead of only narrow ones. Matches
   the same section/__inner split used on Home/About/Contact. */
.case-studies-hero__inner {
	position: relative;
	max-width: var(--header-max-width);
	margin-inline: auto;
	text-align: center;
}

.case-studies-hero__heading {
	margin: 0 0 16px;
	font-family: 'Geist', sans-serif;
	font-weight: 700;
	font-size: 52px;
	line-height: 1.2;
	letter-spacing: -1px;
	color: var(--color-heading);
}

/* Exact gradient text-clip values from klouddata.com's own live
   "Case Studies" section (assets/css/page-agentforce.css, .af-accent) --
   ported directly rather than approximated. */
.case-studies-hero__heading strong {
	font-weight: 700;
	background: linear-gradient(90deg, #004195 0%, #01aef0 85.58%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.case-studies-hero__subheading {
	margin: 0;
	font-size: 18px;
	line-height: 28px;
	color: var(--color-body-text);
}

@media (max-width: 1024px) {
	.case-studies-hero__heading {
		font-size: 40px;
		line-height: 1.25;
		letter-spacing: -0.5px;
	}
}

@media (max-width: 640px) {
	.case-studies-hero__heading {
		font-size: 40px;
		line-height: 1.25;
		letter-spacing: 0;
	}

	.case-studies-hero__subheading {
		font-size: 15px;
	}
}

/* ==========================================================================
   Filter bar
   ========================================================================== */

.case-grid {
	background-color: #fff;
	padding: 48px var(--header-padding-x) 96px;
}

@media (max-width: 1024px) {
	.case-grid {
		padding: 32px var(--header-padding-x-tablet) 64px;
	}
}

@media (max-width: 640px) {
	.case-grid {
		padding: 24px var(--header-padding-x-mobile) 48px;
	}
}

/* Padding lives on .case-grid itself (see above), not here -- same
   section/__inner split as the hero above and Home/About/Contact. */
.case-grid__inner {
	max-width: var(--header-max-width);
	margin-inline: auto;
}

.case-grid__toggle-filter {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 24px;
	padding: 14px 24px;
	border: 1px solid var(--color-btn-outline-border);
	border-radius: 999px;
	background: #fff;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: var(--gradient-btn-start);
	cursor: pointer;
	box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.04);
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.case-grid__toggle-filter:hover,
.case-grid__toggle-filter:focus-visible {
	border-color: var(--gradient-btn-start);
	background-color: #f2f8ff;
}

.case-grid__toggle-filter svg {
	width: 18px;
	height: 18px;
}

/* The bar itself is the shared .live-search component (main.css), so the
   form is just a spacing wrapper now. */
.case-grid__filters {
	margin: 0 0 40px;
}

.case-grid__filters-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
}

.case-grid__filters-label {
	flex-shrink: 0;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: var(--color-heading);
}

.case-grid__field {
	flex: 0 1 220px;
}

.case-grid__field select {
	display: block;
	width: 100%;
	height: 52px;
	padding: 0 40px 0 18px;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	font-weight: 500;
	color: var(--color-heading);
	background-color: #fff;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	appearance: none;
	border: 1px solid var(--color-btn-outline-border);
	border-radius: 10px;
	box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-grid__field select:focus {
	outline: none;
	border-color: var(--gradient-btn-start);
	box-shadow: 0 0 0 3px rgba(11, 77, 162, 0.12);
}

.case-grid__search {
	flex: 1 1 280px;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 52px;
	padding: 0 18px;
	background-color: #fff;
	border: 1px solid var(--color-btn-outline-border);
	border-radius: 10px;
	box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-grid__search:focus-within {
	border-color: var(--gradient-btn-start);
	box-shadow: 0 0 0 3px rgba(11, 77, 162, 0.12);
}

.case-grid__search svg {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	color: var(--color-eyebrow);
}

.case-grid__search input {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: none;
	background: none;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	color: var(--color-heading);
}

.case-grid__search input:focus {
	outline: none;
}

.case-grid__search input::placeholder {
	color: #94a3b8;
}

.case-grid__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 10px;
	background: linear-gradient(94.23deg, #004195 0%, #01aef0 100%);
	color: #fff;
	cursor: pointer;
	box-shadow: 0px 4px 12px 0px rgba(0, 65, 149, 0.25);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.case-grid__submit:hover,
.case-grid__submit:focus-visible {
	opacity: 0.92;
	transform: translateY(-1px);
}

.case-grid__submit svg {
	width: 20px;
	height: 20px;
}

.case-grid__count {
	margin: 20px 0 0;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	color: var(--color-body-text);
}

.case-grid__count strong {
	color: var(--color-heading);
}

@media (max-width: 640px) {
	.case-grid__filters-row {
		flex-direction: column;
		align-items: stretch;
	}

	.case-grid__field,
	.case-grid__search {
		flex: 1 1 auto;
	}
}

/* ==========================================================================
   Grid -- full-bleed dark-overlay photo cards
   ========================================================================== */

.case-grid__empty {
	margin: 0;
	padding: 48px 0;
	text-align: center;
	font-size: 16px;
	color: var(--color-body-text);
}

.case-grid__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

/* Matches the reference's own breakpoint exactly: straight to 1 column
   at 1024px, no intermediate 2-column tablet step (the cards' fixed
   420px min-height needs the room). */
@media (max-width: 1024px) {
	.case-grid__grid {
		grid-template-columns: 1fr;
	}
}

/* This whole card component's sizing/colors are ported directly from
   klouddata.com's own live "Case Studies" section
   (assets/css/page-agentforce.css, .af-stories-*), not approximated --
   see [[case-studies-page]] in project memory for where each value
   came from. */

.case-grid__card {
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.06);
}

.case-grid__card-link {
	position: relative;
	display: block;
	min-height: 420px;
	text-decoration: none;
	background-color: #0b1733;
}

.case-grid__card-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.case-grid__card-image--placeholder {
	display: block;
	background: linear-gradient(145deg, #0b1733 0%, #1b3b6f 100%);
}

.case-grid__card-scrim {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(11, 23, 51, 0.25) 0%, rgba(11, 23, 51, 0.55) 40%, rgba(11, 23, 51, 0.98) 100%);
}

.case-grid__card-content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	padding: 24px;
}

.case-grid__card-badge {
	align-self: flex-start;
	margin-bottom: -8px;
	padding: 5px 12px;
	border-radius: 999px;
	background-color: rgba(255, 255, 255, 0.16);
	backdrop-filter: blur(4px);
	font-family: 'Geist', sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: #fff;
}

.case-grid__card-title {
	font-family: 'Geist', sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.35;
	color: #fff;
}

/* Outline pill, not a filled/blurred background -- the reference's own
   "Read More" treatment: a light border on the dark scrim, with just
   the arrow itself sitting in a solid white circle. */
.case-grid__card-cta {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 10px;
	padding: 10px 10px 10px 18px;
	border: 1.5px solid rgba(255, 255, 255, 0.8);
	border-radius: 999px;
	font-family: 'Geist', sans-serif;
	font-size: 13.5px;
	font-weight: 700;
	color: #fff;
}

.case-grid__card-cta-icon {
	display: inline-flex;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background-color: #fff;
	color: #0b1733;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
}

.case-grid__card-cta-icon svg {
	width: 14px;
	height: 14px;
}

.case-grid__card:hover .case-grid__card-cta-icon,
.case-grid__card:focus-within .case-grid__card-cta-icon {
	transform: translateX(2px);
}

.case-grid__load-more {
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

.case-grid__load-more-btn {
	display: inline-flex;
	align-items: center;
	padding: 14px 32px;
	border: 1px solid var(--color-btn-outline-border);
	border-radius: 999px;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	font-weight: 700;
	color: var(--gradient-btn-start);
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.case-grid__load-more-btn:hover,
.case-grid__load-more-btn:focus-visible {
	border-color: var(--gradient-btn-start);
	background-color: #f2f8ff;
}
