/**
 * Voyage archive & destination inspiration cards
 *
 * @package HilaireExperiences
 */

.he-archive-grid,
.he-voyage-card {
	--he-true-navy: var(--hilaire-blue, #0a1e3c);
}

.he-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
	gap: 50px;
	margin-top: 4rem;
	margin-bottom: 4rem;
}

/* Neutralise cards.css [class*="card-"] bleed on he-card-* descendants */
.he-archive-grid .he-voyage-card,
.he-archive-grid .he-voyage-card [class*="he-card-"]:not(.he-card-front):not(.he-card-back):not(.he-card-content-wrapper):not(.he-card-content-inner):not(.he-card-meta-refined) {
	border: none !important;
	box-shadow: none;
	transform: none;
	background: transparent;
}

.he-voyage-card {
	display: flex;
	flex-direction: column;
	border-radius: 12px;
	overflow: hidden;
	background: var(--he-true-navy, #1b3a4b);
	text-decoration: none;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
	transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.he-voyage-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 15px 35px rgba(27, 58, 75, 0.1);
}

.he-card-front div,
.he-card-front p,
.he-card-front span:not(.he-meta-badge):not(.he-meta-budget):not(.he-meta-included-toggle) {
	border: none !important;
	background: transparent !important;
	margin: 0;
	padding: 0;
}

.he-card-media-wrapper {
	position: relative;
	height: 280px;
	overflow: hidden;
	border-radius: 8px 8px 0 0;
}

.he-card-layer {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	transition: opacity 0.5s ease;
}

.he-layer-image {
	background-size: cover;
	background-position: center;
	z-index: 2;
	opacity: 1;
}

.he-layer-image--placeholder {
	background-color: #e8e4df;
}

.he-layer-map {
	z-index: 1;
	opacity: 0;
	background: #f4f4f4;
}

.he-card-media-wrapper.show-map .he-layer-image {
	opacity: 0;
	pointer-events: none;
}

.he-card-media-wrapper.show-map .he-layer-map {
	z-index: 3;
	opacity: 1;
}

.he-mini-map {
	width: 100%;
	height: 100%;
}

.he-map-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-body, "Inter", sans-serif);
	font-size: 13px;
	color: #777;
}

.he-card-tag {
	position: absolute;
	top: 15px;
	left: 15px;
	background-color: var(--he-true-navy, #1b3a4b) !important;
	color: #ffffff !important;
	padding: 6px 12px;
	font-size: 11px;
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 1px;
	border-radius: 0;
	z-index: 4;
	font-family: var(--font-body, "Inter", sans-serif);
}

.he-map-toggle-btn {
	position: absolute;
	bottom: 15px;
	right: 15px;
	background: rgba(27, 58, 75, 0.8);
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	cursor: pointer;
	z-index: 4;
	transition: background 0.3s ease;
	padding: 0;
}

.he-map-toggle-btn svg {
	width: 18px;
	height: 18px;
}

.he-map-toggle-btn:hover,
.he-map-toggle-btn[aria-pressed="true"] {
	background: #d3c0a3;
	color: var(--he-true-navy);
}

.he-card-content-wrapper {
	perspective: 1000px;
	display: flex;
	flex-grow: 1;
	min-height: 220px;
}

.he-card-content-inner {
	position: relative;
	width: 100%;
	min-height: 220px;
	transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	transform-style: preserve-3d;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.he-card-content-inner.is-flipped {
	transform: rotateY(180deg);
}

.he-card-front,
.he-card-back {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	width: 100%;
	display: flex;
	flex-direction: column;
	background-color: var(--he-true-navy, #1b3a4b);
	padding: 20px 25px;
	flex-grow: 1;
	color: #ffffff;
}

.he-card-front {
	text-decoration: none;
}

.he-card-back {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	transform: rotateY(180deg);
	justify-content: center;
	align-items: center;
	text-align: center;
}

.he-card-title {
	font-family: var(--font-heading, "Cormorant Garamond", serif);
	font-weight: 700;
	font-size: 26px;
	margin: 0 0 10px;
	color: #ffffff;
	letter-spacing: 0.5px;
	line-height: 1.25;
}

.he-card-etapes {
	font-family: var(--font-body, "Inter", sans-serif);
	font-size: 15px;
	color: rgba(255, 255, 255, 0.8);
	line-height: 1.5;
	margin-bottom: 20px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.he-card-meta-refined {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-family: var(--font-body, "Inter", sans-serif);
	font-size: 13px;
	color: rgba(255, 255, 255, 0.7);
	border-top: 1px solid rgba(255, 255, 255, 0.2);
	padding-top: 15px;
}

.he-meta-badge,
.he-meta-budget {
	color: #ffffff;
}

.he-meta-badge {
	font-weight: 600;
	letter-spacing: 0.5px;
}

.he-meta-budget {
	font-weight: 700;
	font-size: 14px;
	margin-top: 2px;
}

.he-meta-season strong {
	font-weight: 600;
	color: #ffffff;
}

.he-meta-included-toggle,
.he-meta-included-close {
	cursor: pointer;
	color: #ffffff;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-top: auto;
	padding-top: 15px;
	border-top: 1px dashed rgba(255, 255, 255, 0.3);
	display: block;
	text-align: left;
	font-family: var(--font-body, "Inter", sans-serif);
	background: transparent;
	border-left: none;
	border-right: none;
	border-bottom: none;
}

.he-meta-included-close {
	text-align: center;
	border-top: none;
	margin-top: 20px;
	padding-top: 0;
	opacity: 0.8;
}

.he-meta-included-toggle u,
.he-meta-included-close u {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.he-back-title {
	color: #fff;
	font-family: var(--font-heading, "Cormorant Garamond", serif);
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 15px;
}

.he-back-text {
	color: rgba(255, 255, 255, 0.8);
	font-family: var(--font-body, "Inter", sans-serif);
	font-size: 13px;
	line-height: 1.6;
	margin: 0;
	max-width: 90%;
}

.he-btn-solid-small {
	background: #fff;
	color: var(--he-true-navy, #1b3a4b);
	padding: 8px 20px;
	font-size: 11px;
	text-transform: uppercase;
	font-weight: 700;
	text-decoration: none;
	border-radius: 2px;
	margin-top: 15px;
	font-family: var(--font-body, "Inter", sans-serif);
	letter-spacing: 0.5px;
	transition: background 0.3s ease, color 0.3s ease;
}

.he-btn-solid-small:hover {
	background: #d3c0a3;
	color: var(--he-true-navy, #1b3a4b);
}

@media (max-width: 768px) {
	.he-archive-grid {
		grid-template-columns: 1fr;
		gap: 32px;
		margin-top: 2.5rem;
	}

	.he-card-media-wrapper {
		height: 320px;
	}

	.he-card-title {
		font-size: 22px;
	}
}

@media (min-width: 1200px) {
	.he-archive-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.he-card-content-inner {
		transition: none;
	}
}
