/**
 * Homepage blog section styles.
 *
 * Design Direction: Editorial / Magazine
 * DFII Score: 19
 *
 * @package Vantage_Journeys
 */

/* ─────────────────────────────────────────────────────────────
   Blog Section & Background Decor
   ───────────────────────────────────────────────────────────── */

.vj-blog {
	padding-block: var(--padding-section);
	position: relative;
	background-color: var(--surface-grey-subtle);
	overflow: hidden;
	z-index: 1;
}

/* ─────────────────────────────────────────────────────────────
   Section Header
   ───────────────────────────────────────────────────────────── */

.vj-blog__header {
	text-align: center;
	max-width: var(--container-sm);
	margin-inline: auto;
	margin-block-end: var(--space-xl);
}

.vj-blog__eyebrow {
	display: block;
	margin-block-end: var(--space-sm);
	font-family: var(--font-family-accent);
	font-size: var(--type-h3);
	font-weight: 700;
	letter-spacing: var(--ls-widest);
	color: var(--color-brand-secondary);
}

.vj-blog__heading {
	font-family: var(--font-family-primary);
	font-size: var(--type-h2);
	font-weight: var(--font-weight-extrabold);
	line-height: var(--lh-tight);
	color: var(--color-brand-primary);
}

/* ─────────────────────────────────────────────────────────────
   Blog Grid - 3 Column Layout with minmax safety to prevent overflow
   ───────────────────────────────────────────────────────────── */

.vj-blog__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--space-lg) var(--space-md);
}

/* ─────────────────────────────────────────────────────────────
   Blog Card - Overlapping Layout & Overflow Containment
   ───────────────────────────────────────────────────────────── */

.vj-blog-card {
	display: flex;
	flex-direction: column;
	position: relative;
	background-color: transparent;
	height: 100%; /* Stretch cards in the grid to equal height */
	/* Force word wrapping to prevent horizontal stretching of the layout grid */
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-word;
}

/* ─────────────────────────────────────────────────────────────
   Card Image
   ───────────────────────────────────────────────────────────── */

.vj-blog-card__image-wrapper {
	position: relative;
	border-radius: var(--radius-xl);
	overflow: hidden;
	z-index: 1;
}

.vj-blog-card__image-link {
	display: block;
	aspect-ratio: 16 / 12;
	overflow: hidden;
}

.vj-blog-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration-slow) var(--ease-standard);
	display: block;
}

.vj-blog-card:hover .vj-blog-card__image {
	transform: scale(1.06);
}

.vj-blog-card__category {
	position: absolute;
	top: var(--space-sm);
	left: var(--space-sm);
	display: inline-flex;
	padding: var(--padding-badge);
	background-color: var(--color-brand-secondary);
	color: var(--color-text-on-secondary);
	font-family: var(--font-family-body);
	font-size: var(--font-size-2xs);
	font-weight: 700;
	text-transform: uppercase;
	border-radius: var(--radius-sm);
	z-index: 2;
	letter-spacing: var(--ls-wide);
}

/* ─────────────────────────────────────────────────────────────
   Card Content (Overlapping Box)
   ───────────────────────────────────────────────────────────── */

.vj-blog-card__content {
	position: relative;
	z-index: 2;
	background-color: var(--surface-grey-default);
	border-radius: var(--radius-xl);
	padding: var(--padding-card);
	margin-top: calc(-1 * var(--space-md));
	box-shadow: var(--shadow-sm);
	transition:
		transform var(--duration-base) var(--ease-standard),
		box-shadow var(--duration-base) var(--ease-standard);

	/* Make it a flex column so footer gets pushed to the bottom of the card content */
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.vj-blog-card:hover .vj-blog-card__content {
	transform: translateY(-5px);
	box-shadow: var(--shadow-lg);
}

/* ─────────────────────────────────────────────────────────────
   Card Meta Row
   ───────────────────────────────────────────────────────────── */

.vj-blog-card__meta {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	padding-bottom: var(--space-sm);
	border-bottom: 1px solid var(--border-grey-subtle);
	margin-bottom: var(--space-sm);
}

.vj-blog-card__date,
.vj-blog-card__comments {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	font-family: var(--font-family-body);
	font-size: var(--font-size-xs);
	color: var(--color-text-secondary);
	font-weight: 500;
}

.vj-blog-card__date svg,
.vj-blog-card__comments svg {
	flex-shrink: 0;
	color: var(--color-brand-secondary);
}

/* ─────────────────────────────────────────────────────────────
   Card Title
   ───────────────────────────────────────────────────────────── */

.vj-blog-card__title {
	font-family: var(--font-family-primary);
	font-size: var(--type-h5);
	font-weight: var(--font-weight-semibold);
	line-height: var(--lh-snug, 1.4);
	color: var(--color-brand-primary);
	margin-bottom: var(--space-xs);
}

.vj-blog-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color var(--duration-fast) var(--ease-standard);
}

.vj-blog-card__title a:hover {
	color: var(--color-brand-secondary-hover);
}

/* ─────────────────────────────────────────────────────────────
   Card Excerpt - Line clamped for alignment symmetry
   ───────────────────────────────────────────────────────────── */

.vj-blog-card__excerpt {
	font-family: var(--font-family-body);
	font-size: var(--font-size-sm);
	font-weight: 400;
	line-height: var(--lh-relaxed);
	color: var(--color-text-secondary);
	margin-bottom: var(--space-md);

	/* Line clamp to exactly 2 lines matching popular tours design */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	height: 3.2em; /* 2 lines * 1.6 line-height relative unit */
}

/* ─────────────────────────────────────────────────────────────
   Card Footer - Styled for alignment without author information
   ───────────────────────────────────────────────────────────── */

.vj-blog-card__footer {
	display: flex;
	margin-top: auto; /* Push the footer button wrapper to the bottom of the card content */
	padding-top: var(--space-sm);
	border-top: 1px solid var(--border-grey-subtle);
}

.vj-blog-card__button {
	width: 100%;
}

/* Override styling for the inline theme-btn button inside blog card */
.vj-blog-card__button .theme-btn {
	width: 100%;
	justify-content: center;
}

/* ─────────────────────────────────────────────────────────────
   Section Footer / CTA area
   ───────────────────────────────────────────────────────────── */

.vj-blog__footer {
	text-align: center;
	margin-top: var(--space-xl);
}

/* ─────────────────────────────────────────────────────────────
   Responsive Grid & Layout Adjustments
   ───────────────────────────────────────────────────────────── */

@media screen and (max-width: 1024px) {
	.vj-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--space-lg);
	}
}

@media screen and (max-width: 767px) {
	.vj-blog {
		padding-block: var(--space-xl);
	}

	.vj-blog__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--space-xl);
	}

	.vj-blog-card__content {
		padding: var(--padding-card);
	}
}

/* ─────────────────────────────────────────────────────────────
   Reduced Motion
   ───────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.vj-blog-card,
	.vj-blog-card__image,
	.vj-blog-card__content {
		transition: none !important;
	}

	.vj-blog-card:hover .vj-blog-card__content {
		transform: none !important;
	}

	.vj-blog-card:hover .vj-blog-card__image {
		transform: none !important;
	}
}