/* =========================================================
   COMPONENT: HOMEPAGE — FEATURED ITINERARIES
   Editorial 4-card grid. Mobile-first. Pixel-matched to UI.

   Class namespace: .home-fi  (Home Featured Itineraries)
   ========================================================= */

.home-fi {
	/* Scoped design tokens — isolated from the rest of the page so this
	   component is portable and won't be affected by global overrides. */
	--fi-primary:        #0f3a37;
	--fi-primary-deep:   #0a2826;
	--fi-primary-soft:   #134e4a;
	--fi-accent:         #eab308;
	--fi-accent-dark:    #8B6914;
	--fi-accent-soft:    #f3c733;
	--fi-bg:             #f8f8f4;
	--fi-card-bg:        #ffffff;
	--fi-text:           #1d1d1f;
	--fi-text-muted:     #6b6b70;
	--fi-divider:        #ececdf;
	--fi-divider-light:  #f0eee5;

	--fi-radius-card:    20px;
	--fi-radius-pill:    999px;
	--fi-radius-cta:     12px;
	--fi-shadow-card:    0 6px 24px rgba(15, 58, 55, 0.06), 0 2px 6px rgba(15, 58, 55, 0.04);
	--fi-shadow-card-h:  0 14px 36px rgba(15, 58, 55, 0.12), 0 4px 10px rgba(15, 58, 55, 0.06);
	--fi-ease:           cubic-bezier(0.16, 1, 0.3, 1);

	--fi-font-sans:      'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--fi-font-serif:     "Playfair Display", Georgia, "Times New Roman", serif;
	--fi-font-script:    "Caveat", "Brush Script MT", cursive;

	position: relative;
	isolation: isolate;
	background: var(--fi-bg);
	padding: clamp(48px, 7vw, 100px) 0 clamp(48px, 6vw, 90px);
	font-family: var(--fi-font-sans);
	color: var(--fi-text);
	overflow: hidden;
}

.home-fi *,
.home-fi *::before,
.home-fi *::after {
	box-sizing: border-box;
}

.home-fi__container {
	max-width: 1320px;
	margin: 0 auto;
	padding: 0 20px;
	position: relative;
	z-index: 1;
}

/* ─────────────────────────────────────────────────────────
   DECORATIVE LEAF BACKGROUNDS (left + right edges)
   Hidden on small screens to avoid clutter.
   ───────────────────────────────────────────────────────── */

.home-fi__leaf-bg {
	position: absolute;
	top: 12%;
	width: 200px;
	height: 300px;
	color: var(--fi-primary);
	opacity: 0.07;
	pointer-events: none;
	z-index: 0;
	display: none;
}
.home-fi__leaf-bg svg {
	width: 100%;
	height: 100%;
}
.home-fi__leaf-bg--left  { left: -30px; }
.home-fi__leaf-bg--right { right: -30px; }

@media (min-width: 1024px) {
	.home-fi__leaf-bg { display: block; }
}

/* =========================================================
   HEADER
   ========================================================= */

.home-fi__head {
	text-align: center;
	max-width: 720px;
	margin: 0 auto clamp(36px, 4vw, 56px);
}

.home-fi__eyebrow {
	font-family: var(--fi-font-script);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.6rem, 2.6vw, 2.2rem);
	line-height: 1;
	color: var(--fi-accent-dark);
	margin: 0 0 10px;
	letter-spacing: 0.5px;
}

.home-fi__heading {
	font-family: var(--fi-font-serif);
	font-weight: 700;
	font-size: clamp(2rem, 5.4vw, 4rem);
	line-height: 1.05;
	color: var(--fi-primary);
	margin: 0 0 16px;
	letter-spacing: -0.01em;
}

.home-fi__desc {
	font-family: var(--fi-font-sans);
	font-weight: 400;
	font-size: clamp(0.95rem, 1.3vw, 1.0625rem);
	line-height: 1.65;
	color: var(--fi-text-muted);
	margin: 0 auto 22px;
	max-width: 640px;
}

/* Divider — gold lines + leaf */
.home-fi__divider {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 8px auto 0;
	color: var(--fi-accent-dark);
}
.home-fi__divider-line {
	display: block;
	width: 70px;
	height: 1.5px;
	background: var(--fi-accent-dark);
	opacity: 0.85;
}
.home-fi__divider-leaf {
	flex-shrink: 0;
}

/* =========================================================
   CARD GRID
   Mobile-first: 1 column → 2 cols at 640px → 4 cols at 1024px
   ========================================================= */

.home-fi__grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(20px, 2vw, 28px);
}

.home-fi__item {
	display: flex; /* lets the inner card stretch to equal heights */
}

@media (min-width: 640px) {
	.home-fi__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.home-fi__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* =========================================================
   CARD
   ========================================================= */

.home-fi-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--fi-card-bg);
	border-radius: var(--fi-radius-card);
	overflow: hidden;
	box-shadow: var(--fi-shadow-card);
	transition:
		transform 0.4s var(--fi-ease),
		box-shadow 0.4s var(--fi-ease);
}

.home-fi-card:hover,
.home-fi-card:focus-within {
	transform: translateY(-4px);
	box-shadow: var(--fi-shadow-card-h);
}

/* ─────────── IMAGE AREA ─────────── */

.home-fi-card__image-link {
	display: block;
	position: relative;
	text-decoration: none;
	color: inherit;
}

.home-fi-card__image-wrap {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #eef0e9;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 4 / 3) {
	.home-fi-card__image-wrap::before {
		content: "";
		display: block;
		padding-top: 75%; /* 4:3 */
	}
	.home-fi-card__image-wrap > img,
	.home-fi-card__image-wrap > picture {
		position: absolute;
		inset: 0;
	}
}

.home-fi-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--fi-ease);
}

.home-fi-card:hover .home-fi-card__image,
.home-fi-card:focus-within .home-fi-card__image {
	transform: scale(1.04);
}

/* ─────────── BADGES (over the image) ─────────── */

.home-fi-card__badge {
	position: absolute;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px 7px 10px;
	background: var(--fi-primary);
	border-radius: var(--fi-radius-pill);
	font-family: var(--fi-font-sans);
	font-weight: 600;
	font-size: 0.78rem;
	line-height: 1.1;
	letter-spacing: 0.01em;
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
	max-width: calc(100% - 24px);
	overflow: hidden;
	text-overflow: ellipsis;
}

.home-fi-card__badge > span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.home-fi-card__badge-icon {
	flex-shrink: 0;
	color: var(--fi-accent);
}

/* Top-left: featured badge (gold text + star) */
.home-fi-card__badge--featured {
	top: 14px;
	left: 14px;
	color: var(--fi-accent);
}

/* Bottom-left: location pill (white text + gold pin) */
.home-fi-card__badge--location {
	bottom: 14px;
	left: 14px;
	color: #ffffff;
}
.home-fi-card__badge--location .home-fi-card__badge-icon {
	color: var(--fi-accent);
}

/* ─────────── BODY ─────────── */

.home-fi-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 22px 22px 22px;
	gap: 12px;
}

.home-fi-card__title-link {
	text-decoration: none;
	color: inherit;
}
.home-fi-card__title-link:hover .home-fi-card__title,
.home-fi-card__title-link:focus-visible .home-fi-card__title {
	color: var(--fi-primary-soft);
}

.home-fi-card__title {
	font-family: var(--fi-font-serif);
	font-weight: 700;
	font-size: clamp(1.125rem, 1.4vw, 1.3125rem);
	line-height: 1.25;
	color: var(--fi-primary);
	margin: 0;
	letter-spacing: -0.005em;
	transition: color 0.25s var(--fi-ease);

	/* Allow up to 2 lines so equal-height cards line up */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.home-fi-card__desc {
	font-family: var(--fi-font-sans);
	font-weight: 400;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: var(--fi-text-muted);
	margin: 0;

	/* Clamp to 3 lines so cards have a consistent height */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ─────────── QUICK FACTS ─────────── */

.home-fi-card__facts {
	list-style: none;
	margin: 4px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--fi-divider);
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.home-fi-card__fact {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--fi-font-sans);
	font-weight: 500;
	font-size: 0.875rem;
	line-height: 1.3;
	color: var(--fi-text);
}

.home-fi-card__fact-icon {
	flex-shrink: 0;
	color: var(--fi-accent-dark);
}

.home-fi-card__fact-text {
	min-width: 0;
}

.home-fi-card__fact--price .home-fi-card__fact-text {
	font-weight: 500;
}

/* ─────────── CARD CTA BUTTON ─────────── */

.home-fi-card__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: auto; /* pushes button to the bottom for equal-height cards */
	padding: 13px 18px;
	background: var(--fi-primary);
	color: var(--fi-accent);
	border-radius: var(--fi-radius-cta);
	text-decoration: none;
	font-family: var(--fi-font-sans);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1;
	letter-spacing: 0.01em;
	transition:
		background-color 0.25s var(--fi-ease),
		color 0.25s var(--fi-ease),
		transform 0.25s var(--fi-ease);
}

.home-fi-card__cta:hover,
.home-fi-card__cta:focus-visible {
	background: var(--fi-primary-deep);
	color: var(--fi-accent-soft);
}

.home-fi-card__cta:focus-visible {
	outline: 2px solid var(--fi-accent);
	outline-offset: 3px;
}

.home-fi-card__cta svg {
	transition: transform 0.3s var(--fi-ease);
}
.home-fi-card__cta:hover svg,
.home-fi-card__cta:focus-visible svg {
	transform: translateX(3px);
}

/* =========================================================
   VIEW ALL BUTTON
   ========================================================= */

.home-fi__view-all-wrap {
	text-align: center;
	margin-top: clamp(28px, 4vw, 48px);
}

.home-fi__view-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px 36px;
	background: var(--fi-primary);
	color: var(--fi-accent);
	border-radius: var(--fi-radius-cta);
	text-decoration: none;
	font-family: var(--fi-font-sans);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	letter-spacing: 0.01em;
	box-shadow: 0 6px 22px rgba(15, 58, 55, 0.18);
	transition:
		background-color 0.25s var(--fi-ease),
		color 0.25s var(--fi-ease),
		transform 0.25s var(--fi-ease),
		box-shadow 0.25s var(--fi-ease);
}

.home-fi__view-all:hover,
.home-fi__view-all:focus-visible {
	background: var(--fi-primary-deep);
	color: var(--fi-accent-soft);
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(15, 58, 55, 0.24);
}

.home-fi__view-all:focus-visible {
	outline: 2px solid var(--fi-accent);
	outline-offset: 3px;
}

.home-fi__view-all svg {
	transition: transform 0.3s var(--fi-ease);
}
.home-fi__view-all:hover svg,
.home-fi__view-all:focus-visible svg {
	transform: translateX(4px);
}

/* =========================================================
   ACCESSIBILITY — REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
	.home-fi-card,
	.home-fi-card__image,
	.home-fi-card__cta,
	.home-fi-card__cta svg,
	.home-fi__view-all,
	.home-fi__view-all svg,
	.home-fi-card__title {
		transition: none !important;
	}
	.home-fi-card:hover,
	.home-fi__view-all:hover {
		transform: none !important;
	}
	.home-fi-card:hover .home-fi-card__image,
	.home-fi-card:focus-within .home-fi-card__image {
		transform: none !important;
	}
}

/* =========================================================
   SMALL-SCREEN POLISH (≤ 480px)
   ========================================================= */
@media (max-width: 480px) {
	.home-fi-card__body {
		padding: 18px 18px;
	}
	.home-fi-card__badge {
		font-size: 0.72rem;
		padding: 6px 10px 6px 9px;
	}
	.home-fi__view-all {
		padding: 14px 28px;
		font-size: 0.9375rem;
	}
}
