/* Section 4 · Conditions slider  (template-parts/home/specialities.php + cards/speciality.php)
   Base (no JS / reduce motion / animations off): swipeable row (mobile) or 2-column grid (desktop).
   .js-vs (added by motion.js on desktop AND mobile): pinned stage, slides rise one over another.
     Desktop → list of names on the left.  Mobile → compact "01 / 06" counter + progress line. */
.vs { background: var(--bg-2); border-radius: var(--r-lg); padding: clamp(72px, 9vw, 120px) 0; overflow: hidden; }
.vs-pin { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.vs-left .lede { margin-top: 22px; }
.vs-all { margin-top: 28px; }
.vs-nav, .vs-progress { display: none; }

/* ----- Without the pinned effect ----- */
.vs-stage { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(300px, 78%); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 14px; scrollbar-width: thin; }
.vs-slide { scroll-snap-align: start; min-height: 460px; }
.vs-slide .media { min-height: 220px; }
@media (min-width: 901px) {
	html:not(.js-vs) .vs-pin { align-items: start; }
	html:not(.js-vs) .vs-left { position: sticky; top: calc(var(--header-h) + var(--admin-bar) + 32px); }
	html:not(.js-vs) .vs-stage { grid-auto-flow: row; grid-template-columns: 1fr 1fr; overflow: visible; padding: 0; }
	html:not(.js-vs) .vs-slide { min-height: 0; }
}
@media (max-width: 900px) {
	.vs-pin { grid-template-columns: 1fr; }
	.vs-stage { grid-auto-columns: 86%; margin-right: calc(-1 * clamp(20px, 4vw, 48px)); padding-right: clamp(20px, 4vw, 48px); }
	.vs-slide { min-height: 420px; }
	.vs-slide .media { min-height: 200px; }
}
@media (max-width: 480px) { .spec-body { grid-template-columns: 1fr; } .spec-body .round-link { display: none; } }

/* ----- Pinned version (shared) ----- */
.js-vs .vs { padding: 0; }
.js-vs .vs-pin { height: 100vh; height: 100svh; padding-top: calc(var(--header-h) + var(--admin-bar)); padding-bottom: 24px; }
.js-vs .vs-stage { display: block; position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 0; margin: 0; scroll-snap-type: none; }
.js-vs .vs-slide { position: absolute; inset: 0; min-height: 0; will-change: transform; transform-origin: center top; }

/* ----- Pinned: desktop ----- */
@media (min-width: 901px) {
	.js-vs .vs-stage { height: min(72vh, 640px); }
	.js-vs .vs-nav { display: block; list-style: none; margin: 40px 0 0; padding: 0; border-left: 1px solid var(--line); position: relative; }
	.vs-nav button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 0 10px 24px; font: 500 1.08rem/1.3 var(--font-body); color: var(--muted); cursor: pointer; transition: color .3s; min-height: 44px; }
	.vs-nav button:hover { color: var(--ink); }
	.vs-nav button.on { color: var(--ink); font-weight: 600; }
	.vs-bar { position: absolute; left: -1px; top: 0; width: 2px; height: 0; background: var(--ink); }
}

/* ----- Pinned: mobile / tablet ----- */
@media (max-width: 900px) {
	.js-vs .vs-pin {
		display: flex; flex-direction: column; align-items: stretch; gap: 14px;
		padding-top: calc(var(--header-h) + var(--admin-bar) + 12px);
		padding-bottom: calc(var(--mbar-space, 0px) + 14px); /* room for the floating Call/WhatsApp/Book bar (if on) */
	}
	.js-vs .vs-left { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 16px; }
	.js-vs .vs-left h2, .js-vs .vs-left .lede { grid-column: 1 / -1; }
	.js-vs .vs-left h2 { font-size: clamp(1.9rem, 8vw, 2.6rem); }
	.js-vs .vs-left .lede { margin-top: 8px; font-size: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.js-vs .vs-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; min-width: 0; }
	.vs-num { font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
	.vs-num b { color: var(--ink); font-weight: 700; }
	.vs-track { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; min-width: 40px; }
	.vs-track i { display: block; height: 100%; width: 100%; background: var(--ink); transform-origin: left; transform: scaleX(0); }
	.js-vs .vs-all { margin-top: 14px; font-size: .95rem; }
	.js-vs .vs-stage { flex: 1; min-height: 0; border-radius: var(--r-md); }
	.js-vs .vs-slide { grid-template-rows: minmax(100px, 1fr) auto; border-radius: var(--r-md); }
	.js-vs .vs-slide .media { min-height: 0; }
	.js-vs .vs-slide .spec-body { padding: 20px; gap: 10px 16px; }
	.js-vs .vs-slide .spec-body p { margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
/* Shorter phones: hide the intro line and trim the card text */
@media (max-width: 900px) and (max-height: 740px) {
	.js-vs .vs-left .lede { display: none; }
	.js-vs .vs-slide .spec-body p { -webkit-line-clamp: 2; }
	.js-vs .vs-slide .tags li:nth-child(n+4) { display: none; }
}
