/* Hover Reveal Grid for Elementor */

.hpg-grid {
	--hpg-speed: 400ms;
	--hpg-ring-gap: 12px;
	--hpg-lines: 6;

	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	width: 100%;
	box-sizing: border-box;
}

.hpg-grid *,
.hpg-grid *::before,
.hpg-grid *::after {
	box-sizing: border-box;
}

/* ---------- Card ---------- */
.hpg-card {
	position: relative;
	min-width: 0;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background-color: #1b2430;
	isolation: isolate;
	outline: none;
}

.hpg-card:focus-visible {
	box-shadow: inset 0 0 0 3px #fff;
}

.hpg-media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.hpg-grid .hpg-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 50%;
	transform: scale(1);
	transition: transform calc(var(--hpg-speed) * 2) ease;
}

.hpg-zoom .hpg-card:hover .hpg-img,
.hpg-zoom .hpg-card.is-active .hpg-img {
	transform: scale(1.07);
}

/* ---------- Overlay (hidden until hover) ---------- */
.hpg-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	padding: 40px;
	background-color: rgba(27, 20, 120, 0.86);
	opacity: 0;
	visibility: hidden;
	transition:
		opacity var(--hpg-speed) ease,
		visibility 0s linear var(--hpg-speed);
}

.hpg-card:hover .hpg-overlay,
.hpg-card:focus-within .hpg-overlay,
.hpg-card.is-active .hpg-overlay {
	opacity: 1;
	visibility: visible;
	transition:
		opacity var(--hpg-speed) ease,
		visibility 0s;
}

/* ---------- Text ---------- */
.hpg-text {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
	transform: translateY(18px);
	transition: transform var(--hpg-speed) ease 0.05s;
}

.hpg-card:hover .hpg-text,
.hpg-card:focus-within .hpg-text,
.hpg-card.is-active .hpg-text {
	transform: translateY(0);
}

.hpg-text > .hpg-title,
.hpg-text > .hpg-cats,
.hpg-text > .hpg-lines {
	flex: 0 0 auto;
}

.hpg-grid .hpg-title {
	margin: 0;
	padding: 0;
	color: #fff;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
}

.hpg-cats {
	margin-top: 10px;
	color: rgba(255, 255, 255, 0.6);
	font-size: 15px;
	font-style: italic;
	line-height: 1.4;
}

.hpg-cats .hpg-sep {
	margin: 0 0.35em;
	color: #fff;
	font-style: normal;
}

.hpg-lines {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 20px;
}

.hpg-line {
	display: block;
	height: 2px;
	background-color: #fff;
}

.hpg-line-1 {
	width: 64px;
}

.hpg-line-2 {
	width: 28px;
}

/* Description: scrolls inside the card when it is too long */
.hpg-desc-wrap {
	flex: 1 1 auto;
	min-height: 3em;
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.6) rgba(255, 255, 255, 0.12);
	-webkit-overflow-scrolling: touch;
}

@supports not (scrollbar-width: thin) {
	.hpg-desc-wrap::-webkit-scrollbar {
		width: 6px;
	}

	.hpg-desc-wrap::-webkit-scrollbar-track {
		background: rgba(255, 255, 255, 0.12);
		border-radius: 3px;
	}

	.hpg-desc-wrap::-webkit-scrollbar-thumb {
		background: rgba(255, 255, 255, 0.6);
		border-radius: 3px;
	}
}

/* Soft fade at the bottom while there is more text to read */
.hpg-desc-wrap.is-scrollable:not(.at-end) {
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent 100%);
	mask-image: linear-gradient(to bottom, #000 calc(100% - 34px), transparent 100%);
}

.hpg-grid .hpg-desc {
	margin: 0;
	color: #fff;
	font-size: 15px;
	line-height: 1.7;
}

/* "Cut off" mode: no scrolling, long text ends with ... */
.hpg-cut .hpg-desc-wrap {
	overflow: hidden;
	scrollbar-gutter: auto;
}

.hpg-cut .hpg-desc {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--hpg-lines);
	line-clamp: var(--hpg-lines);
}

/* ---------- Round + button ---------- */
.hpg-plusbox {
	flex: 0 0 auto;
	margin-top: 12px;
	padding: var(--hpg-ring-gap);
}

.hpg-grid .hpg-plus {
	display: inline-block;
	text-decoration: none;
	line-height: 0;
	outline: none;
}

.hpg-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background-color: #fff;
	color: #14105f;
	outline: 1px solid rgba(255, 255, 255, 0.55);
	outline-offset: var(--hpg-ring-gap);
	transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.hpg-plus:hover .hpg-circle,
.hpg-plus:focus-visible .hpg-circle {
	background-color: #d00000;
	color: #fff;
	transform: rotate(90deg);
}

.hpg-plus-icon {
	display: block;
	width: 16px;
	height: 16px;
}

/* ---------- Tablet / phone ---------- */
@media (max-width: 1024px) {
	.hpg-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.hpg-grid {
		grid-template-columns: repeat(1, minmax(0, 1fr));
	}

	.hpg-overlay {
		padding: 22px;
	}

	.hpg-lines {
		margin: 12px 0 14px;
	}

	.hpg-plusbox {
		margin-top: 4px;
	}
}

/* ---------- Display styles (chosen separately for computers, tablets and phones) ---------- */
/* computers */
@media (min-width: 1025px) {
	/* Text first: text shows, the photo appears on hover (or tap) */
	.hpg-d-text .hpg-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity var(--hpg-speed) ease, visibility 0s;
	}

	.hpg-d-text .hpg-text {
		transform: none;
	}

	.hpg-d-text .hpg-card.is-active .hpg-overlay {
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--hpg-speed) ease, visibility 0s linear var(--hpg-speed);
	}

	.hpg-d-text .hpg-desc-wrap {
		overflow: hidden;
		scrollbar-gutter: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}

	/* Text always: text stays, no hover effect */
	.hpg-d-static .hpg-overlay {
		opacity: 1;
		visibility: visible;
	}

	.hpg-d-static .hpg-text {
		transform: none;
	}

	/* Text always, card grows to fit the text */
	.hpg-fit.hpg-d-static .hpg-card {
		display: flex;
		flex-direction: column;
		min-height: var(--hpg-fit-min, 300px);
		aspect-ratio: auto !important;
	}

	.hpg-fit.hpg-d-static .hpg-overlay {
		position: relative;
		inset: auto;
		flex: 1 1 auto;
	}

	.hpg-fit.hpg-d-static .hpg-text {
		flex: 1 1 auto;
		min-height: auto;
		overflow: visible;
	}

	.hpg-fit.hpg-d-static .hpg-desc-wrap {
		flex: 0 0 auto;
		min-height: 0;
		overflow: visible;
		scrollbar-gutter: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}
}

@media (min-width: 1025px) and (hover: hover) {
	.hpg-d-text .hpg-card:hover .hpg-overlay {
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--hpg-speed) ease, visibility 0s linear var(--hpg-speed);
	}
}

/* tablets */
@media (min-width: 768px) and (max-width: 1024px) {
	/* Text first: text shows, the photo appears on hover (or tap) */
	.hpg-t-text .hpg-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity var(--hpg-speed) ease, visibility 0s;
	}

	.hpg-t-text .hpg-text {
		transform: none;
	}

	.hpg-t-text .hpg-card.is-active .hpg-overlay {
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--hpg-speed) ease, visibility 0s linear var(--hpg-speed);
	}

	.hpg-t-text .hpg-desc-wrap {
		overflow: hidden;
		scrollbar-gutter: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}

	/* Text always: text stays, no hover effect */
	.hpg-t-static .hpg-overlay {
		opacity: 1;
		visibility: visible;
	}

	.hpg-t-static .hpg-text {
		transform: none;
	}

	/* Text always, card grows to fit the text */
	.hpg-fit.hpg-t-static .hpg-card {
		display: flex;
		flex-direction: column;
		min-height: var(--hpg-fit-min, 300px);
		aspect-ratio: auto !important;
	}

	.hpg-fit.hpg-t-static .hpg-overlay {
		position: relative;
		inset: auto;
		flex: 1 1 auto;
	}

	.hpg-fit.hpg-t-static .hpg-text {
		flex: 1 1 auto;
		min-height: auto;
		overflow: visible;
	}

	.hpg-fit.hpg-t-static .hpg-desc-wrap {
		flex: 0 0 auto;
		min-height: 0;
		overflow: visible;
		scrollbar-gutter: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}
}

@media (min-width: 768px) and (max-width: 1024px) and (hover: hover) {
	.hpg-t-text .hpg-card:hover .hpg-overlay {
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--hpg-speed) ease, visibility 0s linear var(--hpg-speed);
	}
}

/* phones */
@media (max-width: 767px) {
	/* Text first: text shows, the photo appears on hover (or tap) */
	.hpg-m-text .hpg-overlay {
		opacity: 1;
		visibility: visible;
		transition: opacity var(--hpg-speed) ease, visibility 0s;
	}

	.hpg-m-text .hpg-text {
		transform: none;
	}

	.hpg-m-text .hpg-card.is-active .hpg-overlay {
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--hpg-speed) ease, visibility 0s linear var(--hpg-speed);
	}

	.hpg-m-text .hpg-desc-wrap {
		overflow: hidden;
		scrollbar-gutter: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}

	/* Text always: text stays, no hover effect */
	.hpg-m-static .hpg-overlay {
		opacity: 1;
		visibility: visible;
	}

	.hpg-m-static .hpg-text {
		transform: none;
	}

	/* Text always, card grows to fit the text */
	.hpg-fit.hpg-m-static .hpg-card {
		display: flex;
		flex-direction: column;
		min-height: var(--hpg-fit-min, 300px);
		aspect-ratio: auto !important;
	}

	.hpg-fit.hpg-m-static .hpg-overlay {
		position: relative;
		inset: auto;
		flex: 1 1 auto;
	}

	.hpg-fit.hpg-m-static .hpg-text {
		flex: 1 1 auto;
		min-height: auto;
		overflow: visible;
	}

	.hpg-fit.hpg-m-static .hpg-desc-wrap {
		flex: 0 0 auto;
		min-height: 0;
		overflow: visible;
		scrollbar-gutter: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}
}

@media (max-width: 767px) and (hover: hover) {
	.hpg-m-text .hpg-card:hover .hpg-overlay {
		opacity: 0;
		visibility: hidden;
		transition: opacity var(--hpg-speed) ease, visibility 0s linear var(--hpg-speed);
	}
}

/* ---------- Editor hint ---------- */
.hpg-empty {
	padding: 24px;
	border: 1px dashed #999;
	background: #f6f6f6;
	color: #444;
	font-size: 14px;
	text-align: center;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.hpg-grid .hpg-img,
	.hpg-overlay,
	.hpg-text,
	.hpg-circle {
		transition-duration: 0.01ms !important;
		transition-delay: 0s !important;
	}
}
