/*
 * Canada Cool & Heat Directory — public styles.  [build: BTNFIX-2]
 *
 * Trust & Authority + Minimal: restrained surfaces, one accent, real borders.
 * A medical directory has to read as credible, so there are no gradients,
 * no glass, and no decorative motion.
 *
 * Everything is scoped under .chd and driven by custom properties, so the
 * host theme keeps its own typography and a site owner can retheme the whole
 * directory by overriding --chd-accent.
 */

.chd {
	--chd-ink: #0f172a;
	--chd-body: #334155;
	--chd-muted: #64748b;
	--chd-line: #e2e8f0;
	--chd-line-strong: #cbd5e1;
	--chd-surface: #ffffff;
	--chd-ground: #f8fafc;

	/* Overridable from Settings; 4.6:1 on white, so links and buttons pass. */
	--chd-accent: #0e7490;
	--chd-accent-ink: #ffffff;
	--chd-accent-dark: #0b5566;
	--chd-success: #047857;
	--chd-danger: #b91c1c;

	--chd-radius: 10px;
	--chd-radius-sm: 6px;
	--chd-gap: 20px;

	--chd-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);

	color: var(--chd-body, #334155);
	max-width: 1200px;
	margin-inline: auto;
	padding: 24px 16px 48px;
	line-height: 1.6;
	container-type: inline-size;
}

.chd *,
.chd *::before,
.chd *::after {
	box-sizing: border-box;
}

.chd :where(h1, h2, h3) {
	color: var(--chd-ink, #0f172a);
	line-height: 1.25;
	margin: 0 0 .4em;
	text-wrap: balance;
}

.chd-h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); font-weight: 700; letter-spacing: -.01em; }
.chd-h2 { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); font-weight: 650; }
.chd-h3 { font-size: 1.05rem; font-weight: 650; }

.chd p { margin: 0 0 1em; }
.chd p:last-child { margin-bottom: 0; }

/*
 * :where() contributes no specificity, which keeps this rule at one class.
 * Written as `.chd a` it scored higher than `.chd-btn-primary` and painted
 * every anchor button's text in the accent colour — the same colour as the
 * primary button's background, so the phone number was invisible.
 */
/*
 * `:not(.chd-btn)` is the load-bearing part.
 *
 * A button whose own `color` fails to compute — which happens whenever
 * --chd-accent-ink is defined but empty, as an untouched Elementor colour
 * control leaves it — inherits instead. Without this exclusion it inherited
 * the accent and painted accent text on an accent background: an invisible
 * phone number. With it, the worst case is body ink on the accent, which is
 * still readable.
 */
.chd :where(a:not(.chd-btn)) { color: var(--chd-accent); text-underline-offset: 2px; }
.chd :where(a:not(.chd-btn)):hover { color: var(--chd-accent-dark); }

/* One visible, consistent focus ring everywhere. */
.chd :where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--chd-accent);
	outline-offset: 2px;
	border-radius: var(--chd-radius-sm);
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* --- Breadcrumbs ------------------------------------------------------- */

.chd-breadcrumbs { margin-bottom: 16px; font-size: .82rem; }
.chd-breadcrumbs ol {
	display: flex; flex-wrap: wrap; align-items: center;
	gap: 6px; list-style: none; margin: 0; padding: 0;
}
.chd-breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.chd-breadcrumbs li + li::before {
	content: "/";
	color: var(--chd-line-strong);
}
.chd-breadcrumbs [aria-current] { color: var(--chd-muted); }

/* --- Page head --------------------------------------------------------- */

.chd-page-head { margin-bottom: 20px; }
.chd-lede { color: var(--chd-muted); font-size: 1rem; max-width: 68ch; }
.chd-lede strong { color: var(--chd-ink, #0f172a); }

/* --- Filters ----------------------------------------------------------- */

.chd-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: end;
	padding: 16px;
	background: var(--chd-ground);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
	margin-bottom: 20px;
}

.chd-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.chd-field-grow { flex: 1 1 260px; }
.chd-field-actions { flex-direction: row; gap: 8px; align-items: center; }

.chd-field label {
	font-size: .8rem;
	font-weight: 600;
	color: var(--chd-ink, #0f172a);
}

.chd :where(input[type="text"], input[type="search"], input[type="tel"],
	input[type="url"], input[type="email"], select, textarea) {
	width: 100%;
	/* 16px prevents iOS Safari from zooming the viewport on focus. */
	font-size: 16px;
	font-family: inherit;
	color: var(--chd-ink, #0f172a);
	background: var(--chd-surface);
	border: 1px solid var(--chd-line-strong);
	border-radius: var(--chd-radius-sm);
	padding: 10px 12px;
	min-height: 44px;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.chd :where(input, select, textarea):hover { border-color: var(--chd-muted); }
.chd :where(input, select, textarea):focus {
	border-color: var(--chd-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--chd-accent) 18%, transparent);
	outline: none;
}
.chd textarea { min-height: 96px; resize: vertical; line-height: 1.55; }

.chd-help, .chd-fineprint { font-size: .8rem; color: var(--chd-muted); }
.chd-req { color: var(--chd-danger); }

/* --- Buttons ----------------------------------------------------------- */

.chd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 44px;
	padding: 10px 16px;
	font-size: .9rem;
	font-weight: 600;
	font-family: inherit;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	border: 1px solid transparent;
	border-radius: var(--chd-radius-sm);
	transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

/* Some themes set -webkit-text-fill-color for gradient headings; it beats
   `color` outright, so buttons say plainly that they do not want it. */
.chd .chd-btn { -webkit-text-fill-color: currentColor; }

.chd .chd-btn.chd-btn-primary {
	background: var(--chd-accent);
	border-color: var(--chd-accent);
	color: var(--chd-accent-ink, #ffffff);
}
.chd .chd-btn.chd-btn-primary:hover { background: var(--chd-accent-dark); border-color: var(--chd-accent-dark); color: var(--chd-accent-ink, #ffffff); }

.chd .chd-btn.chd-btn-outline {
	background: var(--chd-surface);
	border-color: var(--chd-line-strong);
	color: var(--chd-ink, #0f172a);
}
.chd .chd-btn.chd-btn-outline:hover { border-color: var(--chd-accent); color: var(--chd-accent); }

.chd .chd-btn.chd-btn-quiet { background: transparent; border-color: var(--chd-line-strong); color: var(--chd-body, #334155); }
.chd .chd-btn.chd-btn-quiet:hover { background: var(--chd-ground); color: var(--chd-ink, #0f172a); }

.chd-btn-block { width: 100%; }
.chd-btn-lg { min-height: 50px; padding: 12px 24px; font-size: 1rem; }

.chd-icon { flex: none; }

/* --- Layout ------------------------------------------------------------ */

.chd-layout { display: grid; gap: var(--chd-gap); align-items: start; }
.chd-layout.has-map { grid-template-columns: minmax(0, 1fr); }

@media (min-width: 900px) {
	.chd-layout.has-map { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); }
}

/*
 * The map rail fills the viewport and stays put while the results scroll
 * past it. --chd-sticky-top is what a fixed theme header needs; the admin
 * bar adds its own 32px on top of that.
 */
.chd {
	--chd-sticky-top: 20px;
	--chd-sticky-gap: 24px;
}

.chd-results-col { min-width: 0; }

.chd-map-sticky {
	position: sticky;
	top: var(--chd-sticky-top);
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: calc(100vh - var(--chd-sticky-top) - var(--chd-sticky-gap));
}

.admin-bar .chd { --chd-sticky-top: 52px; }

@media screen and (max-width: 782px) {
	.admin-bar .chd { --chd-sticky-top: 66px; }
}

/* The map takes whatever height the rail has left after the note line. */
.chd-map-sticky .chd-map {
	flex: 1 1 auto;
	height: auto;
	min-height: 320px;
}

/* --- Result cards ------------------------------------------------------ */

.chd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.chd-card {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: space-between;
	align-items: center;
	padding: 16px 18px;
	background: var(--chd-surface);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
	box-shadow: var(--chd-shadow);
	/* Colour and border only — never a transform, which would shift the row. */
	transition: border-color .18s ease, box-shadow .18s ease;
}

.chd-card:hover {
	border-color: var(--chd-line-strong);
	box-shadow: 0 2px 6px rgba(15, 23, 42, .07), 0 4px 12px rgba(15, 23, 42, .05);
}

.chd-card.is-claimed { border-left: 3px solid var(--chd-success); }

.chd-card-main { flex: 1 1 260px; min-width: 0; }
.chd-card-title { font-size: 1.08rem; font-weight: 650; margin: 0 0 6px; }
.chd-card-title a { text-decoration: none; color: var(--chd-ink, #0f172a); }
.chd-card-title a:hover { color: var(--chd-accent); text-decoration: underline; }

.chd-card-meta {
	display: flex; flex-wrap: wrap; gap: 6px;
	margin: 0 0 8px;
}

.chd-card-line {
	display: flex; align-items: flex-start; gap: 7px;
	margin: 0; font-size: .88rem; color: var(--chd-muted);
}
.chd-card-line .chd-icon { margin-top: 3px; }

.chd-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.chd-chip {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 3px 10px;
	font-size: .74rem; font-weight: 600;
	letter-spacing: .01em;
	color: var(--chd-body, #334155);
	background: var(--chd-ground);
	border: 1px solid var(--chd-line);
	border-radius: 999px;
}
.chd-chip-verified { color: var(--chd-success); border-color: color-mix(in srgb, var(--chd-success) 30%, var(--chd-line)); }
.chd-chip-link { text-decoration: none; }
.chd-chip-link:hover { border-color: var(--chd-accent); color: var(--chd-accent); }

.chd-empty {
	padding: 32px 20px;
	text-align: center;
	background: var(--chd-ground);
	border: 1px dashed var(--chd-line-strong);
	border-radius: var(--chd-radius);
}

/* --- Map --------------------------------------------------------------- */

.chd-map {
	/* Height is reserved up front so tiles loading never shifts the page. */
	height: 460px;
	background: var(--chd-ground);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
	overflow: hidden;
}
.chd-map-single { height: 340px; }

.chd-map-fallback { padding: 16px; color: var(--chd-muted); font-size: .88rem; }
.chd-map-note { margin: 0; font-size: .8rem; color: var(--chd-muted); min-height: 1.2em; flex: none; }

/* Bar that appears once the results are following the map. */
.chd-syncbar {
	display: none;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 12px;
	padding: 10px 14px;
	font-size: .86rem;
	background: var(--chd-ground);
	border: 1px solid var(--chd-line);
	border-left: 3px solid var(--chd-accent);
	border-radius: var(--chd-radius-sm);
}
.chd-syncbar.is-on { display: flex; }
.chd-syncbar strong { color: var(--chd-ink, #0f172a); font-variant-numeric: tabular-nums; }

.chd-syncbar button {
	min-height: 36px;
	padding: 7px 13px;
	font: inherit;
	font-size: .82rem;
	font-weight: 600;
	color: var(--chd-body, #334155);
	background: var(--chd-surface);
	border: 1px solid var(--chd-line-strong);
	border-radius: var(--chd-radius-sm);
	cursor: pointer;
	transition: border-color .18s ease, color .18s ease;
}
.chd-syncbar button:hover { border-color: var(--chd-accent); color: var(--chd-accent); }

.chd-results.is-loading { opacity: .55; transition: opacity .15s ease; }

/* The follow-the-map switch, sitting under the map. */
.chd-followrow {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	font-size: .82rem;
	color: var(--chd-body, #334155);
}
.chd-followrow input { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--chd-accent); }
.chd-followrow label { cursor: pointer; }

.chd-popup-name { font-weight: 650; color: var(--chd-ink, #0f172a); display: block; margin-bottom: 2px; }
.chd-popup-meta { color: var(--chd-muted); font-size: .82rem; }

.chd-view-toggle { display: none; gap: 4px; margin-bottom: 14px; padding: 4px; background: var(--chd-ground); border: 1px solid var(--chd-line); border-radius: var(--chd-radius-sm); }
.chd-toggle-btn {
	flex: 1; min-height: 40px; padding: 8px 16px;
	font: inherit; font-size: .88rem; font-weight: 600;
	color: var(--chd-muted); background: transparent;
	border: 0; border-radius: var(--chd-radius-sm); cursor: pointer;
}
.chd-toggle-btn.is-active { background: var(--chd-surface); color: var(--chd-ink, #0f172a); box-shadow: var(--chd-shadow); }

@media (max-width: 899px) {
	.chd-view-toggle { display: flex; }
	.chd-layout.has-map.showing-map .chd-results-col { display: none; }
	.chd-layout.has-map:not(.showing-map) .chd-map-rail { display: none; }

	/* Full height is the point on mobile too - the map is the whole view. */
	.chd-map-sticky { max-height: calc(100vh - var(--chd-sticky-top) - 12px); }
}

/* --- Pagination -------------------------------------------------------- */

.chd-pagination {
	display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
	margin-top: 24px;
}
.chd-page {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 12px;
	font-size: .88rem; font-weight: 600; text-decoration: none;
	color: var(--chd-body, #334155);
	border: 1px solid var(--chd-line); border-radius: var(--chd-radius-sm);
	transition: border-color .18s ease, background-color .18s ease;
}
.chd-page:hover { border-color: var(--chd-accent); color: var(--chd-accent); }
.chd-page.is-current { background: var(--chd-accent); border-color: var(--chd-accent); color: var(--chd-accent-ink, #ffffff); }
.chd-page-gap { padding: 0 4px; color: var(--chd-muted); }

/* --- Link grids (city / province hubs) --------------------------------- */

.chd-section { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--chd-line); }

/* Tier 1: the dozen biggest cities, given room to read as destinations. */
.chd-citygrid {
	list-style: none; margin: 0 0 18px; padding: 0;
	display: grid; gap: 10px;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.chd-citygrid a {
	display: flex; flex-direction: column; gap: 2px;
	min-height: 64px; padding: 12px 14px;
	text-decoration: none;
	background: var(--chd-surface);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
	transition: border-color .18s ease, background-color .18s ease;
}
.chd-citygrid a:hover { border-color: var(--chd-accent); background: var(--chd-ground); }
.chd-citygrid-name {
	font-size: 1rem; font-weight: 650; color: var(--chd-ink, #0f172a);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chd-citygrid-count { font-size: .8rem; color: var(--chd-muted); font-variant-numeric: tabular-nums; }

/* Tier 2: the long tail, alphabetical and collapsed by default. */
.chd-citytail { margin-top: 4px; }
.chd-citytail > summary {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 44px; padding: 10px 14px;
	font-size: .88rem; font-weight: 600; color: var(--chd-body, #334155);
	cursor: pointer; list-style: none;
	border: 1px solid var(--chd-line-strong); border-radius: var(--chd-radius-sm);
}
.chd-citytail > summary::-webkit-details-marker { display: none; }
.chd-citytail > summary::after {
	content: ""; width: 7px; height: 7px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform .18s ease;
}
.chd-citytail[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.chd-citytail > summary:hover { border-color: var(--chd-accent); color: var(--chd-accent); }

.chd-citychips {
	list-style: none; margin: 14px 0 0; padding: 0;
	display: flex; flex-wrap: wrap; gap: 6px;
}
.chd-citychips a {
	display: inline-flex; align-items: baseline; gap: 6px;
	min-height: 34px; padding: 6px 11px;
	font-size: .84rem; text-decoration: none; color: var(--chd-body, #334155);
	border: 1px solid var(--chd-line); border-radius: 999px;
	transition: border-color .18s ease, color .18s ease;
}
.chd-citychips a:hover { border-color: var(--chd-accent); color: var(--chd-accent); }
.chd-citychips-count { font-size: .72rem; color: var(--chd-muted); font-variant-numeric: tabular-nums; }

.chd-linkgrid {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: 8px;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.chd-linkgrid a {
	display: flex; justify-content: space-between; align-items: center; gap: 10px;
	min-height: 44px; padding: 9px 12px;
	text-decoration: none; font-size: .9rem;
	color: var(--chd-body, #334155);
	border: 1px solid var(--chd-line); border-radius: var(--chd-radius-sm);
	transition: border-color .18s ease, background-color .18s ease;
}
.chd-linkgrid a:hover { border-color: var(--chd-accent); background: var(--chd-ground); }
.chd-linkgrid a[aria-current] { border-color: var(--chd-accent); background: var(--chd-ground); }
.chd-linkgrid-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chd-linkgrid-count { flex: none; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--chd-muted); }

/* --- CTA --------------------------------------------------------------- */

.chd-cta {
	display: flex; flex-wrap: wrap; gap: 16px;
	align-items: center; justify-content: space-between;
	margin-top: 40px; padding: 22px 24px;
	background: var(--chd-ground);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
}
.chd-cta p { margin: 0; color: var(--chd-muted); font-size: .92rem; }

/* --- Single ------------------------------------------------------------ */

.chd-single-layout { display: grid; gap: var(--chd-gap); align-items: start; }
@media (min-width: 860px) {
	.chd-single-layout { grid-template-columns: minmax(0, 1fr) 320px; }
	.chd-single-side { position: sticky; top: 20px; }
}

.chd-panel {
	padding: 20px;
	background: var(--chd-surface);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
	margin-bottom: 16px;
}

.chd-prose { max-width: 68ch; }

.chd-contact .chd-btn { margin-bottom: 8px; }

.chd-address {
	margin: 14px 0 0; padding-top: 14px;
	border-top: 1px solid var(--chd-line);
	font-style: normal; font-size: .9rem; color: var(--chd-body, #334155);
	white-space: pre-line;
}

.chd-socials { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.chd-socials a {
	display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px;
	font-size: .82rem; text-decoration: none;
	border: 1px solid var(--chd-line); border-radius: 999px;
}
.chd-socials a:hover { border-color: var(--chd-accent); }

.chd-hours { width: 100%; border-collapse: collapse; font-size: .9rem; }
.chd-hours th, .chd-hours td { padding: 9px 4px; text-align: left; border-bottom: 1px solid var(--chd-line); }
.chd-hours th { font-weight: 500; color: var(--chd-body, #334155); }
.chd-hours td { text-align: right; font-variant-numeric: tabular-nums; color: var(--chd-ink, #0f172a); }
.chd-hours tr:last-child th, .chd-hours tr:last-child td { border-bottom: 0; }
.chd-hours .is-today th, .chd-hours .is-today td { font-weight: 650; color: var(--chd-ink, #0f172a); }
.chd-today-tag {
	margin-left: 6px; padding: 1px 7px;
	font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
	color: var(--chd-accent);
	background: color-mix(in srgb, var(--chd-accent) 10%, transparent);
	border-radius: 999px;
}

.chd-nearby { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chd-nearby a {
	display: flex; flex-direction: column; gap: 2px;
	min-height: 44px; padding: 9px 12px;
	text-decoration: none;
	border: 1px solid var(--chd-line); border-radius: var(--chd-radius-sm);
}
.chd-nearby a:hover { border-color: var(--chd-accent); background: var(--chd-ground); }
.chd-nearby-name { font-weight: 600; color: var(--chd-ink, #0f172a); font-size: .92rem; }
.chd-nearby-street { font-size: .8rem; color: var(--chd-muted); }

/* --- Forms ------------------------------------------------------------- */

.chd-form { max-width: 760px; }

.chd-fieldset {
	margin: 0 0 22px;
	padding: 20px;
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
}
.chd-fieldset legend { padding: 0 8px; margin-left: -8px; }
.chd-fieldset .chd-field { margin-bottom: 14px; }

.chd-grid-2, .chd-grid-3, .chd-hours-grid { display: grid; gap: 14px; }
@media (min-width: 620px) {
	.chd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.chd-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.chd-hours-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

.chd-form-footer {
	display: flex; flex-wrap: wrap; gap: 14px;
	align-items: center; justify-content: space-between;
}

/* Honeypot: removed from the accessibility tree and from view, but not
   display:none, which some bots detect and skip. */
.chd-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px; height: 1px;
	overflow: hidden;
}

.chd-notice {
	padding: 14px 16px;
	border: 1px solid var(--chd-line);
	border-left: 3px solid var(--chd-muted);
	border-radius: var(--chd-radius-sm);
	background: var(--chd-ground);
	font-size: .92rem;
}
.chd-notice-success { border-left-color: var(--chd-success); }
.chd-notice-error { border-left-color: var(--chd-danger); }

.chd-attribution {
	margin-top: 36px; padding-top: 18px;
	border-top: 1px solid var(--chd-line);
	font-size: .76rem; color: var(--chd-muted);
	line-height: 1.7;
}

/* --- Motion ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
	.chd *,
	.chd *::before,
	.chd *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* --- Dark mode --------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
	.chd {
		--chd-ink: #f1f5f9;
		--chd-body: #cbd5e1;
		--chd-muted: #94a3b8;
		--chd-line: #1e293b;
		--chd-line-strong: #334155;
		--chd-surface: #0f172a;
		--chd-ground: #131f36;
		--chd-accent: #22d3ee;
		--chd-accent-ink: #06202b;
		--chd-accent-dark: #67e8f9;
		--chd-success: #34d399;
		--chd-danger: #f87171;
		--chd-shadow: 0 1px 2px rgba(0, 0, 0, .3);
	}
}

/* --- Sponsored placements ---------------------------------------------- */

/*
 * A paid placement is visually distinct and labelled. Undisclosed paid
 * promotion is a link scheme as far as Google is concerned, and readers are
 * owed the disclosure regardless.
 */
.chd-card.is-sponsored {
	border-color: color-mix(in srgb, var(--chd-accent) 35%, var(--chd-line));
	background: color-mix(in srgb, var(--chd-accent) 3%, var(--chd-surface));
}

.chd-chip-sponsored {
	color: var(--chd-accent);
	border-color: color-mix(in srgb, var(--chd-accent) 40%, var(--chd-line));
	text-transform: uppercase;
	letter-spacing: .05em;
	font-size: .68rem;
}

.chd-list-featured { margin-bottom: 4px; }

/* --- Elementor widgets -------------------------------------------------- */

/*
 * Inside Elementor the widget provides its own spacing, so the page-level
 * padding and max-width the standalone templates need would double up.
 */
.chd-embed {
	max-width: none;
	padding: 0;
}

.chd-embed .chd-filters { margin-bottom: 0; }
.chd-widget-more { margin-top: 16px; }

/* Editor-only hint, never rendered on the front end. */
.chd-editor-note {
	margin-top: 10px;
	padding: 10px 12px;
	border: 1px dashed var(--chd-line-strong);
	border-radius: var(--chd-radius-sm);
	background: var(--chd-ground);
	color: var(--chd-muted);
	font-size: .82rem;
}

.chd-statgrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.chd-statgrid li {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 18px 20px;
	background: var(--chd-surface);
	border: 1px solid var(--chd-line);
	border-radius: var(--chd-radius);
}

.chd-statgrid-value {
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
	font-weight: 700;
	line-height: 1.1;
	color: var(--chd-ink, #0f172a);
	font-variant-numeric: tabular-nums;
}

.chd-statgrid-label { font-size: .84rem; color: var(--chd-muted); }

/* Manage your listing ---------------------------------------------------- */

.chd-manage-item { margin-bottom: 22px; }
.chd-manage-head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 14px; flex-wrap: wrap;
}
.chd-manage-head .chd-h3 { margin: 0; }
.chd-manage-view { font-size: .88rem; white-space: nowrap; }
.chd-manage-where {
	margin: 2px 0 16px; color: var(--chd-muted, #64748b); font-size: .88rem;
}

/* Two fields per row on desktop, one on a phone. auto-fit rather than a
   fixed count so a narrow sidebar does not force a squeezed two-up. */
.chd-field-row {
	display: grid; gap: 0 16px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.chd-manage .chd-field { margin: 0 0 16px; }
.chd-manage .chd-field label {
	display: block; margin-bottom: 5px;
	font-weight: 600; font-size: .88rem;
	color: var(--chd-ink, #0f172a);
}
.chd-manage .chd-field input,
.chd-manage .chd-field textarea {
	width: 100%; box-sizing: border-box;
	/* 44px minimum, so the fields are comfortable to hit on a phone. */
	min-height: 44px; padding: 10px 12px;
	border: 1px solid var(--chd-line-strong, #cbd5e1);
	border-radius: 6px;
	background: var(--chd-surface, #fff);
	color: var(--chd-ink, #0f172a);
	font: inherit; font-size: 1rem;
}
.chd-manage .chd-field input:focus-visible,
.chd-manage .chd-field textarea:focus-visible {
	outline: 2px solid var(--chd-accent, #0b5ea8);
	outline-offset: 1px;
	border-color: var(--chd-accent, #0b5ea8);
}
.chd-hint {
	display: block; margin-top: 5px;
	font-size: .82rem; color: var(--chd-muted, #64748b);
}
.chd-manage-actions {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	margin: 4px 0 0;
}
.chd-manage-actions .chd-hint { margin-top: 0; }
.chd-manage-locked {
	margin: 16px 0 0; padding-top: 14px;
	border-top: 1px solid var(--chd-line, #e2e8f0);
	font-size: .84rem; color: var(--chd-muted, #64748b);
}

.chd-owner-bar { margin-bottom: 16px; }
.chd-owner-bar p { margin: 0 0 10px; font-weight: 600; }

.chd-notice {
	padding: 12px 14px; border-radius: 6px; margin-bottom: 16px;
	border: 1px solid var(--chd-line-strong, #cbd5e1);
	font-size: .92rem; line-height: 1.55;
}
.chd-notice-success { border-color: #9fd3ae; background: #f1faf3; color: #125c2a; }
.chd-notice-error   { border-color: #e6a7a8; background: #fdf2f2; color: #8a2225; }
.chd-notice-info    { border-color: #a9c9e8; background: #f2f7fc; color: #1c4e80; }
