/* ==========================================================================
   Cards — the grid system plus .card (program/blog cards) and
   .icon-card (benefit/feature cards) used throughout the site.
   ========================================================================== */
.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
	background: var(--color-surface);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: transform var(--transition), box-shadow var(--transition);
	border: 1px solid var(--color-border);
	display: flex; flex-direction: column;
	height: 100%;
	position: relative;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-media {
	position: relative; aspect-ratio: 4/3; overflow: hidden;
	/* Shown whenever a card has no image yet (e.g. a new blog post saved
	   without a featured image) instead of a blank white box. */
	background: linear-gradient(135deg, var(--color-bg-alt), var(--color-border));
}
/* z-index keeps the photo over the "ॐ" placeholder below on browsers
   without CSS :has() (older iPhones, older Firefox). */
.card-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.card:hover .card-media img { transform: scale(1.06); }
.card-media::after {
	content: 'ॐ';
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--font-heading); font-size: 2.4rem; color: var(--color-primary-light);
	opacity: 0.5;
}
.card-media:has(img)::after { display: none; }
.card-badge {
	position: absolute; top: 14px; left: 14px;
	background: var(--color-secondary); color: #fff;
	font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em;
	padding: 6px 12px; border-radius: 999px;
}
.card-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.card-body h3 { font-size: 1.15rem; margin-bottom: 0.2em; transition: color var(--transition); }
.card-body p { color: var(--color-text-light); font-size: 0.94rem; margin-bottom: 0; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--color-secondary-dark); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.card-footer { margin-top: auto; padding-top: 14px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--color-primary); position: relative; padding-bottom: 2px; }
.card-link::after { content: '→'; transition: transform var(--transition); }
.card-link:hover::after { transform: translateX(4px); }

/* ---- Cards with two actions (home "Programs" cards): the title link is
   stretched over the whole card so a click anywhere still opens the page,
   while the "Book Now" button sits above it with its own destination. ---- */
.card--actions { position: relative; }
.card-stretch { color: inherit; }
.card-stretch::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.card-stretch:focus-visible { outline: none; }
.card--actions:focus-within { box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.35), var(--shadow-lg); }
.card--actions:hover .card-link::after { transform: translateX(4px); }
.card--actions .card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-book {
	position: relative;
	z-index: 4;                 /* above the stretched title link */
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: 999px;
	background: var(--color-secondary);
	color: #fff;
	font-size: 0.88rem;
	font-weight: 600;
	box-shadow: 0 4px 12px rgba(217, 138, 61, 0.3);
	transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card-book::after { content: '→'; transition: transform var(--transition); }
.card-book:hover,
.card-book:focus-visible {
	background: var(--color-primary);
	color: #f4d9a8;
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(47, 93, 80, 0.35);
	outline: none;
}
.card-book:hover::after,
.card-book:focus-visible::after { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
	.card-book, .card-book::after { transition: none; }
	.card-book:hover { transform: none; }
}

/* ---- Course cards on the 6 category pages (template-parts/categories/program-card.php):
   price (inc/pricing.php) above View Details + Book Now. ---- */
.card--program .card-price {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px dashed var(--color-border);
}
.card--program .card-body { padding: 22px 20px; }
.card--program .card-footer { margin-top: 0; padding-top: 6px; gap: 8px; }
.card--program .card-link { font-size: 0.9rem; }
.card--program .card-book { padding: 8px 14px; font-size: 0.84rem; }

/* 2 course boxes per row (photo on top). An odd last box (e.g. the 5th
   trek) sits centred on its own row. */
.program-cards-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
}
.program-cards-grid > .card--program:last-child:nth-child(odd) {
	grid-column: 1 / -1;
	justify-self: center;
	width: calc(50% - 16px);
}
.program-cards-grid .card--program .card-media { aspect-ratio: 16 / 9; }
.program-cards-grid .card--program .card-badge { top: 16px; left: 16px; padding: 7px 14px; font-size: 0.78rem; }
.program-cards-grid .card--program .card-body { padding: 26px 28px 26px; gap: 12px; }
.program-cards-grid .card--program h3 { font-size: 1.4rem; }
.program-cards-grid .card--program .card-book { padding: 11px 22px; font-size: 0.92rem; }

/* "View Details" as a button next to "Book Now": green outline pill with the
   arrow in a small circle; fills green on hover. Both buttons share the row. */
.program-cards-grid .card--program .card-footer { gap: 12px; flex-wrap: nowrap; }
.program-cards-grid .card--program .card-footer > * { flex: 1 1 50%; justify-content: center; min-width: 0; white-space: nowrap; }
.card--program .card-details {
	z-index: 4;                 /* above the stretched title link, so its own hover works */
	gap: 10px;
	padding: 9px 10px 9px 22px;
	border: 1.5px solid var(--color-primary);
	border-radius: 999px;
	background: rgba(47, 93, 80, 0.06);
	color: var(--color-primary);
	font-size: 0.92rem;
	transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card--program .card-details::before { display: none; }
.card--program .card-details::after {
	content: '→';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--color-primary);
	color: #fff;
	font-size: 0.85rem;
	transition: transform var(--transition), background var(--transition), color var(--transition);
}
.card--program:hover .card-details { background: rgba(47, 93, 80, 0.12); }
.card--program .card-details:hover {
	background: var(--color-primary);
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 8px 18px rgba(47, 93, 80, 0.3);
}
.card--program .card-details:hover::after { background: #f4d9a8; color: var(--color-primary-dark); transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
	.card--program .card-details, .card--program .card-details::after { transition: none; }
	.card--program .card-details:hover { transform: none; }
}
@media (max-width: 360px) {
	.program-cards-grid .card--program .card-footer { flex-wrap: wrap; }
}
.program-cards-grid .card--program .price-tag-now { font-size: 1.7rem; }

/* Quick facts: length, next start date, places left */
.card-facts {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.card-facts li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--color-bg-alt);
	color: var(--color-primary-dark);
	font-size: 0.8rem;
	font-weight: 500;
}
.card-facts svg { width: 15px; height: 15px; color: var(--color-secondary); }
.card-fact-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary-light); box-shadow: 0 0 0 3px rgba(79, 127, 111, 0.2); }
.card-fact--seats.is-few { background: rgba(201, 120, 79, 0.14); color: #9a4a26; }
.card-fact--seats.is-few .card-fact-dot { background: var(--accent-terracotta); box-shadow: 0 0 0 3px rgba(201, 120, 79, 0.25); }

/* "What you will learn" and "Included" */
.card-block { padding-top: 14px; border-top: 1px dashed var(--color-border); }
.card-block-title {
	display: block;
	margin-bottom: 10px;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-secondary-dark);
}
.card-learn { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card-learn li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; color: var(--color-text); }
.card-learn svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
	padding: 3px;
	margin-top: 1px;
	border-radius: 50%;
	background: rgba(47, 93, 80, 0.12);
	color: var(--color-primary);
}
.card-includes { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.card-includes li {
	padding: 5px 12px;
	border-radius: 8px;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-text-light);
	font-size: 0.8rem;
}

@media (max-width: 1024px) {
	.program-cards-grid { grid-template-columns: minmax(0, 1fr); max-width: 680px; margin-inline: auto; }
	.program-cards-grid > .card--program:last-child:nth-child(odd) { width: 100%; }
}
@media (max-width: 640px) {
	.program-cards-grid .card--program .card-body { padding: 22px 20px; }
	.program-cards-grid .card--program h3 { font-size: 1.25rem; }
}
.card--program h3 a { color: inherit; }
.card--program:hover h3 { color: var(--color-primary); }

.icon-card { background: var(--color-surface); border-radius: var(--radius-md); padding: 30px 26px; box-shadow: var(--shadow-sm); border: 1px solid var(--color-border); transition: transform var(--transition), box-shadow var(--transition); height: 100%; }
.icon-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.icon-badge {
	width: 54px; height: 54px; border-radius: 16px;
	background: var(--color-bg-alt); color: var(--color-primary);
	display: flex; align-items: center; justify-content: center;
	margin-bottom: 18px;
}
.icon-badge svg { width: 26px; height: 26px; }
.icon-card h3 { font-size: 1.08rem; }
.icon-card p { color: var(--color-text-light); font-size: 0.93rem; margin-bottom: 0; }

/* ==========================================================================
   Card hover enhancements — image overlay, accent sweep, animated link
   underline. Extends the base .card rules above; does not redeclare them.
   ========================================================================== */

/* Gradient overlay rises over the image on hover, for readability
   and a richer feel alongside the existing zoom effect. */
.card-media::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,0.45) 100%);
	opacity: 0;
	transition: opacity var(--transition);
	z-index: 1;
}
.card:hover .card-media::before { opacity: 1; }

/* Thin accent bar sweeps in from the left along the top edge of the card */
.card::before {
	content: '';
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, var(--color-secondary), var(--color-primary));
	transform: scaleX(0);
	transform-origin: left;
	transition: transform var(--transition);
	z-index: 2;
}
.card:hover::before { transform: scaleX(1); }

/* Title shifts to the accent color on hover */
.card:hover .card-body h3 { color: var(--color-secondary-dark); }

/* Animated underline beneath the "Explore" link */
.card-link::before {
	content: '';
	position: absolute;
	left: 0; bottom: 0;
	width: 0;
	height: 2px;
	background: var(--color-secondary);
	transition: width var(--transition);
}
.card:hover .card-link::before { width: 100%; }

/* Slightly deeper shadow than the base --shadow-lg on hover */
.card:hover { box-shadow: 0 20px 45px rgba(0,0,0,0.15); }

@media (max-width: 992px) {
	.grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.grid-3 { grid-template-columns: 1fr; }
}