/*
 * Customer Stories — listing grid + card styles.
 *
 * Container width (1376px) and the meta-row typography (uppercase,
 * letter-spacing, #58595B) reuse the exact values already established by
 * assets/css/blog/blog-listing.css / assets/css/case-study/case-study-details.css
 * for the same "category • read time" pattern — this card's own shell
 * (660x610, #F7F8FA, 24px radius) is new since no existing card matches
 * that spec, but everything reused from elsewhere is called out below.
 *
 * Only enqueued on the Customer Stories page template (see inc/enqueue.php).
 *
 * @package Greenova
 */

.customer-stories-listing {
	background-color: #FFFFFF;
	padding-block:     100px;
}

.customer-stories-listing .container {
	max-width: 1376px;
}

.customer-stories-listing__grid {
	display:               grid;
	grid-template-columns: repeat(2, 1fr);
	column-gap:            32px;
	row-gap:               32px;
}

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

.customer-story-card {
	display:         flex;
	flex-direction:  column;
	width:           100%;
	max-width:       660px;
	/*
	 * No fixed height — now that the stat/customer blocks use fixed margins
	 * instead of margin-top:auto (which used to stretch to fill a hardcoded
	 * 610px box), a hardcoded height would just leave real, visible dead
	 * space below content that's naturally shorter than that. Height is
	 * content-driven instead; equal heights across a row still hold because
	 * .customer-stories-listing__grid never overrides the grid default of
	 * align-items:stretch, which matches every card in a row to the
	 * tallest one's natural content height.
	 */
	background:      #F7F8FA;
	border-radius:   24px;
	padding:         24px;
	box-sizing:      border-box;
	text-decoration: none;
	color:           inherit;
	overflow:        hidden;
	transition:      box-shadow 0.25s ease, transform 0.25s ease;
}

.customer-story-card:hover,
.customer-story-card:focus {
	/* Explicit — without this, the sitewide base `a:hover{text-decoration:
	   underline}` rule (style.css) wins on specificity/source-order and
	   underlines every piece of text inside the card, since the whole card
	   is itself the <a>. */
	text-decoration: none;
	box-shadow:      0 12px 32px rgba(0, 0, 0, 0.08);
	transform:       translateY(-4px);
}

/* Only cards with a configured testimonial (see the template's
   $greenova_csl_show_hover check) get the tinted hover background — a
   card with nothing to swap to just keeps its plain lift/shadow hover. */
.customer-story-card--has-hover:hover {
	background-color: #F2F9FF;
}

/* =============================================================================
   Header — logo + company name (left), Read Story (right)
   ============================================================================= */

.customer-story-card__header {
	display:         flex;
	align-items:     center;
	justify-content: space-between;
	gap:             16px;
}

.customer-story-card__brand {
	display:     flex;
	align-items: center;
	gap:         10px;
	min-width:   0;
}

.customer-story-card__logo {
	flex-shrink: 0;
	width:       28px;
	height:      28px;
	object-fit:  contain;
	display:     block;
}

.customer-story-card__company {
	font-family:    'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:      16px;
	font-weight:    600;
	color:          #000000;
	white-space:    nowrap;
	overflow:       hidden;
	text-overflow:  ellipsis;
}

.customer-story-card__read-story {
	display:        inline-flex;
	align-items:    center;
	gap:            6px;
	flex-shrink:    0;
	font-family:    'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:      13px;
	font-weight:    600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color:          #30AEE4;
	transition:     color 0.2s ease;
}

.customer-story-card__read-story svg {
	flex-shrink: 0;
	transition:  transform 0.2s ease;
}

.customer-story-card:hover .customer-story-card__read-story {
	color: #219FD6;
}

.customer-story-card:hover .customer-story-card__read-story svg {
	transform: translate(2px, -2px);
}

/* =============================================================================
   Divider — same solid-line treatment as .pricing-plans__card's border
   ============================================================================= */

.customer-story-card__divider {
	border:     none;
	border-top: 1px solid #B6B9CE;
	margin:     16px 0;
}

/* =============================================================================
   Body — stacks .customer-story-card__default and .customer-story-card__hover
   in the SAME grid cell (grid-area:1/1) so they can crossfade in place
   without ever changing the card's own size — only one is ever
   interactive/visible at a time, controlled purely by opacity/pointer-events
   below. Scoped to real hover-capable pointers (mouse/trackpad) so touch
   devices — which have no reliable hover state to leave — just show the
   default content permanently instead of risking a stuck overlay.
   ============================================================================= */

.customer-story-card__body {
	position: relative;
	flex:     1 1 auto;
	display:  grid;
}

.customer-story-card__default {
	grid-area:      1 / 1;
	display:        flex;
	flex-direction: column;
	min-width:      0;
	min-height:     0;
}

/* No (hover:hover) support (touch devices): the overlay markup exists but
   never shows — same plain default-content card, and it can't get "stuck"
   mid-transition since there's no hover state to trigger it from. This MUST
   come BEFORE the @media(hover:hover) block below: media conditions don't
   add specificity, so with an identical selector, whichever rule is LAST in
   source order wins on a hover-capable browser too — this needs to be the
   one that gets overridden, not the one doing the overriding. */
.customer-story-card__hover {
	display: none;
}

@media ( hover: hover ) and ( pointer: fine ) {
	.customer-story-card__hover {
		grid-area:  1 / 1;
		min-width:  0;
		min-height: 0;
		display:         flex;
		flex-direction:  column;
		justify-content: center; /* Centers the quote+customer cluster as a group within the card's available height — the gaps between them stay the fixed values below either way. */
		opacity:        0;
		pointer-events: none;
		transition:     opacity 0.3s ease;
	}

	.customer-story-card__default {
		transition: opacity 0.3s ease;
	}

	.customer-story-card--has-hover:hover .customer-story-card__hover {
		opacity:        1;
		pointer-events: auto;
	}

	.customer-story-card--has-hover:hover .customer-story-card__default {
		opacity: 0;
	}
}

/* =============================================================================
   Testimonial overlay content — a plain top-packed column with fixed
   margins between each piece (NOT space-between/flex-grow/height:100%),
   so it reads its own natural content height instead of stretching or
   getting shoved to the bottom of the available space. The shared
   .customer-story-card__divider above this (16px margin either side,
   unchanged — same element the default state uses) supplies the first
   16px of the divider->quote-icon gap; the icon's own margin-top makes up
   the rest, reaching the spec's 32px total without touching that shared
   divider (which the default card also depends on).
   ============================================================================= */

.customer-story-card__quote-icon {
	display:       inline-flex;
	margin-top:    16px; /* 16 (shared divider gap) + 16 here = 32px divider -> icon, per spec. */
	margin-bottom: 24px; /* Quote icon -> testimonial, per spec. */
}

.customer-story-card__quote-icon img {
	width:   58px;
	height:  43px;
	display: block;
}

.customer-story-card__quote {
	font-family:    'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:      18px;
	font-weight:    400;
	line-height:    24px;
	letter-spacing: -0.48px;
	color:          #000000;
	max-width:      500px;
	margin:         0;
}

.customer-story-card__customer {
	display:     flex;
	align-items: center;
	gap:         12px;
	margin-top:  36px; /* Testimonial -> customer info, per spec — fixed, NOT auto (that was what pushed this to the card's bottom edge). */
}

.customer-story-card__customer-photo {
	flex-shrink:   0;
	width:         55px;
	height:        55px;
	border-radius: 50%;
	object-fit:    cover;
	display:       block;
}

.customer-story-card__customer-info {
	display:        flex;
	flex-direction: column;
	gap:            2px;
	min-width:      0;
	justify-content: center;
}

.customer-story-card__customer-name {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:   22px;
	font-weight: 400;
	line-height: 20.8px;
	color:       #000000;
}

.customer-story-card__customer-role {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:   14px;
	font-weight: 400;
	line-height: 20.8px;
	color:       #58595B;
}

/* =============================================================================
   Industry • Reading time — reuses .blog-listing__meta-row's own values
   ============================================================================= */

.customer-story-card__meta {
	display:        flex;
	align-items:    center;
	gap:            8px;
	font-family:    'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:      13px;
	font-weight:    500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color:          #58595B;
	margin-bottom:  12px;
}

.customer-story-card__meta-sep {
	color: #58595B;
}

/* =============================================================================
   Description — 2-line clamp
   ============================================================================= */

.customer-story-card__excerpt {
	font-family:            'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:              16px;
	font-weight:            600;
	line-height:            24px;
	color:                  #000000;
	margin:                 0 0 16px;
	display:                -webkit-box;
	-webkit-box-orient:     vertical;
	-webkit-line-clamp:     2;
	overflow:               hidden;
}

/* =============================================================================
   Featured image
   ============================================================================= */

.customer-story-card__media {
	width:         100%;
	height:        260px;
	border-radius: 18px;
	overflow:      hidden;
	margin-bottom: 16px;
}

.customer-story-card__image {
	display:    block;
	width:      100%;
	height:     100%;
	object-fit: cover;
}

/* =============================================================================
   Statistic
   ============================================================================= */

.customer-story-card__stat {
	display:        flex;
	flex-direction: column;
	gap:            4px;
	margin-top:     16px; /* Fixed, not auto — auto was stretching to fill the card's leftover height instead of sitting a small fixed distance below the image. */
}

.customer-story-card__stat-value {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:   32px;
	font-weight: 600;
	line-height: 1.1;
	color:       #000000;
}

.customer-story-card__stat-label {
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size:   14px;
	font-weight: 400;
	color:       #58595B;
}

/* =============================================================================
   Responsive
   ============================================================================= */

@media ( max-width: 1439.98px ) {
	.customer-story-card {
		max-width: none;
	}
}

@media ( max-width: 1199.98px ) {
	.customer-stories-listing {
		padding-block: 80px;
	}

	.customer-stories-listing__grid {
		column-gap: 24px;
		row-gap:    24px;
	}

	.customer-story-card__media {
		height: 220px;
	}
}

@media ( max-width: 767.98px ) {
	.customer-stories-listing {
		padding-block: 56px;
	}

	.customer-stories-listing__grid {
		grid-template-columns: 1fr;
	}

	.customer-story-card {
		padding: 20px;
	}

	.customer-story-card__media {
		height: 200px;
	}

	.customer-story-card__stat-value {
		font-size: 28px;
	}
}
