/*
 * MX Social — where content sits on phones (loaded from social/partials/top-nav, after mx-social-readability.css).
 * Track page: action row under the name, shorter hero, hours and contacts before the long sections.
 * Home: search results before "Near me" and the filters, a useful empty state, no duplicate result list.
 * Desktop layouts are left as they are.
 */

/* ---- Track page: phone action row (book / directions / phone) ---- */
body.mx-social-app .mx-quick-actions {
	display: none;
}

@media (max-width: 720px) {
	body.mx-social-app .mx-quick-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 8px;
		margin: 12px 0 4px;
	}

	body.mx-social-app .mx-quick-actions__btn {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 48px;
		padding: 10px 12px;
		border-radius: 12px;
		border: 1px solid var(--border-subtle, #d9e2d0);
		background: var(--bg-elevated, #fff);
		color: var(--text-main, #111827);
		font-weight: 600;
		line-height: 1.2;
		text-align: center;
		text-decoration: none;
	}

	body.mx-social-app .mx-quick-actions__btn--primary {
		grid-column: 1 / -1;
		background: #a3e635;
		border-color: #a3e635;
		color: #111827;
		font-size: 1.0625rem;
	}

	/* A lone secondary button takes the whole row. */
	body.mx-social-app .mx-quick-actions__btn--primary + .mx-quick-actions__btn:last-child,
	body.mx-social-app .mx-quick-actions__btn:only-child {
		grid-column: 1 / -1;
	}

	/* The row replaces the booking button inside the hero. */
	body.mx-social-app .detail-hero .btn-book-day--hero {
		display: none !important;
	}

	/* Shorter hero: photo 150px, logo 120px, plain background 72px (all were 200px). */
	body.mx-social-app.mx-social-pro .detail-hero img.detail-hero-img {
		height: 150px;
	}

	body.mx-social-app.mx-social-pro .detail-hero .detail-hero-fallback {
		height: 72px;
	}

	body.mx-social-app.mx-social-pro .detail-hero.is-logo-hero img.detail-hero-img {
		height: 120px;
	}

	/* Name once: h1 first, then the club line; the brand card loses the repeated name and logo, "MX track" stays as a chip. */
	body.mx-social-app .detail-hero .detail-hero-overlay {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
	}

	body.mx-social-app .detail-hero-overlay h1 {
		order: -1;
	}

	body.mx-social-app .detail-hero-overlay .mx-office-brand {
		background: none;
		border: 0;
		box-shadow: none;
		padding: 0;
		margin: 0 0 8px;
	}

	body.mx-social-app .detail-hero-overlay .mx-office-brand__avatar,
	body.mx-social-app .detail-hero-overlay .mx-office-brand__meta strong,
	body.mx-social-app .detail-hero-overlay .seo-eyebrow {
		display: none;
	}

	/* Hours, contacts and training days come before description, reviews and track data. */
	body.mx-social-app .detail-grid {
		display: flex;
		flex-direction: column;
	}

	body.mx-social-app .detail-grid > aside.detail-card {
		order: -1;
	}

	/* "No training days" with nothing to do about it: not shown on phones. */
	body.mx-social-app .mx-book-side--empty {
		display: none;
	}
}

/* ---- Home: search results first on one-column layouts ---- */
@media (max-width: 1180px) {
	body.mx-social-app .panel-left.is-searching #sidebarTracksView {
		order: -1;
	}

	body.mx-social-app .panel-left.is-searching .sidebar-view.is-active {
		min-height: 0;
	}
}

/* The crawler copy of the results is hidden once the live list is on screen. */
html.mx-js-ready .mx-seo-search {
	display: none;
}

/* ---- Home: empty search ---- */
body.mx-social-app .track-list-empty--search {
	text-align: center;
}

body.mx-social-app .track-list-empty__title {
	margin: 0 0 4px;
	font-weight: 600;
}

body.mx-social-app .track-list-empty__hint {
	margin: 0;
}

body.mx-social-app .track-list-empty__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

body.mx-social-app .track-list-empty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 8px 14px;
	border-radius: 12px;
	border: 1px solid var(--border-subtle, #d9e2d0);
	background: var(--bg-elevated, #fff);
	color: var(--text-main, #111827);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

body.mx-social-app .track-list-empty__btn--primary {
	background: #a3e635;
	border-color: #a3e635;
	color: #111827;
}

/* ---- D1: track page header and two columns (all widths) ---- */
/* No browse sidebar on the track page: the detail takes the full width, the sponsor moves under the side card. */
body.mx-social-pro .layout.mx-track-layout {
	display: block;
}

body.mx-social-app .mx-track-back {
	display: inline-block;
	margin: 0 0 10px;
	font-weight: 600;
	color: var(--mx-read-blue, #0369a1);
	text-decoration: none;
}

body.mx-social-app .mx-track-back:hover {
	text-decoration: underline;
}

html.theme-dark body.mx-social-app .mx-track-back,
body.mx-social-app.theme-dark .mx-track-back {
	color: #7dd3fc;
}

body.mx-social-app .mx-track-head {
	overflow: hidden;
	margin-bottom: 16px;
	border-radius: 18px;
	border: 1px solid var(--border-subtle, #d9e2d0);
	background: #111827;
	color: #f9fafb;
}

/* Proposal 2: the manager's own photo on top, only when there is one. */
body.mx-social-app .mx-track-head__cover {
	display: block;
	width: 100%;
	height: 240px;
	object-fit: cover;
}

body.mx-social-app .mx-track-head__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px 24px;
	padding: 20px 22px;
}

body.mx-social-app .mx-track-head__id {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	min-width: 0;
	flex: 1 1 420px;
}

body.mx-social-app .mx-track-head__logo {
	flex: 0 0 auto;
	width: 72px;
	height: 72px;
	object-fit: contain;
	padding: 6px;
	border-radius: 14px;
	background: #fff;
}

body.mx-social-app .mx-track-head__text {
	min-width: 0;
}

body.mx-social-app .mx-track-head .seo-eyebrow {
	margin: 0 0 2px;
	color: #bef264 !important;
}

body.mx-social-pro .mx-track-head h1 {
	margin: 0 0 6px;
	color: #fff !important;
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	line-height: 1.15;
}

body.mx-social-app .mx-track-head__meta {
	margin: 0 0 10px;
	color: #e5e7eb;
	font-size: 0.95rem;
}

body.mx-social-app .mx-track-head__meta > * + *::before {
	content: "·";
	display: inline-block;
	margin: 0 0.45em;
	color: #9ca3af;
	text-decoration: none;
}

body.mx-social-app .mx-track-head__meta a {
	color: #e5e7eb;
	text-decoration: underline;
	text-underline-offset: 3px;
}

body.mx-social-app .mx-track-head .chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

body.mx-social-app .mx-track-head .chip:not(.chip--rating) {
	padding: 4px 10px;
	border-radius: 999px;
	border: 0;
	background: #fff;
	color: #111827 !important;
	font-weight: 700;
}

body.mx-social-app .mx-track-head__actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	flex: 0 1 300px;
}

body.mx-social-pro .mx-track-head .mx-track-head__primary {
	display: flex;
	justify-content: center;
	margin: 0;
	width: 100%;
	text-align: center;
}

body.mx-social-app .mx-track-head__secondary {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

body.mx-social-app .mx-track-head__secondary .mx-share {
	display: contents;
}

body.mx-social-pro .mx-track-head .mx-share__btn:not(.mx-share__btn--wa),
body.mx-social-app .mx-track-head .mx-fav {
	min-height: 36px;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 0.82rem;
	font-weight: 600;
}

/* Two columns: track, reviews and data on the left; hours, contacts, days and the sponsor on the right. */
@media (min-width: 721px) {
	body.mx-social-pro .mx-track-layout .detail-grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
		grid-template-rows: auto 1fr;
		align-items: start;
		gap: 16px 20px;
	}

	body.mx-social-pro .mx-track-layout .detail-grid > article.detail-card {
		grid-column: 1;
		grid-row: 1 / span 2;
	}

	body.mx-social-pro .mx-track-layout .detail-grid > aside.detail-card {
		grid-column: 2;
		grid-row: 1;
	}

	body.mx-social-pro .mx-track-layout .mx-track-sponsor {
		grid-column: 2;
		grid-row: 2;
	}
}

/* The sponsor card sits in the side column, so it is always shown (the old 3-column page hid it on small screens). */
body.mx-social-pro .mx-track-sponsor .panel-right {
	display: block !important;
	position: static;
	width: auto;
}

@media (max-width: 720px) {
	body.mx-social-app .mx-track-head__cover {
		height: 150px;
	}

	body.mx-social-app .mx-track-head__bar {
		padding: 16px;
	}

	body.mx-social-app .mx-track-head__logo {
		width: 56px;
		height: 56px;
	}

	/* The phone action row (P1) already has booking and directions. */
	body.mx-social-app .mx-track-head .mx-track-head__primary,
	body.mx-social-app .mx-track-head__secondary > a.mx-share__btn {
		display: none;
	}

	body.mx-social-app .mx-track-head__actions {
		flex-basis: 100%;
	}

	/* Phone order: header, hours and contacts, the track, reviews, then the sponsor last. */
	body.mx-social-app .mx-track-layout .mx-track-sponsor {
		order: 1;
	}
}

/* ---- D4: one navigation on the home ---- */
/* The left menu is gone: the top bar is the only menu, the page takes the full width. */
body.mx-social-hub .mx-pro-shell {
	grid-template-columns: minmax(0, 1fr);
}

body.mx-social-app .mx-pro-hero-stats {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 18px;
	margin-top: 16px;
}

body.mx-social-app .mx-pro-hero-stat {
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid var(--border-subtle, #d9e2d0);
	background: var(--bg-elevated, #fff);
	color: var(--text-main, #111827);
	font-size: 0.95rem;
}

body.mx-social-app .mx-pro-hero-stat strong {
	font-size: 1.1rem;
}

body.mx-social-app .mx-pro-hero-report {
	color: var(--mx-read-blue, #0369a1);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

html.theme-dark body.mx-social-app .mx-pro-hero-report,
body.mx-social-app.theme-dark .mx-pro-hero-report {
	color: #7dd3fc;
}

/* "Rider area" in the top bar replaces the plain login link: same place, clearer target. */
body.mx-social-pro .mx-pro-login-link {
	font-weight: 700;
}
