/*
 * Approved listing-card redesign (MyFitness-Listing-Cards prototype).
 * Tokens match that prototype exactly (#202733 ink, #6a7472 muted,
 * #e0e5dc border), not the rest of the site's own palette — same
 * reasoning as results-page.css: this card was explicitly approved as
 * its own design. Real data only: no fabricated ratings, distances or
 * offers (see listing-card.php's docblock for what's deliberately not
 * shown, like "Coup de cœur").
 *
 * Two layouts share the same real markup (content-listing-grid.php always
 * renders class="mf-card mf-card-horizontal" — there's no separate
 * template for the other one): the base rules below are the "horizontal"
 * list-row variant (results page). The homepage's own "Voir tout" rails
 * (front-page.php's mf_render_listing_ids() calls — Espace Femmes and
 * every category section) wrap their cards in a real
 * "mf-voir-tout-grid" container class already (passed as $style_data
 * ['class'], printed by Listeo's own listings-start.php), so the
 * ".mf-voir-tout-grid .mf-card-horizontal" block at the end of this file
 * restyles the exact same markup into the prototype's "vertical"
 * card (4:3 photo on top) for that context — no template/markup fork.
 */

.mf-card-horizontal {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	border: 1px solid #e0e5dc;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	min-height: 142px;
	min-width: 0;
	transition: box-shadow .15s;
}

.mf-card-horizontal:hover {
	box-shadow: 0 8px 25px rgba(32, 39, 51, .07);
}

.mf-card-link {
	display: contents;
	color: inherit;
	text-decoration: none;
}

.mf-card-photo {
	position: relative;
	align-self: start;
	margin: 12px 0 12px 12px;
	inline-size: 104px;
	block-size: 104px;
	border-radius: 13px;
	overflow: hidden;
	background: #e7ecdf;
}

/* content-listing-gallery.php (real Listeo partial, unmodified) outputs up
   to 3 sibling <img class="slider-image-nl"> tags meant for a slider — this
   card shows one static cover photo only (per the approved design: "Une
   photo, une identité, un prix"), so every image but the first is hidden
   rather than pulling in slider JS/arrows this small card doesn't need. */
.mf-card-photo .slider-image-nl {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.mf-card-photo:not(.mf-card-slidable) .slider-image-nl ~ .slider-image-nl {
	display: none;
}

/* Swipe through the card's photos (card-gallery.js wraps them): dots, no number. */
.mf-card-slides {
	position: absolute;
	inset: 0;
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.mf-card-slides::-webkit-scrollbar {
	display: none;
}

.mf-card-slides .slider-image-nl {
	position: static;
	flex: 0 0 100%;
	inline-size: 100%;
	block-size: 100%;
	scroll-snap-align: start;
}

.mf-card-dots {
	position: absolute;
	inset-block-start: 7px;
	inset-inline: 0;
	display: flex;
	justify-content: center;
	gap: 4px;
	pointer-events: none;
}

.mf-card-dots i {
	inline-size: 5px;
	block-size: 5px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	box-shadow: 0 0 2px rgba(0, 0, 0, .35);
	transition: background .15s, transform .15s;
}

.mf-card-dots i.is-active {
	background: #fff;
	transform: scale(1.25);
}

@media (hover: hover) and (min-width: 781px) {
	/* Desktop: arrows appear on hover so the photos can be browsed with a mouse. */
	.mf-card-arrow {
		position: absolute;
		inset-block-start: 50%;
		display: grid;
		place-items: center;
		inline-size: 28px;
		block-size: 28px;
		margin-block-start: -14px;
		border: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, .92);
		color: #202733;
		font-size: 16px;
		line-height: 1;
		opacity: 0;
		cursor: pointer;
		transition: opacity .15s;
		z-index: 3;
	}

	.mf-card-arrow[data-dir="-1"] { inset-inline-start: 8px; }
	.mf-card-arrow[data-dir="1"] { inset-inline-end: 8px; }

	.mf-card-photo:hover .mf-card-arrow {
		opacity: 1;
	}
}

@media not all and (hover: hover) and (min-width: 781px) {
	.mf-card-arrow {
		display: none;
	}
}

.mf-card-photo-shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(rgba(0, 0, 0, .13), transparent 50%, rgba(0, 0, 0, .13));
	pointer-events: none;
}

.mf-card-badge {
	position: absolute;
	inset-block-end: 4px;
	inset-inline-start: 4px;
	font-size: 8px;
	padding: 2px 5px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	color: #202733;
	font-weight: 600;
	max-width: 95px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mf-card-distance {
	position: absolute;
	inset-block-end: 24px;
	inset-inline-start: 4px;
	display: flex;
	align-items: center;
	gap: 3px;
	background: #fff;
	border-radius: 999px;
	font-size: 9px;
	padding: 2px 5px;
}

.mf-card-distance .mf-icon {
	inline-size: 10px;
	block-size: 10px;
}

.mf-card-body {
	position: relative;
	padding: 12px 10px 12px 22px;
	min-width: 0;
}

/* Real Listeo favorite toggle (.listeo_core-bookmark-it/.listeo_core-unbookmark-it,
   FontAwesome fa-regular/fa-solid heart) — restyled in place, not rebuilt,
   so the site's existing AJAX bookmark handler (frontend.js) keeps working
   unchanged. Sits over the photo (its nearest positioned ancestor), matching
   the approved design. */
.mf-card-favorite {
	position: absolute;
	inset-block-start: 4px;
	inset-inline-end: 4px;
	inline-size: 28px;
	block-size: 28px;
	border-radius: 50%;
	background: rgba(32, 39, 51, .5);
	color: #fff;
	display: grid;
	place-items: center;
	z-index: 3;
}

.mf-card-favorite .fa-heart {
	font-size: 13px;
}

.mf-card-favorite .liked {
	color: #ef4055;
}

.mf-card-category {
	font-size: 10px;
	color: var(--mfr-muted, #6a7472);
	margin-block-end: 3px;
}

.mf-card-name {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 15px;
	letter-spacing: -.3px;
	margin: 0 0 5px;
	line-height: 1.3;
	color: #202733;
}

.mf-card-seal {
	display: inline-flex;
	flex-shrink: 0;
	color: #0f6b45;
}

.mf-card-seal .mf-icon {
	inline-size: 15px;
	block-size: 15px;
}

.mf-card-instant {
	display: inline-flex;
	flex-shrink: 0;
	color: #9a5b00;
	font-size: 12px;
}

.mf-card-meta {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #6a7472;
}

.mf-card-meta b {
	color: #202733;
}

.mf-card-star {
	color: #ffb800;
	font-size: 10px;
}

.mf-card-new {
	color: #6a7472;
}

.mf-card-area {
	overflow: hidden;
	text-overflow: ellipsis;
}

.mf-card-price-row {
	margin-block-start: 5px;
}

.mf-card-price {
	font-size: 12px;
	white-space: nowrap;
}

.mf-card-price strong {
	font-weight: 700;
	color: #202733;
}

.mf-card-price small {
	font-size: 10px;
	color: #6a7472;
}

.mf-card-labels {
	display: flex;
	gap: 3px;
	flex-wrap: nowrap;
	overflow: hidden;
	margin-block-start: 7px;
}

.mf-card-label {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 9px;
	white-space: nowrap;
	padding: 3px 5px;
	border-radius: 8px;
}

.mf-card-label .mf-icon {
	inline-size: 10px;
	block-size: 10px;
}

.mf-card-label-women {
	color: #a3245e;
	background: #fce8f1;
}

.mf-card-label-trial {
	color: #0f6b45;
	background: #ddf5e8;
}

.mf-card-label-home {
	color: #9a5b00;
	background: #fff1dc;
}

.mf-card-label-online {
	color: #4b3fb5;
	background: #ecebff;
}

/* ---- Vertical "discovery card" (homepage rails — see file docblock) ---- */

.mf-voir-tout-grid .mf-card-horizontal {
	display: flex;
	flex-direction: column;
	block-size: 100%;
	border-radius: 20px;
}

/* Cards in the same row can have a different amount of real content
   (price shown or not, 0-2 labels, certified seal or not) — grid/flex
   "stretch" already equalizes each card's OUTER height, but without this
   the body's own content just sits at the top with blank space below on
   shorter cards, which read as visually "shorter" even at equal height.
   flex-column + margin-block-start:auto on whichever optional block is
   present keeps every card's bottom edge visually anchored the same way
   regardless of which fields that specific listing actually has. */
.mf-voir-tout-grid .mf-card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.mf-voir-tout-grid .mf-card-price-row {
	margin-block-start: auto;
}

.mf-voir-tout-grid .mf-card-labels:last-child {
	margin-block-start: auto;
}

.mf-voir-tout-grid .mf-card-horizontal:hover {
	box-shadow: 0 8px 25px rgba(32, 39, 51, .12);
	transform: translateY(-2px);
	transition: box-shadow .15s, transform .15s;
}

.mf-voir-tout-grid .mf-card-photo {
	inline-size: 100%;
	block-size: auto;
	aspect-ratio: 4 / 3;
	margin: 0;
	border-radius: 0;
}

.mf-voir-tout-grid .mf-card-favorite {
	inset-block-start: 11px;
	inset-inline-end: 11px;
	inline-size: 36px;
	block-size: 36px;
}

.mf-voir-tout-grid .mf-card-favorite .fa-heart {
	font-size: 15px;
}

.mf-voir-tout-grid .mf-card-badge {
	inset-block-start: 12px;
	inset-block-end: auto;
	inset-inline-start: 12px;
	font-size: 11px;
	padding: 5px 9px;
	max-width: calc(100% - 65px);
}

.mf-voir-tout-grid .mf-card-distance {
	inset-block-end: 12px;
	inset-inline-start: 12px;
	font-size: 11px;
	padding: 4px 8px;
}

.mf-voir-tout-grid .mf-card-distance .mf-icon {
	inline-size: 13px;
	block-size: 13px;
}

.mf-voir-tout-grid .mf-card-body {
	padding: 15px 16px 17px;
}

.mf-voir-tout-grid .mf-card-category {
	font-size: 11px;
	margin-block-end: 4px;
}

.mf-voir-tout-grid .mf-card-name {
	font-size: 18px;
	letter-spacing: -.4px;
	margin-block-end: 7px;
}

.mf-voir-tout-grid .mf-card-seal .mf-icon {
	inline-size: 18px;
	block-size: 18px;
}

.mf-voir-tout-grid .mf-card-meta {
	font-size: 13px;
	white-space: normal;
}

.mf-voir-tout-grid .mf-card-price-row {
	margin-block-start: 8px;
	min-block-size: 22px;
}

.mf-voir-tout-grid .mf-card-price {
	font-size: 13px;
}

.mf-voir-tout-grid .mf-card-price small {
	font-size: 12px;
}

.mf-voir-tout-grid .mf-card-labels {
	gap: 5px;
	margin-block-start: 10px;
}

.mf-voir-tout-grid .mf-card-label {
	font-size: 11px;
	padding: 4px 7px;
}

.mf-voir-tout-grid .mf-card-label .mf-icon {
	inline-size: 13px;
	block-size: 13px;
}


/* ==== Results v10 card (MyFitness-Results prototype) ==== */

.mf-card-horizontal {
	position: relative;
}

/* Corner badge: top-left of the photo for every type (Coup de coeur). */
.mf-card-badge {
	inset-block-start: 4px;
	inset-block-end: auto;
	inset-inline-start: 4px;
	padding: 3px 4px;
	border-radius: 9px;
	font-size: 7px;
	font-weight: 400;
	z-index: 2;
}

.mf-card-name {
	font-size: 14px;
	letter-spacing: -.4px;
	margin-block-end: 6px;
}

/* Teal certified seal. */
.mf-card-seal {
	color: #1f6f8b;
}

.mf-card-seal .mf-icon {
	inline-size: 17px;
	block-size: 17px;
}

.mf-card-meta {
	font-size: 10px;
	gap: 2px;
}

.mf-card-star {
	display: inline-flex;
	font-size: 13px;
	line-height: 1;
	color: #ffb800;
}

/* Price row: ? Des 299 MAD ? on the left, dashed ? Offre ? pill on the right. */
.mf-card-price-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	margin-block-start: 5px;
}

.mf-card-price {
	font-size: 12px;
}

.mf-card-offer {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	flex-shrink: 0;
	padding: 2px 6px;
	border: 1px dashed #a6bf70;
	border-radius: 8px;
	background: #f1f8d6;
	color: #3f5e1a;
	font-size: 10px;
	line-height: 1.4;
}

.mf-card-offer .mf-icon {
	inline-size: 12px;
	block-size: 12px;
	fill: none;
	stroke: currentColor;
}

.mf-card-labels {
	gap: 5px;
	margin-block-start: 9px;
}

/* WhatsApp circle (Pro/Club), bottom-right of the card; a sibling of the card link. */
.mf-card-wa {
	position: absolute;
	inset-block-end: 9px;
	inset-inline-end: 10px;
	display: grid;
	place-items: center;
	inline-size: 28px;
	block-size: 28px;
	border-radius: 50%;
	background: #202733;
	color: #fff;
	z-index: 3;
}

.mf-card-wa .mf-icon {
	inline-size: 15px;
	block-size: 15px;
}

.mf-card-wa:hover {
	background: #2e3646;
}

.mf-card-wa:focus-visible {
	outline: 2px solid #dcff35;
	outline-offset: 2px;
}

.mf-card-horizontal:has(.mf-card-wa) .mf-card-body {
	padding-block-end: 35px;
}

/* Results grid: vertical cards (4:3 photo on top) from 700px; 2 columns on tablets, 3 on desktop, 4 on large desktops; below 700px the compact one-column list. */
@media (min-width: 700px) {
	.full-page-job-listings-container #listeo-listings-container.new-grid-layout-nl {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}
@media (min-width: 993px) {
	.full-page-job-listings-container #listeo-listings-container.new-grid-layout-nl {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (min-width: 1700px) {
	.full-page-job-listings-container #listeo-listings-container.new-grid-layout-nl {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 700px) {

	.listings-container.new-grid-layout-nl .mf-card-horizontal {
		display: flex;
		flex-direction: column;
		min-block-size: 0;
		border-radius: 20px;
	}

	.listings-container.new-grid-layout-nl .mf-card-photo {
		inline-size: 100%;
		block-size: auto;
		aspect-ratio: 4 / 3;
		margin: 0;
		border-radius: 0;
	}

	.listings-container.new-grid-layout-nl .mf-card-favorite {
		inset-block-start: 10px;
		inset-inline-end: 10px;
		inline-size: 32px;
		block-size: 32px;
	}

	.listings-container.new-grid-layout-nl .mf-card-badge {
		inset-block-start: 10px;
		inset-inline-start: 10px;
		padding: 4px 6px;
		font-size: 9px;
		max-inline-size: calc(100% - 64px);
	}

	.listings-container.new-grid-layout-nl .mf-card-body {
		flex: 1;
		padding: 14px;
	}

	.listings-container.new-grid-layout-nl .mf-card-name {
		font-size: 16px;
	}

	.listings-container.new-grid-layout-nl .mf-card-meta {
		font-size: 12px;
		white-space: normal;
	}

	.listings-container.new-grid-layout-nl .mf-card-label {
		font-size: 10px;
		padding: 4px 6px;
	}

	/* The WhatsApp circle is a phone-list shortcut; the vertical card has no room for it. */
	.listings-container.new-grid-layout-nl .mf-card-wa {
		display: none;
	}

	.listings-container.new-grid-layout-nl .mf-card-horizontal:has(.mf-card-wa) .mf-card-body {
		padding-block-end: 14px;
	}
}


/* Results v10 geometry: photo column includes its 12px margin; tight line heights. */
.mf-card-horizontal {
	grid-template-columns: 116px minmax(0, 1fr);
	line-height: 1.5;
}

.mf-card-badge {
	line-height: 1.25;
}

.mf-card-meta,
.mf-card-labels,
.mf-card-price-row {
	line-height: 1.5;
}

@media (min-width: 993px) {
	.listings-container.new-grid-layout-nl .mf-card-horizontal {
		grid-template-columns: none;
	}
}



/* ---- Equal card heights: reserved rows, one-line title and meta ---- */

.mf-card-price-row-empty,
.mf-card-labels-empty {
	display: none;
}

.mf-card-title {
	min-inline-size: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Vertical cards (homepage rails, desktop results grid): the empty rows keep
   their space so a card without a price or labels is as tall as the others. */
.mf-voir-tout-grid .mf-card-price-row-empty {
	display: block;
	min-block-size: 22px;
}

.mf-voir-tout-grid .mf-card-labels-empty {
	display: block;
	min-block-size: 26px;
}

.mf-voir-tout-grid .mf-card-meta {
	white-space: nowrap;
}

/* The WhatsApp circle belongs to the phone list card only. */
.mf-voir-tout-grid .mf-card-wa {
	display: none;
}

.mf-voir-tout-grid .mf-card-horizontal:has(.mf-card-wa) .mf-card-body {
	padding-block-end: 17px;
}

@media (min-width: 993px) {
	.listings-container.new-grid-layout-nl .mf-card-price-row-empty {
		display: block;
		min-block-size: 22px;
	}

	.listings-container.new-grid-layout-nl .mf-card-labels-empty {
		display: block;
		min-block-size: 26px;
	}

	.listings-container.new-grid-layout-nl .mf-card-meta {
		white-space: nowrap;
	}
}

/* Reserved labels row = a real chip row (28px). */
.mf-voir-tout-grid .mf-card-labels-empty {
	min-block-size: 28px;
}

@media (min-width: 993px) {
	.listings-container.new-grid-layout-nl .mf-card-labels-empty {
		min-block-size: 28px;
	}
}


/* Reserved labels row = exactly one real chip row (25px). */
.mf-voir-tout-grid .mf-card-labels-empty {
	min-block-size: 25px;
}

@media (min-width: 993px) {
	.listings-container.new-grid-layout-nl .mf-card-labels-empty {
		min-block-size: 25px;
	}
}


/* Slate verified seal (image) next to the name, Selection certifiee only. */
.mf-card-seal {
	display: block;
	flex: none;
	inline-size: 17px;
	block-size: 17px;
}

.mf-voir-tout-grid .mf-card-seal,
.listings-container.new-grid-layout-nl .mf-card-seal {
	inline-size: 18px;
	block-size: 18px;
}


/* Card title is bold in the approved design. */
.mf-card-name {
	font-weight: 700;
}



/* ==== Section F: inline-SVG icons on the card (no icon font) ==== */

.mf-card-star svg {
	display: block;
	inline-size: 13px;
	block-size: 13px;
	fill: currentColor;
}

/* Listeo's real bookmark toggle keeps its markup/classes (its AJAX handler needs
   them); the glyph is drawn from an SVG mask instead of the Font Awesome font. */
.mf-card-favorite .fa-heart {
	display: grid;
	place-items: center;
	inline-size: 100%;
	block-size: 100%;
	font-size: 0;
}

.mf-card-favorite .fa-heart::before {
	content: "";
	display: block;
	inline-size: 15px;
	block-size: 15px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mf-card-favorite .fa-solid.fa-heart::before,
.mf-card-favorite .liked::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z' fill='black'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z' fill='black'/%3E%3C/svg%3E");
}

.mf-voir-tout-grid .mf-card-favorite .fa-heart::before,
.listings-container.new-grid-layout-nl .mf-card-favorite .fa-heart::before {
	inline-size: 17px;
	block-size: 17px;
}

/* ---- Card photo dots, restyled: bottom centre, soft white dots (like the example). ---- */
.mf-card-dots {
	inset-block-start: auto;
	inset-block-end: 8px;
	gap: 5px;
}

.mf-card-dots i {
	inline-size: 6px;
	block-size: 6px;
	background: rgba(255, 255, 255, .6);
	box-shadow: 0 0 3px rgba(0, 0, 0, .3);
	transform: none;
}

.mf-card-dots i.is-active {
	background: #fff;
	transform: scale(1.2);
}


/* Heart always dead-centre in its circle, whatever display Listeo's inline style gives the toggle. */
.mf-card-favorite .fa-heart {
	position: relative;
}

.mf-card-favorite .fa-heart::before {
	position: absolute;
	inset: 0;
	margin: auto;
}

/* A saved favourite is red on every card, like the profile page's heart. */
.mf-card-favorite .listeo_core-unbookmark-it,
.mf-card-favorite .liked {
	color: #ef4055;
}

/* Phone list card: the photo is centred, so the space above and below it is equal. */
@media (max-width: 992px) {
	.mf-card-horizontal { min-height: 0; }
	.mf-card-horizontal > .mf-card-link > .mf-card-photo, .mf-card-horizontal .mf-card-photo { align-self: center; }
}
