/*
 * Local Directory — page template + single post styles.
 * Loaded for: page-templates/external-links.php AND singular sd_external_link.
 */

/* ─── Brand tokens ───────────────────────────────────────────────────────────── */

:root {
	--dir-orange: rgb(242, 143, 13);
	--dir-dark:   #3a3a3a;
	--dir-muted:  #5f5f5f;
	--dir-white:  #fff;
}

/* ─── Shared utility ─────────────────────────────────────────────────────────── */

.hpa-wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Local Directory listing page
   ───────────────────────────────────────────────────────────────────────────── */

.sd-directory {
	padding: 60px 0 80px;
}

.sd-directory__header {
	text-align: center;
	margin-bottom: 40px;
}

.sd-directory__title {
	font-family: "Manrope", system-ui, sans-serif;
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	font-weight: 800;
	color: var(--dir-dark);
	margin: 0 0 12px;
}

.sd-directory__intro {
	font-size: 1rem;
	line-height: 1.7;
	color: var(--dir-muted);
	max-width: 600px;
	margin: 0 auto;
}

/* Filters */

.sd-directory__filter-wrap {
	margin-bottom: 36px;
}

.sd-directory__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.sd-directory__filter {
	font-family: "Manrope", system-ui, sans-serif;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 7px 16px;
	border: 2px solid rgba(0,0,0,0.12);
	border-radius: 100px;
	background: transparent;
	color: var(--dir-dark);
	cursor: pointer;
	transition: background 180ms, border-color 180ms, color 180ms;
}

.sd-directory__filter:hover,
.sd-directory__filter.is-active {
	background: var(--dir-orange);
	border-color: var(--dir-orange);
	color: #fff;
}

/* Grid — Isotope masonry with sizer elements */

.sd-directory__grid {
	padding-top: 4px;
}

/* Sizer elements: Isotope reads width only, zero-height */
.sd-grid-sizer,
.sd-directory__card {
	width: calc(33.333% - 16px);
}

.sd-gutter-sizer {
	width: 24px;
}

/* =====================================================================
   KNOWN ISSUE & FIX — Directory grid "jitter" on filter (June 2026)
   ---------------------------------------------------------------------
   SYMPTOM: clicking a filter button made the cards animate into place,
   visibly jump out of line, then snap back — a flickering/jitter glitch.

   CAUSE: the card's `transform` was being driven by THREE things at once —
     1. Isotope's layout animation (it moves items with `transform`),
     2. the `:hover` lift (`transform: translateY(-4px)`),
     3. a CSS `transition: transform 200ms` tying them together.
   When a card slid under the cursor mid-filter, `:hover` fired and its
   transform hijacked Isotope's in-flight layout transform → the jump.

   FIX: give Isotope sole ownership of the card's transform. The <article>
   (= the Isotope item) now carries NO transform/transition. All visuals
   and the hover lift moved to an inner wrapper, `.sd-directory__card-inner`
   (added in page-templates/external-links.php), whose transform can never
   collide with Isotope's. DO NOT put transform or a transform transition
   back on `.sd-directory__card` — that reintroduces the jitter.
   ===================================================================== */
.sd-directory__card {
	margin-bottom: 24px;
}

.sd-directory__card-inner {
	background: var(--dir-white);
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid rgba(0,0,0,0.06);
	box-shadow: 0 2px 12px rgba(0,0,0,0.04);
	transition: transform 200ms ease, box-shadow 200ms ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.sd-directory__card-inner:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.sd-directory__card-img-link {
	display: block;
}

.sd-directory__card-img-link:hover {
	opacity: 0.9;
}

.sd-directory__card-img img {
	display: block;
	width: 100%;
	height: auto;
}

.sd-directory__card-title a {
	color: inherit;
	text-decoration: none;
}

.sd-directory__card-title a:hover {
	color: var(--dir-orange);
}

.sd-directory__promo-badge {
	background: var(--dir-orange);
	color: #fff;
	font-family: "Manrope", system-ui, sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 6px 14px;
}

.sd-directory__card-body {
	padding: 18px 20px 22px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.sd-directory__card-type {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--dir-orange);
	margin: 0 0 6px;
}

.sd-directory__card-title {
	font-family: "Manrope", system-ui, sans-serif;
	font-size: 1rem;
	font-weight: 700;
	color: var(--dir-dark);
	margin: 0 0 10px;
}

.sd-directory__card-text {
	font-size: 0.875rem;
	line-height: 1.65;
	color: var(--dir-muted);
	flex: 1;
	margin-bottom: 16px;
}

.sd-directory__card-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: auto;
}

.sd-directory__card-more {
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--dir-dark);
	text-decoration: none;
	border-bottom: 2px solid var(--dir-orange);
	padding-bottom: 1px;
	transition: color 150ms;
}

.sd-directory__card-more:hover {
	color: var(--dir-orange);
}

.sd-directory__card-link {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--dir-muted);
	text-decoration: none;
	transition: color 150ms;
}

.sd-directory__card-link:hover {
	color: var(--dir-orange);
}

/* Responsive */

@media (max-width: 900px) {
	.sd-grid-sizer,
	.sd-directory__card {
		width: calc(50% - 12px);
	}
}

@media (max-width: 580px) {
	.sd-grid-sizer,
	.sd-directory__card {
		width: 100%;
	}
	.sd-gutter-sizer {
		width: 0;
	}
	.sd-directory__filters {
		justify-content: flex-start;
	}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Single Local Business
   ───────────────────────────────────────────────────────────────────────────── */

.sd-business-hero {
	position: relative;
	height: clamp(280px, 40vw, 480px);
	overflow: hidden;
}

.sd-business-hero__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sd-business-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}

.sd-business-hero__content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding-top: 28px;
	padding-bottom: 32px;
	/* Align with .wrap: centres a 1100px column then adds 20px inner padding */
	padding-left: max(20px, calc((100% - 1100px) / 2 + 20px));
	padding-right: max(20px, calc((100% - 1100px) / 2 + 20px));
}

.sd-business-hero__type {
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--dir-orange);
	margin: 0 0 8px;
}

.sd-business-hero__title {
	font-family: "Manrope", system-ui, sans-serif;
	font-size: clamp(1.6rem, 4vw, 2.8rem);
	font-weight: 800;
	color: #fff;
	margin: 0;
	line-height: 1.1;
}

.sd-business-header {
	padding: 48px 0 12px;
}

.sd-business-header__type {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--dir-orange);
	margin: 0 0 10px;
}

.sd-business-header__title {
	font-family: "Manrope", system-ui, sans-serif;
	font-size: clamp(1.6rem, 4vw, 2.8rem);
	font-weight: 800;
	color: var(--dir-dark);
	margin: 0;
}

.sd-business-layout {
	padding-top: 40px;    /* Longhand so .wrap's padding: 0 20px side values aren't overridden */
	padding-bottom: 80px;
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 56px;
	align-items: start;
}

@media (max-width: 860px) {
	.sd-business-layout {
		grid-template-columns: 1fr;
		gap: 48px;
	}
}

/* ── Related businesses sidebar ──────────────────────────────── */

.sd-business-related {
	border-top: 1px solid #eee;
	padding: 48px 0 80px;
}

.sd-related__heading {
	font-family: "Manrope", system-ui, sans-serif;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--dir-muted);
	margin: 0 0 24px;
}

.sd-related__list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

@media (max-width: 700px) {
	.sd-related__list {
		grid-template-columns: 1fr;
	}
}

.sd-related-card {
	display: block;
}

/* Cards in the related section size to their content */
.sd-business-related .sd-directory__card-inner {
	height: auto;
}

.sd-business-promo {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--dir-orange);
	color: #fff;
	font-family: "Manrope", system-ui, sans-serif;
	font-size: 0.85rem;
	font-weight: 700;
	border-radius: 8px;
	padding: 10px 18px;
	margin-bottom: 28px;
}

.sd-business-body {
	font-size: 1rem;
	line-height: 1.75;
	color: var(--dir-dark);
	margin-bottom: 32px;
}

.sd-business-body p { margin: 0 0 1em; }
.sd-business-body p:last-child { margin-bottom: 0; }

.sd-business-actions {
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}

.sd-business-actions__back {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--dir-muted);
	text-decoration: none;
	transition: color 150ms;
}

.sd-business-actions__back:hover {
	color: var(--dir-dark);
}

.sd-business-visit-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--dir-orange);
	color: #fff;
	font-family: "Manrope", system-ui, sans-serif;
	font-size: 0.85rem;
	font-weight: 700;
	border-radius: 8px;
	padding: 12px 22px;
	text-decoration: none;
	transition: opacity 150ms;
}

.sd-business-visit-btn:hover {
	opacity: 0.88;
	color: #fff;
}

/* ── Sidebar map ─────────────────────────────────────────────────── */

.sd-entry-map-wrap {
	margin-bottom: 32px;
}

#sd-entry-map {
	width: 100%;
	height: 320px;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

.sd-entry-map__legend {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 10px;
	margin-bottom: 0;
}
