/* -----------------------------------------------------------------------
   Where To Go Next card

   Built from stock Beaver Builder modules so it can be saved as a BB
   Component: the structure is locked, the photo, heading and button text
   stay editable per instance.

   Expected structure, classes set in each module's Advanced > Class:

     Box      .wyohs-next            (optionally .wyohs-next--lime / --cream)
       Photo    .wyohs-next__media
       Heading  .wyohs-next__head
       Button   .wyohs-next__btn

   Selectors are deliberately over-specified. Beaver Builder generates its
   own rules at .fl-builder-content .fl-node-XXXX .fl-button, which is two
   classes and an element; anything lighter than that loses.
   ----------------------------------------------------------------------- */

.wyohs-next {
	--next-accent: var(--wyohs-sand, #d2a56c);
	--next-scrim-top: .10;
	--next-scrim-mid: .62;
	--next-scrim-bottom: .94;

	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	align-items: flex-start;
	aspect-ratio: 4 / 5;
	padding: 30px 28px;
	background-color: var(--wyohs-navy, #1b3a5c);
	box-shadow: 0 2px 0 rgba(26, 26, 26, .10);
}

/* Accent variants ------------------------------------------------------ */

.wyohs-next--lime  { --next-accent: var(--wyohs-lime, #e2ecb2); }
.wyohs-next--cream { --next-accent: var(--wyohs-cream, #fff8e7); }

/* The photo ------------------------------------------------------------ */

.wyohs-next .wyohs-next__media {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
	padding: 0;
}

.wyohs-next .wyohs-next__media .fl-photo-content,
.wyohs-next .wyohs-next__media .fl-photo-img-wrap {
	height: 100%;
	width: 100%;
	margin: 0;
	display: block;
}

.wyohs-next .wyohs-next__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .6s cubic-bezier(.2, .7, .3, 1);
}

/* The scrim. Light at the top so the photo survives, near solid at the
   bottom so the type never has to fight it. */

/* Over-specified on purpose. The theme hangs a clearfix ::before/::after on
   every .fl-module, so a plain .wyohs-next::after loses and the scrim never
   paints. The ::before has to go too: on a flex card it becomes a flex item
   and eats a share of the gap. */

.fl-builder-content .wyohs-next.fl-module::before {
	display: none;
}

.fl-builder-content .wyohs-next.fl-module::after {
	content: '';
	display: block;
	clear: none;
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		180deg,
		rgba(27, 58, 92, var(--next-scrim-top)) 0%,
		rgba(27, 58, 92, var(--next-scrim-mid)) 52%,
		rgba(27, 58, 92, var(--next-scrim-bottom)) 100%
	);
}

/* Heading -------------------------------------------------------------- */

.wyohs-next .wyohs-next__head {
	position: relative;
	z-index: 2;
	margin: 0 0 22px;
}

.fl-builder-content .wyohs-next .wyohs-next__head,
.fl-builder-content .wyohs-next .wyohs-next__head .fl-heading-text {
	font-family: var(--wyohs-serif, 'Young Serif', Georgia, serif);
	font-weight: 400;
	font-size: 30px;
	line-height: 1.14;
	letter-spacing: normal;
	text-transform: none;
	color: var(--wyohs-cream, #fff8e7);
	margin: 0;
}

/* Button --------------------------------------------------------------- */

.wyohs-next .wyohs-next__btn {
	position: relative;
	z-index: 2;
	margin: 0;
}

.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button,
.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button:visited {
	position: static;            /* so the stretched hit area below resolves
	                                against the card, not the button */
	display: inline-block;
	background: transparent;
	border: 1.5px solid var(--next-accent);
	border-radius: 0;
	padding: 11px 18px 10px;
	box-shadow: none;
	transition: background-color .18s ease;
}

.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button *,
.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button .fl-button-text {
	font-family: var(--wyohs-display, 'Special Gothic Condensed One', 'Arial Narrow', sans-serif);
	font-size: 16px;
	line-height: 1.3;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--next-accent);
	transition: color .18s ease;
}

/* The trailing mark is drawn here rather than typed into the button text,
   so every card carries the same one and an editor only types the words. */

.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button .fl-button-text::after {
	content: ' ›';
}

/* The whole card is the link. One focus stop, one very large target. */

.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 3;
}

/* Hover and focus ------------------------------------------------------ */

.wyohs-next:hover .wyohs-next__media img {
	transform: scale(1.045);
}

.fl-builder-content .wyohs-next:hover .wyohs-next__btn a.fl-button {
	background: var(--next-accent);
}

.fl-builder-content .wyohs-next:hover .wyohs-next__btn a.fl-button *,
.fl-builder-content .wyohs-next:hover .wyohs-next__btn a.fl-button .fl-button-text {
	color: var(--wyohs-navy, #1b3a5c);
}

.wyohs-next:focus-within {
	outline: 3px solid var(--wyohs-green, #4e9553);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

	.wyohs-next .wyohs-next__media img,
	.fl-builder-content .wyohs-next .wyohs-next__btn a.fl-button {
		transition: none;
	}

	.wyohs-next:hover .wyohs-next__media img {
		transform: none;
	}
}

/* Small screens -------------------------------------------------------- */

@media (max-width: 767px) {

	.wyohs-next {
		aspect-ratio: 3 / 2;
		padding: 26px 22px;
	}

	.fl-builder-content .wyohs-next .wyohs-next__head,
	.fl-builder-content .wyohs-next .wyohs-next__head .fl-heading-text {
		font-size: 26px;
	}

	.wyohs-next .wyohs-next__head {
		margin-bottom: 18px;
	}
}
