/* LDG Resource Library — portal + single resource styles
   Scoped under .ldg-rl-* / .ldg-rl-glance so it won't clash with theme
   or Elementor styles. Colors are set as CSS custom properties on
   .ldg-rl-portal — override them from the theme's stylesheet or an
   Elementor Custom CSS box to match brand colors. */

.ldg-rl-portal {
	--ldg-rl-accent: #1a4d8f;
	--ldg-rl-accent-dark: #123762;
	--ldg-rl-text: #1c1f24;
	--ldg-rl-muted: #5b6470;
	--ldg-rl-border: #e2e5ea;
	--ldg-rl-bg: #ffffff;
	--ldg-rl-bg-soft: #f6f8fa;
	max-width: 1160px;
	margin: 0 auto;
	color: var(--ldg-rl-text);
	font-size: 16px;
	line-height: 1.5;
}

.ldg-rl-portal *,
.ldg-rl-portal *::before,
.ldg-rl-portal *::after {
	box-sizing: border-box;
}

.ldg-rl-intro h1,
.ldg-rl-intro h2 {
	margin: 0 0 0.5em;
	font-size: 1.9em;
}

.ldg-rl-intro p {
	margin: 0 0 1.5em;
	max-width: 68ch;
	color: var(--ldg-rl-muted);
}

/* Quick-start finder */
.ldg-rl-quickstart {
	margin: 0 0 1.75em;
}

.ldg-rl-quickstart-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.6em;
}

.ldg-rl-quickstart-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.ldg-rl-qs-chip {
	font: inherit;
	font-size: 0.9em;
	background: var(--ldg-rl-bg-soft);
	border: 1px solid var(--ldg-rl-border);
	color: var(--ldg-rl-text);
	border-radius: 999px;
	padding: 0.5em 1em;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.ldg-rl-qs-chip:hover,
.ldg-rl-qs-chip:focus-visible {
	background: #eef3fa;
	border-color: var(--ldg-rl-accent);
}

/* Controls */
.ldg-rl-controls {
	display: flex;
	flex-direction: column;
	gap: 0.9em;
	margin-bottom: 0.75em;
}

.ldg-rl-search {
	font: inherit;
	font-size: 1.05em;
	width: 100%;
	padding: 0.85em 1.1em;
	border: 1px solid var(--ldg-rl-border);
	border-radius: 10px;
	background: var(--ldg-rl-bg);
	color: var(--ldg-rl-text);
}

.ldg-rl-search:focus {
	outline: 2px solid var(--ldg-rl-accent);
	outline-offset: 1px;
}

.ldg-rl-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.ldg-rl-filter-chip {
	font: inherit;
	font-size: 0.88em;
	background: transparent;
	border: 1px solid var(--ldg-rl-border);
	color: var(--ldg-rl-muted);
	border-radius: 999px;
	padding: 0.45em 1em;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ldg-rl-filter-chip:hover,
.ldg-rl-filter-chip:focus-visible {
	border-color: var(--ldg-rl-accent);
	color: var(--ldg-rl-text);
}

.ldg-rl-filter-chip.is-active {
	background: var(--ldg-rl-accent);
	border-color: var(--ldg-rl-accent);
	color: #fff;
}

.ldg-rl-meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0.5em 0 1.25em;
	min-height: 1.6em;
}

.ldg-rl-count {
	font-size: 0.9em;
	color: var(--ldg-rl-muted);
}

.ldg-rl-clear {
	font: inherit;
	font-size: 0.85em;
	background: none;
	border: none;
	color: var(--ldg-rl-accent);
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
}

/* Grid + cards */
.ldg-rl-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.1em;
}

.ldg-rl-loading {
	color: var(--ldg-rl-muted);
	padding: 2em 0;
	grid-column: 1 / -1;
	text-align: center;
}

.ldg-rl-error {
	color: #a12626;
	grid-column: 1 / -1;
}

.ldg-rl-card {
	display: flex;
	flex-direction: column;
	background: var(--ldg-rl-bg);
	border: 1px solid var(--ldg-rl-border);
	border-radius: 14px;
	padding: 1.25em;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ldg-rl-card:hover,
.ldg-rl-card:focus-visible {
	box-shadow: 0 8px 24px rgba(20, 30, 50, 0.08);
	border-color: var(--ldg-rl-accent);
	transform: translateY(-2px);
}

.ldg-rl-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.6em;
	font-size: 0.78em;
}

.ldg-rl-card-type {
	color: var(--ldg-rl-accent);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.ldg-rl-card-code {
	color: var(--ldg-rl-muted);
	font-variant-numeric: tabular-nums;
}

.ldg-rl-card-title {
	margin: 0 0 0.4em;
	font-size: 1.1em;
	line-height: 1.3;
}

.ldg-rl-card-summary {
	margin: 0 0 0.6em;
	color: var(--ldg-rl-muted);
	font-size: 0.92em;
	flex-grow: 1;
}

.ldg-rl-card-kpi {
	margin: 0 0 0.6em;
	font-size: 0.85em;
	color: var(--ldg-rl-text);
}

.ldg-rl-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35em;
	margin-bottom: 0.75em;
}

.ldg-rl-card-tag {
	font-size: 0.72em;
	background: var(--ldg-rl-bg-soft);
	color: var(--ldg-rl-muted);
	border-radius: 999px;
	padding: 0.2em 0.7em;
}

.ldg-rl-card-link {
	margin-top: auto;
	font-size: 0.88em;
	font-weight: 600;
	color: var(--ldg-rl-accent-dark);
}

.ldg-rl-empty {
	text-align: center;
	color: var(--ldg-rl-muted);
	padding: 3em 0;
}

/* Single resource "at a glance" box (appears above the_content) */
.ldg-rl-glance {
	background: var(--ldg-rl-bg-soft, #f6f8fa);
	border: 1px solid var(--ldg-rl-border, #e2e5ea);
	border-radius: 12px;
	padding: 1em 1.25em;
	margin: 0 0 1.5em;
}

.ldg-rl-glance-row {
	display: flex;
	gap: 0.5em;
	margin-bottom: 0.5em;
}

.ldg-rl-badge {
	display: inline-block;
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	border-radius: 999px;
	padding: 0.3em 0.9em;
}

.ldg-rl-badge-type {
	background: #eaf1fb;
	color: #1a4d8f;
}

.ldg-rl-badge-code {
	background: #eee;
	color: #555;
}

.ldg-rl-glance-kpi {
	margin: 0;
	font-size: 0.95em;
}

.ldg-rl-tags {
	margin: 2em 0 0.5em;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.ldg-rl-tag {
	font-size: 0.78em;
	background: #f6f8fa;
	color: #5b6470;
	border-radius: 999px;
	padding: 0.25em 0.8em;
}

.ldg-rl-back {
	margin-top: 1em;
}

@media (max-width: 640px) {
	.ldg-rl-portal {
		font-size: 15px;
	}
	.ldg-rl-grid {
		grid-template-columns: 1fr;
	}
}

/* v1.1 — plugin-rendered archive pages, link chips, related templates */
.ldg-rl-page {
	padding: 3em 16px 4em;
}

a.ldg-rl-filter-chip {
	display: inline-block;
	text-decoration: none;
}

.ldg-rl-back-top {
	margin: 0 0 1em;
	font-size: 0.9em;
}

.ldg-rl-related {
	margin: 2.5em 0 1em;
	padding-top: 1.5em;
	border-top: 1px solid #e2e5ea;
}

.ldg-rl-related h2 {
	font-size: 1.25em;
	margin: 0 0 0.6em;
}

.ldg-rl-related ul {
	margin: 0 0 0.8em;
	padding-left: 1.2em;
}

.ldg-rl-related li {
	margin: 0.3em 0;
}

.ldg-rl-related-code {
	color: #5b6470;
	font-size: 0.85em;
}

/* v1.1.1 — section headings inside a resource page (the theme's H2 is
   sized for page sections; these are sub-headings of the template). */
body .ldg-rl-body h2 {
	font-size: 1.45em;
	line-height: 1.25;
	margin: 1.4em 0 0.4em;
}

body .ldg-rl-body h2:first-child {
	margin-top: 0;
}
