/*
 * Health Library Connector — layout
 *
 * Always loaded. Only structure: columns, spacing, the sidebar, lists.
 * Fonts, text and link colors are never set here, so they come from your
 * theme. The look (cards, buttons, chips) is in health-library.css, which
 * Settings → Health Library → "Plugin styling" can turn off.
 */

.hlmc {
	--hlmc-accent: #003865;
	--hlmc-accent-contrast: #fff;
	--hlmc-border: color-mix(in srgb, currentColor 14%, transparent);
	--hlmc-muted: color-mix(in srgb, currentColor 68%, transparent);
	--hlmc-surface: color-mix(in srgb, currentColor 3%, transparent);
	--hlmc-radius: 6px;
	--hlmc-gap: 1.5rem;
	--hlmc-sidebar-width: 18rem;

	box-sizing: border-box;
	margin-block: 1rem 2rem;
}
.hlmc *, .hlmc *::before, .hlmc *::after { box-sizing: inherit; }

/* Search */
.hlmc-search { display: flex; gap: .5rem; max-width: 40rem; margin: 0 0 var(--hlmc-gap); }
.hlmc-search input[type="search"] { flex: 1; min-width: 0; font: inherit; }

/* Notices */
.hlmc-notice, .hlmc-demo-notice { margin: 0 0 var(--hlmc-gap); }

/* Layout */
.hlmc-layout { display: block; }
.hlmc-has-sidebar .hlmc-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--hlmc-sidebar-width);
	gap: calc(var(--hlmc-gap) * 1.5);
	align-items: start;
}
.hlmc-sidebar { position: sticky; top: 1.5rem; }
@media (max-width: 782px) {
	.hlmc-has-sidebar .hlmc-layout { grid-template-columns: 1fr; }
	.hlmc-sidebar { position: static; }
}

/* Results */
.hlmc-heading { margin-block: 1.5rem 1rem; }
.hlmc-count { margin: 0 0 1rem; }
.hlmc-results { list-style: none; margin: 0; padding: 0; }
.hlmc-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.hlmc-result { margin: 0 0 1.25rem; }
.hlmc-results-grid .hlmc-result { margin: 0; }
.hlmc-result-title { margin: .2rem 0 .35rem; line-height: 1.3; }
.hlmc-snippet { margin: 0; }
.hlmc-date { margin: .35rem 0 0; }
.hlmc-pagination { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1.5rem; }

/* Article */
.hlmc-back { display: inline-block; margin-bottom: 1rem; }
.hlmc-article-title { margin: .4rem 0 .75rem; }
.hlmc-abstract { margin: 0 0 1.5rem; }
.hlmc-abstract p { margin: 0; }
.hlmc-section { margin-bottom: 1.5rem; }
.hlmc-section-content ul, .hlmc-section-content ol { padding-left: 1.5rem; }
.hlmc-figure { margin: 1rem 0 1.25rem; }
.hlmc-figure img { display: block; max-width: 100%; height: auto; }
.hlmc-updated { margin-top: 2rem; }

/* Sidebar */
.hlmc-cta { margin-bottom: 1rem; }
.hlmc-cta h3, .hlmc-cta h4 { margin: 0 0 .4rem; }
.hlmc-cta .hlmc-button { display: block; text-align: center; }
.hlmc-links-provider .hlmc-button + .hlmc-button { margin-top: .5rem; }
.hlmc-link-list { list-style: none; margin: 0; padding: 0; }
.hlmc-link-list li { margin: 0; padding: .35rem 0; }

/* Attribution */
.hlmc-attribution { margin-top: 2.5rem; }

/* Topic buttons ([health_library_topics]) */
.hlmc-topics-wrap { margin-block: 1rem; }
.hlmc-topics-heading { margin: 0 0 .6rem; }
.hlmc-topics { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.hlmc-topics li { margin: 0; padding: 0; }

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

/* Admin-only category inspector (always styled so it stands out) */
.hlmc-inspector {
	margin-top: 2rem;
	padding: .75rem 1rem;
	border: 1px dashed #b38600;
	border-radius: 6px;
	background: #fffbea;
	color: #3d3200;
	font-size: .85em;
}
.hlmc-inspector summary { cursor: pointer; font-weight: 600; }
.hlmc-inspector-note { font-weight: 400; opacity: .75; }
.hlmc-inspector-paths { margin: .5rem 0; padding-left: 1.2rem; }
.hlmc-inspector-paths li { margin-bottom: .3rem; line-height: 1.5; }
.hlmc-inspector code { font-size: .9em; padding: 0 .25em; background: rgba(0,0,0,.06); border-radius: 3px; }
.hlmc-inspector mark { background: #ffe066; padding: 0 .2em; border-radius: 3px; }
.hlmc-inspector-mapped { color: #0a5c2b; font-weight: 600; }
