/* ============================================================================
   nqc/horse-program  (+ nqc/horse-card, which has no stylesheet of its own)
   Source: Claude Design/homepage.html L358–412
   Canvas: top 4411.42px, height 829.69px

   The card row is 1320px wide (4 x 312 + 3 x 24) — deliberately WIDER than the
   1200px content rail used elsewhere on the page. That bleed is preserved.
   ============================================================================ */

.nqc-horse {
	position: relative;
	background: var(--nqc-navy);       /* L360 */
	padding: 65px 0 89px;              /* L361 */
	display: flex;
	flex-direction: column;
	gap: 32px;
	align-items: center;
	overflow: hidden;
	isolation: isolate;
}

/*
   The texture MULTIPLIES over navy (L363–367). Without the blend the band
   turns muddy and the cream heading loses contrast.
*/
.nqc-horse__texture {
	position: absolute;
	inset: 0;
	z-index: 0;
	mix-blend-mode: multiply;
	pointer-events: none;
}

.nqc-horse__texture-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- header --------------------------------------------------------------- */
.nqc-horse__head {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	padding-inline: 40px;              /* L369 */
	display: flex;
	flex-direction: column;
	gap: 24px;
	justify-content: center;
	align-items: center;
	text-align: center;
}

.nqc-horse__kicker { margin: 0; }

.nqc-horse__heading {
	margin: 0;
	font: 600 56px/55px var(--nqc-serif);
	color: var(--nqc-cream-2);         /* L374 — stays cream, thanks to multiply */
	text-align: center;
	white-space: nowrap;
}

.nqc-horse__orn {
	--nqc-orn-w: 70px;                 /* L378 */
	min-height: 15.69px;               /* L377 — explicit box in the comp */
}

/* ---- card row ------------------------------------------------------------- */
/*
   1320px = 4 x 312 + 3 x 24 exactly (L379–383), so the rail carries no side
   padding — adding any would shrink the cards below their 312px (measured 276px
   with the 72px gutter applied on both sides).
*/
.nqc-horse__cards {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1320px;                 /* L380 — the bleed past the 1200 rail */
	margin-inline: auto;
	display: flex;
	flex-direction: row;
	gap: 24px;                         /* L381 */
	justify-content: center;
	align-items: flex-start;
}

/* ---- one card ------------------------------------------------------------- */
.nqc-horse-card {
	position: relative;
	height: 500px;                     /* L383 — real height, so the img fills */
	flex: 1 1 312px;
	max-width: 312px;
	min-width: 0;
	margin: 0;
	overflow: hidden;
}

.nqc-horse-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nqc-horse-card__scrim {
	position: absolute;
	left: 0;
	right: 0;
	top: 13.89px;                      /* L389 */
	height: 486px;
	background: linear-gradient(180deg,
		rgba(18, 24, 34, 0) 30%,
		rgba(18, 24, 34, .4) 62%,
		rgba(15, 20, 29, .82) 100%);   /* L390 */
	transition: opacity .5s ease;
}

.nqc-horse-card__ring {
	position: absolute;
	inset: 14px;                       /* L392 */
	box-shadow: inset 0 0 0 1px rgba(233, 220, 192, .32);
	pointer-events: none;
}

.nqc-horse-card__text {
	position: absolute;
	left: 30px;                        /* L394 */
	right: 20.5px;                     /* 312 - 30 - 261.5 */
	bottom: 28px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	transition: transform .5s var(--nqc-ease);
}

.nqc-horse-card__heading {
	margin: 0;
	font: 600 28px/32px var(--nqc-serif);
	color: var(--nqc-card-ink);        /* L397 */
	align-self: stretch;
}

.nqc-horse-card__bar {
	width: 58px;                       /* default expanded — collapsed only where hover exists */
	height: 2px;
	background: var(--nqc-gold);
	flex: none;
	margin-top: 12px;
	transition: width .55s var(--nqc-ease);
}

.nqc-horse-card__body {
	margin: 12px 0 0;
	font: 400 16px/24px var(--nqc-sans);
	color: var(--nqc-card-ink);        /* L404 */
	align-self: stretch;
}

/* ============================================================================
   Hover reveal — ONLY where a real pointer exists.

   The comp collapses the copy to max-height: 0 until :hover (L403–408). On a
   touch device :hover never fires, which would hide roughly 160 words of real
   content from every phone visitor. So the collapse is scoped to fine pointers;
   everywhere else the card renders expanded.
   ============================================================================ */
@media (hover: hover) and (pointer: fine) {
	.nqc-horse-card__bar { width: 0; }

	.nqc-horse-card__body {
		max-height: 0;
		opacity: 0;
		margin-top: 0;
		overflow: hidden;
		transition:
			max-height .6s var(--nqc-ease),
			opacity .45s ease .1s,
			margin-top .6s var(--nqc-ease);
	}

	.nqc-horse-card:hover .nqc-horse-card__bar,
	.nqc-horse-card:focus-within .nqc-horse-card__bar { width: 58px; }

	/*
	   260, not the comp's 200. The cap is only the end state of the reveal
	   animation, not a limit on the copy: on touch, where the collapse never
	   applies, these bodies already render at their full height. The client's
	   "New Trails, New Views Every Day" card measures 240px, so 200 hid its
	   last two lines on desktop only. The card is a fixed 500px and this text
	   is anchored to its bottom, so the tallest of the four still clears the
	   card top by 128px — nothing on the page moves.
	*/
	.nqc-horse-card:hover .nqc-horse-card__body,
	.nqc-horse-card:focus-within .nqc-horse-card__body {
		max-height: 260px;
		opacity: 1;
		margin-top: 12px;
	}

	.nqc-horse-card:hover .nqc-horse-card__scrim { opacity: .9; }

	.nqc-horse-card:hover .nqc-horse-card__text,
	.nqc-horse-card:focus-within .nqc-horse-card__text { transform: translateY(-6px); }
}

/* ============================================================================
   Editor — the image picker replaces the bare image element, so it needs the same
   absolute fill the frontend image gets.
   ============================================================================ */
.editor-styles-wrapper .nqc-horse-card__pick {
	position: absolute;
	inset: 0;
	z-index: 0;
	height: 100%;
}

/* ============================================================================
   Responsive
   ============================================================================ */
/* The 1320px rail stops fitting once the viewport drops below it + a margin. */
@media (max-width: 1400px) {
	.nqc-horse__cards { padding-inline: var(--nqc-gutter); }

	.nqc-horse-card { flex: 1 1 0; max-width: none; }

    .nqc-horse__cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 1200px) {
	.nqc-horse__heading { font-size: 46px; line-height: 50px; }

	.nqc-horse-card { height: 440px; }

	.nqc-horse-card__heading { font-size: 25px; line-height: 29px; }
}

@media (max-width: 900px) {
	.nqc-horse { padding: 56px 0 64px; }

	.nqc-horse__head { padding-inline: 0; }

	.nqc-horse__heading { font-size: 36px; line-height: 40px; }

	/* Two up. Cards grow taller because the copy is now always visible. */
	.nqc-horse__cards {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}

	.nqc-horse-card {
		max-width: none;
		height: auto;
		min-height: 420px;
	}

	/* With auto height the text can no longer be absolutely pinned. */
	.nqc-horse-card__text {
		position: relative;
		left: auto;
		right: auto;
		bottom: auto;
		padding: 220px 22px 24px;
	}

	.nqc-horse-card__scrim {
		top: 0;
		height: 100%;
		background: linear-gradient(180deg,
			rgba(18, 24, 34, 0) 18%,
			rgba(18, 24, 34, .55) 48%,
			rgba(15, 20, 29, .9) 100%);
	}
}

@media (max-width: 600px) {
	.nqc-horse { padding: 44px 0 52px; }

	.nqc-horse__heading { font-size: 30px; line-height: 34px; white-space: normal; }
	.nqc-horse__orn     { --nqc-orn-w: 44px; }

	.nqc-horse__cards {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	.nqc-horse-card { min-height: 380px; }

	.nqc-horse-card__text { padding: 190px 20px 22px; }

	.nqc-horse-card__heading { font-size: 23px; line-height: 27px; }

	.nqc-horse-card__body { font-size: 15px; line-height: 23px; }
}
