/**
 * Goxom Blog widget.
 *
 * Colour and type resolve through component tokens declared on `.goxom-bl`,
 * each pointing at a theme global first (--color-primary, --color-black,
 * --font-title â€¦) with a literal fallback for the Elementor editor, where the
 * theme stylesheet is not always loaded.
 *
 * Cards are never left invisible: the "hide first" rule is scoped to
 * `.goxom-bl--js`, which the JS adds only once it knows GSAP is available, and
 * the GSAP-less path gets `.goxom-bl--css` keyframes instead.
 */

.goxom-bl {
	/* Brand */
	--bl-primary: var(--color-primary, #1273C4);
	--bl-primary-dark: var(--color-primary-dark, #0B5596);

	/* Ink */
	--bl-title: var(--color-black, #0C2338);
	--bl-body: var(--color-body, #5A7387);
	--bl-white: var(--color-white, #ffffff);

	/* Surface */
	--bl-card: var(--color-white, #ffffff);
	--bl-tint: var(--color-tint, #F0F6FC);
	--bl-line: var(--color-border, #D5E3EF);

	/* Type */
	--bl-font-title: var(--font-title, inherit);
	--bl-font-body: var(--font-body, inherit);

	/* Shape */
	--bl-radius: 16px;
	--bl-ease: cubic-bezier(.22, .61, .36, 1);

	position: relative;
	font-family: var(--bl-font-body);
}

.goxom-bl__inner {
	position: relative;
	max-width: 1320px;
	margin-inline: auto;
}

/* ================================================================== heading */

.goxom-bl__head {
	margin-bottom: 52px;
	text-align: center;
}

.goxom-bl__subtitle {
	display: block;
	margin-bottom: 12px;
	font-family: var(--bl-font-title);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--bl-primary);
}

.goxom-bl__title {
	margin: 0;
	font-family: var(--bl-font-title);
	font-size: clamp(30px, 4vw, 52px);
	line-height: 1.14;
	font-weight: 700;
	color: var(--bl-title);
}

/* Word masking for the default title animation â€” the JS injects these, so with
   no JS the heading stays plain text. */
.goxom-bl__title .goxom-bl__w {
	display: inline-block;
	overflow: hidden;
	vertical-align: top;
}

.goxom-bl__title .goxom-bl__w > span,
.goxom-bl__title .goxom-bl__char {
	display: inline-block;
	will-change: transform, opacity;
}

/* ================================================================== layouts */

.goxom-bl__grid {
	--goxom-bl-cols: 3;
	display: grid;
	grid-template-columns: repeat(var(--goxom-bl-cols), minmax(0, 1fr));
	gap: 30px;
}

/* Feature on the left, a stack of rows on the right. The feature is given the
   larger share because its artwork is doing the work; the rows only need
   enough width for two lines of title. */
.goxom-bl__split {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 30px;
	align-items: start;
}

.goxom-bl__list {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* ==================================================================== cards */

.goxom-bl__card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: var(--bl-radius);
	background-color: var(--bl-card);
	transition: transform .45s var(--bl-ease), box-shadow .45s var(--bl-ease),
	            border-color .45s var(--bl-ease);
}

.goxom-bl--lift .goxom-bl__card:hover,
.goxom-bl--lift .goxom-bl__card.is-hold,
.goxom-bl--lift .goxom-bl__card:focus-within {
	transform: translateY(-8px);
	box-shadow: 0 28px 48px -26px color-mix(in srgb, var(--bl-title) 45%, transparent);
}

/* A row is horizontal and has no artwork to hide behind, so it gets a hairline
   instead of a shadow â€” a lifted row with a drop shadow reads as a card that
   has come loose from the list. */
.goxom-bl__card--row {
	flex-direction: row;
	align-items: center;
	gap: 16px;
	border-color: var(--bl-line);
}

.goxom-bl--lift .goxom-bl__card--row:hover,
.goxom-bl--lift .goxom-bl__card--row:focus-within {
	transform: none;
	box-shadow: none;
	border-color: var(--bl-primary);
	background-color: color-mix(in srgb, var(--bl-primary) 5%, var(--bl-card));
}

/* ---------------------------------------------------------------- artwork */

.goxom-bl__media {
	position: relative;
	overflow: hidden;
	flex: 0 0 auto;
	aspect-ratio: 1.5;
	background-color: var(--bl-tint);
}

.goxom-bl__card--row .goxom-bl__media {
	width: 104px;
	aspect-ratio: 1;
	border-radius: calc(var(--bl-radius) - 4px);
	margin: 10px 0 10px 10px;
}

.goxom-bl__media-link {
	display: block;
	width: 100%;
	height: 100%;
}

/* The parent class is in this selector to win a specificity fight, not for
   readability: Elementor ships `.elementor img { height: auto }` at (0,1,1),
   which outranks a lone `.goxom-bl__img` at (0,1,0). And `height: auto` is not
   harmless â€” an absolutely positioned *replaced* element resolves it to the
   image's intrinsic height and ignores `bottom`, so the photo renders at its
   natural size and leaves a strip of card showing underneath. */
.goxom-bl__media .goxom-bl__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s var(--bl-ease);
}

.goxom-bl__card:hover .goxom-bl__img,
.goxom-bl__card:focus-within .goxom-bl__img {
	transform: scale(1.06);
}

.goxom-bl__img--empty {
	background-image: linear-gradient(
		135deg,
		color-mix(in srgb, var(--bl-primary) 18%, transparent),
		color-mix(in srgb, var(--bl-title) 12%, transparent)
	);
}

/* ------------------------------------------------------------- date chip */

.goxom-bl__date--chip {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 54px;
	padding: 8px 10px;
	border-radius: 12px;
	background-color: var(--bl-white);
	color: var(--bl-title);
	line-height: 1.1;
	text-align: center;
	box-shadow: 0 12px 24px -14px color-mix(in srgb, var(--bl-title) 60%, transparent);
}

.goxom-bl__date-day {
	font-family: var(--bl-font-title);
	font-size: 20px;
	font-weight: 800;
}

.goxom-bl__date-month {
	margin-top: 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--bl-primary);
}

/* ------------------------------------------------------------------- body */

/* Flex column with the footer pushed down, so footers line up across a row of
   cards even when one title wraps and another does not. */
.goxom-bl__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding: 22px;
}

.goxom-bl__card--row .goxom-bl__body {
	padding: 14px 16px 14px 4px;
}

.goxom-bl__cat {
	align-self: flex-start;
	margin-bottom: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background-color: color-mix(in srgb, var(--bl-primary) 12%, transparent);
	color: var(--bl-primary);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color .3s ease, color .3s ease;
}

.goxom-bl__cat:hover,
.goxom-bl__cat:focus-visible {
	background-color: var(--bl-primary);
	color: var(--bl-white);
}

.goxom-bl__card--row .goxom-bl__cat {
	margin-bottom: 8px;
	padding: 3px 9px;
	font-size: 11px;
}

.goxom-bl__name {
	margin: 0;
	font-family: var(--bl-font-title);
	font-size: 21px;
	font-weight: 700;
	line-height: 1.32;
	color: var(--bl-title);
}

.goxom-bl__card--feature .goxom-bl__name {
	font-size: clamp(23px, 2.2vw, 30px);
}

.goxom-bl__card--row .goxom-bl__name {
	font-size: 16px;
	line-height: 1.4;
}

.goxom-bl__name a {
	color: inherit;
	text-decoration: none;
	transition: color .3s ease;
}

/* No underline on hover: on a two-line title it reads as a stray rule rather
   than as a link cue, and the colour shift already carries the state. */
.goxom-bl__card:hover .goxom-bl__name a,
.goxom-bl__name a:focus-visible {
	color: var(--bl-primary);
}

.goxom-bl__name a:focus-visible {
	outline: 2px solid var(--bl-primary);
	outline-offset: 3px;
	border-radius: 3px;
}

.goxom-bl__excerpt {
	margin: 12px 0 0;
	font-size: 15px;
	line-height: 1.65;
	color: var(--bl-body);
}

/* ----------------------------------------------------------------- footer */

.goxom-bl__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px 16px;
	/* Pinned to the bottom of the card, not to the end of the excerpt. */
	margin-top: auto;
	padding-top: 18px;
}

.goxom-bl__card--row .goxom-bl__foot {
	padding-top: 10px;
}

.goxom-bl__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--bl-body);
}

.goxom-bl__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

/* Fixed box, and flex-shrink pinned to 0: in a wrapping flex row a shrinkable
   icon gets squeezed narrower than its viewBox and the circle draws as an arc. */
.goxom-bl__meta .goxom-bl__meta-item svg {
	display: block;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	min-width: 16px;
	opacity: .8;
}

.goxom-bl__meta .goxom-bl__avatar {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	min-width: 22px;
	border-radius: 50%;
	object-fit: cover;
}

.goxom-bl__more {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	color: var(--bl-primary);
	transition: gap .35s var(--bl-ease), color .3s ease;
}

.goxom-bl__more svg {
	display: block;
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	transition: transform .35s var(--bl-ease);
}

.goxom-bl__card:hover .goxom-bl__more svg,
.goxom-bl__card:focus-within .goxom-bl__more svg {
	transform: translateX(4px);
}

/* =========================================================== section button */

.goxom-bl__foot-row {
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

.goxom-bl__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 32px;
	border-radius: 999px;
	background-color: var(--bl-primary);
	color: var(--bl-white);
	font-family: var(--bl-font-body);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	transition: transform .3s ease, background-color .3s ease, box-shadow .3s ease;
}

.goxom-bl__btn:hover,
.goxom-bl__btn:focus-visible {
	color: var(--bl-white);
	background-color: var(--bl-primary-dark);
	transform: translateY(-2px);
	box-shadow: 0 18px 34px -16px color-mix(in srgb, var(--bl-primary-dark) 85%, transparent);
}

.goxom-bl__btn svg {
	transition: transform .3s ease;
}

.goxom-bl__btn:hover svg {
	transform: translateX(4px);
}

/* ================================================================== notices */

.goxom-bl__notice {
	padding: 22px;
	border: 1px dashed color-mix(in srgb, var(--bl-title) 35%, transparent);
	border-radius: 12px;
	text-align: center;
	color: var(--bl-title);
	background-color: color-mix(in srgb, var(--bl-primary) 7%, transparent);
}

/* ================================================================== reveals */

/* Only hide cards once JS has confirmed it will animate them. */
.goxom-bl--js[data-reveal="rise"] .goxom-bl__card,
.goxom-bl--js[data-reveal="wipe"] .goxom-bl__card,
.goxom-bl--js[data-reveal="scale"] .goxom-bl__card,
.goxom-bl--js[data-reveal="fade"] .goxom-bl__card {
	opacity: 0;
}

/* GSAP-less fallback: the same reveals as keyframes, staggered by nth-child so
   the grid still arrives in a wave. */
.goxom-bl--css[data-reveal] .goxom-bl__card {
	animation: goxom-bl-rise .7s var(--bl-ease) both;
}

.goxom-bl--css[data-reveal="scale"] .goxom-bl__card { animation-name: goxom-bl-scale; }
.goxom-bl--css[data-reveal="fade"] .goxom-bl__card  { animation-name: goxom-bl-fade; }
.goxom-bl--css[data-reveal="wipe"] .goxom-bl__card  { animation-name: goxom-bl-wipe; }

.goxom-bl--css[data-reveal=""] .goxom-bl__card {
	animation: none;
	opacity: 1;
}

.goxom-bl--css .goxom-bl__card:nth-child(2)   { animation-delay: .08s; }
.goxom-bl--css .goxom-bl__card:nth-child(3)   { animation-delay: .16s; }
.goxom-bl--css .goxom-bl__card:nth-child(4)   { animation-delay: .24s; }
.goxom-bl--css .goxom-bl__card:nth-child(5)   { animation-delay: .32s; }
.goxom-bl--css .goxom-bl__card:nth-child(n+6) { animation-delay: .40s; }

@keyframes goxom-bl-rise {
	from { opacity: 0; transform: translateY(38px); }
	to   { opacity: 1; transform: none; }
}

@keyframes goxom-bl-scale {
	from { opacity: 0; transform: scale(.92); }
	to   { opacity: 1; transform: none; }
}

@keyframes goxom-bl-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes goxom-bl-wipe {
	from { opacity: 0; clip-path: inset(0 0 100% 0); }
	to   { opacity: 1; clip-path: inset(0 0 0 0); }
}

.goxom-bl--css[data-title-anim] .goxom-bl__title {
	animation: goxom-bl-rise .8s var(--bl-ease) both;
}

/* =============================================================== breakpoints */

@media (max-width: 1024px) {
	.goxom-bl__grid {
		--goxom-bl-cols: 2;
	}

	/* Side by side below this width the rows lose the space their titles need,
	   so the feature takes the full width and the list runs underneath. */
	.goxom-bl__split {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 767px) {
	.goxom-bl__grid {
		--goxom-bl-cols: 1;
		gap: 22px;
	}

	.goxom-bl__body {
		padding: 18px;
	}

	.goxom-bl__card--row .goxom-bl__media {
		width: 84px;
	}

	.goxom-bl__foot-row {
		margin-top: 32px;
	}
}

/* A 104px thumbnail beside two lines of title is tight on a small phone, and
   the row reads better stacked than cramped. */
@media (max-width: 400px) {
	.goxom-bl__card--row {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.goxom-bl__card--row .goxom-bl__media {
		width: auto;
		aspect-ratio: 2;
		margin: 10px 10px 0;
	}

	.goxom-bl__card--row .goxom-bl__body {
		padding: 14px 16px 16px;
	}
}

/* color-mix is recent enough that a couple of shipping browsers still miss it;
   without these the category pill and the shadows render transparent. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
	.goxom-bl__cat {
		background-color: rgba(14, 159, 110, .12);
	}

	.goxom-bl--lift .goxom-bl__card:hover {
		box-shadow: 0 28px 48px -26px rgba(12, 35, 56, .45);
	}

	.goxom-bl--lift .goxom-bl__card--row:hover {
		background-color: rgba(14, 159, 110, .05);
	}

	.goxom-bl__date--chip {
		box-shadow: 0 12px 24px -14px rgba(12, 35, 56, .6);
	}

	.goxom-bl__img--empty {
		background-image: linear-gradient(135deg, rgba(14, 159, 110, .18), rgba(12, 35, 56, .12));
	}

	.goxom-bl__notice {
		border-color: rgba(12, 35, 56, .35);
		background-color: rgba(14, 159, 110, .07);
	}
}

@media (prefers-reduced-motion: reduce) {
	.goxom-bl__card,
	.goxom-bl__img,
	.goxom-bl__more,
	.goxom-bl__more svg,
	.goxom-bl__btn,
	.goxom-bl__btn svg,
	.goxom-bl__cat,
	.goxom-bl__name a {
		transition: none !important;
	}

	.goxom-bl--css[data-reveal] .goxom-bl__card,
	.goxom-bl--css[data-title-anim] .goxom-bl__title,
	.goxom-bl--js[data-reveal] .goxom-bl__card {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
		clip-path: none !important;
	}
}
