/* =====================================================
   BM Autism Resources Directory - Frontend Styles
   Loaded only on pages with the [bm_resources] shortcode. The theme's root font-size is 62.5%,
   so 1rem = 10px; the sizes below were rewritten from 16px-based rems on 2026-09-12
   (MOBILE_REVIEW.md section 11, DG-1 to DG-7).
   ===================================================== */

/* Breadcrumb: the Yoast block in the page content, styled like the theme templates' .bmtc-breadcrumb (DG-1) */
.entry-content .yoast-breadcrumbs {
	margin: 0 0 1.2rem;
	font-size: 14px;
	line-height: 1.5;
	color: var(--color-muted, #6b6b6b);
}

.entry-content .yoast-breadcrumbs a {
	color: var(--btn-bg-primary, #007b9c);
	text-decoration: none;
}

.entry-content .yoast-breadcrumbs a:hover {
	text-decoration: underline;
}

.bm-autism-resources {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2rem 0;
}

/* "Jump to" row above the directories, pills like the theme's section nav (DG-5) */
.bm-ar-jump {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.8rem 1rem;
	margin: 0 0 2.4rem;
}

.bm-ar-jump-label {
	font-weight: 600;
	color: var(--color-muted, #6b6b6b);
}

.bm-ar-jump a {
	display: inline-flex;
	align-items: center;
	min-height: 4rem;
	padding: 0 1.4rem;
	border: 1px solid var(--border, #e6e6e6);
	border-radius: 999px;
	background-color: #fff;
	color: var(--btn-bg-primary, #007b9c);
	font-weight: 500;
	text-decoration: none;
}

.bm-ar-jump a:hover {
	border-color: var(--btn-bg-primary, #007b9c);
}

/* Section Headers (the jump targets clear the theme's 64px desktop sticky header) */
.bm-ar-section {
	margin-bottom: 4rem;
	scroll-margin-top: 90px;
}

.bm-ar-section-title {
	font-size: clamp(2.6rem, 4vw, 3.2rem);
	line-height: 1.2;
	color: var(--wp--preset--color--heading, #004e66);
	margin-bottom: 1.6rem;
	padding-bottom: 0.8rem;
	border-bottom: 3px solid var(--wp--preset--color--brand, #007b9c);
}

/* Listings Grid: one column on phones, two from 601px (DG-4) */
.bm-ar-listings {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2rem;
	margin-top: 2rem;
}

@media (min-width: 601px) {
	.bm-ar-listings {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 601px) and (max-width: 1000px) {
	.bm-ar-listings {
		gap: 1.6rem;
	}
}

/* Desktop (above 1000px): the page's primary column widens from the parent theme's 70% / 830px to 1,200px and the
   listings fill it, up to four per row (three at 1024) (DG-7, raised by Damian). body #primary outranks the parent's
   #primary, whose stylesheet loads after this one; this file only loads on pages with the shortcode, so no other page
   widens. */
@media (min-width: 1001px) {
	body #primary {
		width: 100%;
		max-width: 1200px;
	}

	.bm-ar-listings {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
	}
}

/* Individual Listing Card */
.bm-ar-listing {
	min-width: 0; /* long emails and names wrap instead of widening the grid track */
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 2rem;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bm-ar-listing:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

/* Header */
.bm-ar-listing-header {
	margin-bottom: 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #f0f0f0;
}

.bm-ar-category {
	display: inline-block;
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--wp--preset--color--brand, #007b9c);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.bm-ar-clinic-name {
	font-size: 2rem;
	margin: 0.5rem 0 0;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.bm-ar-clinic-name a {
	color: var(--wp--preset--color--heading, #004e66);
	text-decoration: none;
	transition: color 0.2s ease;
}

.bm-ar-clinic-name a:hover {
	color: var(--wp--preset--color--brand, #007b9c);
	text-decoration: underline;
}

/* Details Section */
.bm-ar-listing-details {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.bm-ar-listing-details > div {
	display: flex;
	align-items: flex-start;
	font-size: 1.6rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

/* Row icons: inline SVG line icons in the brand teal (DG-6) */
.bm-ar-icon {
	flex-shrink: 0;
	width: 2rem;
	height: 2rem;
	margin: 0.2rem 1rem 0 0;
	color: var(--wp--preset--color--brand, #007b9c);
}

.bm-ar-address,
.bm-ar-phone,
.bm-ar-email,
.bm-ar-fax {
	color: #555;
}

.bm-ar-phone a,
.bm-ar-email a {
	color: var(--wp--preset--color--brand, #007b9c);
	text-decoration: none;
	transition: color 0.2s ease;
}

.bm-ar-phone a:hover,
.bm-ar-email a:hover {
	color: var(--wp--preset--color--brand-dark, #005f73);
	text-decoration: underline;
}

/* Phones: compact cards, the category label hidden since the section heading names it (DG-3) */
@media (max-width: 600px) {
	.bm-autism-resources {
		padding-top: 0.8rem;
	}

	.bm-ar-section {
		margin-bottom: 3.2rem;
	}

	.bm-ar-listings {
		gap: 1rem;
		margin-top: 1.6rem;
	}

	.bm-ar-listing {
		padding: 1.6rem;
	}

	.bm-ar-category {
		display: none;
	}

	.bm-ar-clinic-name {
		margin: 0;
		font-size: 1.8rem;
	}

	.bm-ar-listing-header {
		margin-bottom: 0.8rem;
		padding-bottom: 0.8rem;
	}

	.bm-ar-listing-details {
		gap: 0.4rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bm-ar-listing,
	.bm-ar-clinic-name a,
	.bm-ar-phone a,
	.bm-ar-email a {
		transition: none;
	}

	.bm-ar-listing:hover {
		transform: none;
	}
}

/* Print Styles */
@media print {
	.bm-ar-jump {
		display: none;
	}

	.bm-ar-listing {
		page-break-inside: avoid;
		border: 1px solid #ccc;
		box-shadow: none;
	}

	.bm-ar-clinic-name a {
		color: #000;
	}

	.bm-ar-phone a::after {
		content: " (" attr(href) ")";
		font-size: 1.4rem;
	}
}
