/*--------------------------------------------------------------
# Blog Cards Section
# Bento-style grid: 1 large, 3 small horizontal, 2 medium cards.
--------------------------------------------------------------*/

/* ── Section ── */
.blog-cards {
	padding: 60px 0 40px;
	background: var(--tpp-white);
	overflow: hidden;
	max-width: 1400px;
	margin: 0 auto;
	padding-left: var(--tpp-container-padding);
	padding-right: var(--tpp-container-padding);
}

/* ── Header ── */
.blog-cards__header {
	text-align: center;
	margin-bottom: 48px;
}

.blog-cards__title {
	font-family: var(--tpp-font-heading);
	font-size: clamp(2rem, 4.5vw + 0.5rem, 3.5rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.15;
	color: var(--tpp-black);
	margin: 0;
}

/* Two lines at every width, like the other homepage headings: "Latest News
   in" over "Points & Miles". Blocks rather than a <br />, and balanced in
   case a line ever has to wrap. */
.blog-cards__title-line {
	display: block;
	text-wrap: balance;
}

.blog-cards__view-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--tpp-font-body);
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--tpp-black);
	text-decoration: none;
	transition: color 0.3s ease;
}

.blog-cards__view-all:hover {
	color: var(--tpp-text-light);
}

.blog-cards__view-all svg {
	transition: transform 0.3s ease;
}

.blog-cards__view-all:hover svg {
	transform: translateX(3px);
}

/* ── Footer (View All below grid) ── */
.blog-cards__footer {
	text-align: center;
	margin-top: 48px;
}


/* ──────────────────────────────────────────────
   Grid Layout
   ────────────────────────────────────────────── */

.blog-cards__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;

	/* Scroll-reveal */
	opacity: 0;
	transform: translateY(32px);
	transition:
		opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.blog-cards__grid.is-visible {
	opacity: 1;
	transform: translateY(0);
}


/* ──────────────────────────────────────────────
   Card Base
   ────────────────────────────────────────────── */

.blog-card {
	display: flex;
	flex-direction: column;
	background: var(--tpp-off-white);
	border-radius: 16px;
	overflow: hidden;
	text-decoration: none;
	color: var(--tpp-black);
	transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
				box-shadow 0.35s ease;
}

.blog-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

/* "Coming Soon" fillers, used when fewer than six posts are published.
   They aren't links, so they don't lift on hover like the real cards. */
.blog-card--filler {
	pointer-events: none;
}

.blog-card__image-wrap {
	overflow: hidden;
}

.blog-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}


/* ── Meta (category + date) ── */
.blog-card__meta {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 36px 30px 0;
}

.blog-card__category {
	font-family: var(--tpp-font-body);
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--tpp-black);
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 100px;
	padding: 4px 14px;
	line-height: 1.4;
}

.blog-card__date {
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--tpp-text-light);
}

/* ── Title ── */
.blog-card__title {
	font-family: var(--tpp-font-heading);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.01em;
	color: var(--tpp-black);
	margin: 0;
	padding: 26px 30px 30px;
}

/* ── Read More ── */
.blog-card__read-more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--tpp-black);
	padding: 0 20px 20px;
	transition: gap 0.3s ease;
}

.blog-card:hover .blog-card__read-more {
	gap: 8px;
}


/* ──────────────────────────────────────────────
   Large Card (left column)
   ────────────────────────────────────────────── */

.blog-card--large .blog-card__image-wrap {
	height: 300px;
	max-height: 300px;
}

.blog-card--large .blog-card__title {
	font-size: clamp(1.25rem, 2vw, 1.5rem);
	font-weight: 600;
}


/* ──────────────────────────────────────────────
   Small Horizontal Cards (center column)
   ────────────────────────────────────────────── */

/* Wrapper around the three small cards. `display: contents` removes its box
   so the cards remain direct grid items — the grid and every layout above
   767px behave exactly as they did before the wrapper existed. It becomes a
   real flex box only in the mobile carousel at the end of this file. */
.blog-cards__small-group {
	display: contents;
}

.blog-card--small {
	flex-direction: row;
	align-items: stretch;
	background: transparent;
}

.blog-card--small .blog-card__image-wrap {
	width: 140px;
	min-width: 140px;
	height: 140px;
	padding: 0;
	overflow: visible;
}

.blog-card--small .blog-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

.blog-card--small .blog-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	padding: 16px 20px;
}

.blog-card--small .blog-card__category {
	align-self: flex-start;
}

.blog-card--small .blog-card__title {
	padding: 8px 0 0;
	font-size: 1.0375rem;
}

.blog-card--small .blog-card__date {
	font-size: 0.75rem;
	margin-top: 4px;
}


/* ──────────────────────────────────────────────
   Medium Cards (right column) — horizontal layout
   ────────────────────────────────────────────── */

.blog-card--medium {
	flex-direction: row;
	align-items: stretch;
}

.blog-card--medium .blog-card__image-wrap {
	width: 160px;
	min-width: 160px;
	height: auto;
	padding: 12px;
	overflow: visible;
}

.blog-card--medium .blog-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

.blog-card--medium .blog-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 20px;
	padding: 16px 20px;
}

.blog-card--medium .blog-card__meta {
	padding: 0;
}

.blog-card--medium .blog-card__title {
	padding: 0;
	font-size: 1.25rem;
}

.blog-card--medium .blog-card__read-more {
	padding: 0;
	margin-top: 4px;
}


/* ──────────────────────────────────────────────
   Desktop Grid (≥992px) — 3 columns
   ────────────────────────────────────────────── */

@media screen and (min-width: 992px) {
	.blog-cards__grid {
		grid-template-columns: 1.1fr 1fr 1fr;
		grid-template-rows: repeat(6, auto);
		align-items: start;
	}

	/* Large card: spans all 6 rows */
	.blog-card--large {
		grid-column: 1;
		grid-row: 1 / 7;
		align-self: stretch;
	}

	/* Small cards: stacked in column 2, each spans 2 rows.
	   These were .blog-card:nth-child(2)/(3)/(4). The three are now wrapped
	   in .blog-cards__small-group so they can become a carousel on mobile;
	   the wrapper is display: contents here, so the cards are still the grid
	   items — but nth-child counts DOM siblings and is unaffected by
	   display, so it now counts within the wrapper. Same three cells. */
	.blog-card--small:nth-child(1) {
		grid-column: 2;
		grid-row: 1 / 3;
	}

	.blog-card--small:nth-child(2) {
		grid-column: 2;
		grid-row: 3 / 5;
	}

	.blog-card--small:nth-child(3) {
		grid-column: 2;
		grid-row: 5 / 7;
	}

	/* Medium cards: in column 3, each spans 3 rows — equal height.
	   Were nth-child(5)/(6); the wrapper makes them the grid's 3rd and 4th
	   children. */
	.blog-card--medium:nth-child(3) {
		grid-column: 3;
		grid-row: 1 / 4;
		align-self: stretch;
	}

	.blog-card--medium:nth-child(4) {
		grid-column: 3;
		grid-row: 4 / 7;
		align-self: stretch;
	}
}


/* ──────────────────────────────────────────────
   Tablet (768px – 991px)
   ────────────────────────────────────────────── */

@media screen and (min-width: 768px) and (max-width: 991px) {
	.blog-cards__grid {
		grid-template-columns: 1fr 1fr;
	}

	.blog-card--large {
		grid-column: 1 / -1;
	}

	/* Two columns instead of three halves the space a medium card gets, and
	   its 160px image would leave ~126px for the title. */
	.blog-card--medium .blog-card__image-wrap {
		width: 130px;
		min-width: 130px;
	}

	.blog-card--medium .blog-card__title {
		font-size: 1.1rem;
	}

	.blog-card--medium .blog-card__body {
		gap: 14px;
	}
}


/* ──────────────────────────────────────────────
   Mobile (≤767px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 767px) {
	.blog-cards {
		padding: 64px 0 80px;
		padding-left: var(--tpp-container-padding);
		padding-right: var(--tpp-container-padding);
	}

	.blog-cards__header {
		margin-bottom: 32px;
	}

	.blog-cards__grid {
		gap: 16px;
	}

	/* ── Small cards become a swipe carousel ──
	   Native scroll-snap, so touch swipe and momentum come free and there is
	   no JS. Deliberately no dots or arrows, matching the Inner Circle vault
	   carousel. The negative side margins cancel the section's container
	   padding so cards can reach the screen edge; padding puts the content
	   edge back, and scroll-padding-left makes snapped cards line up with
	   the section's other content rather than the screen edge. */
	.blog-cards__small-group {
		display: flex;
		gap: 12px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin-left: calc(var(--tpp-container-padding) * -1);
		margin-right: calc(var(--tpp-container-padding) * -1);
		padding: 2px var(--tpp-container-padding);
		scroll-padding-left: var(--tpp-container-padding);
	}

	.blog-cards__small-group::-webkit-scrollbar {
		display: none;
	}

	/* The cap stops cards stretching into letterboxes on wider phones; the
	   remainder is what leaves the next card peeking. */
	.blog-card--small {
		flex: 0 0 min(85%, 320px);
		scroll-snap-align: start;
		/* Restores the .blog-card base background. --small zeroes it because
		   on desktop it is a bare row in a vertical list — as a carousel
		   slide it needs a visible edge. */
		background: var(--tpp-off-white);
		border-radius: 16px;
	}

	.blog-card--small .blog-card__image-wrap {
		width: 100px;
		min-width: 100px;
		padding: 10px;
	}

	.blog-card--small .blog-card__body {
		padding: 12px 16px 12px 6px;
	}

	/* The medium card kept its 160px image at every width — on a 375px
	   screen that left ~127px for a 1.25rem title. */
	.blog-card--medium .blog-card__image-wrap {
		width: 112px;
		min-width: 112px;
		padding: 10px;
	}

	.blog-card--medium .blog-card__body {
		gap: 10px;
		padding: 14px 16px 14px 6px;
	}

	.blog-card--medium .blog-card__title {
		font-size: 1.05rem;
	}

	.blog-card--large .blog-card__image-wrap {
		height: 220px;
		max-height: 220px;
	}

	/* Only the large card uses these — --small and --medium override them
	   with two-class selectors, so they keep their own tighter padding.
	   30px a side is a lot of a 375px screen. */
	.blog-card__meta {
		padding: 24px 20px 0;
	}

	.blog-card__title {
		padding: 16px 20px 24px;
	}

	.blog-cards__footer {
		margin-top: 32px;
	}
}

/* ──────────────────────────────────────────────
   Small mobile (≤480px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 480px) {
	.blog-card--small .blog-card__image-wrap {
		width: 88px;
		min-width: 88px;
	}

	.blog-card--small .blog-card__title {
		font-size: 0.95rem;
	}

	.blog-card--medium .blog-card__image-wrap {
		width: 96px;
		min-width: 96px;
	}

	.blog-card--medium .blog-card__title {
		font-size: 1rem;
	}

	.blog-card--large .blog-card__image-wrap {
		height: 190px;
		max-height: 190px;
	}

	.blog-card__meta {
		padding: 20px 16px 0;
	}

	.blog-card__title {
		padding: 14px 16px 20px;
	}
}

/* Tap targets at least 44px tall on phones (Owen's request). */
@media screen and (max-width: 767px) {
	.blog-cards__view-all {
		min-height: 44px;
		margin: -11px 0;
	}
}
