/* ==========================================================================
   Medical & Scientific Resource Library
   Layout uses Bootstrap 4 + theme conventions. This file adds bespoke
   widgets (pills, cards, disclaimer) AND scoped typography overrides
   to match the Figma design at the page level only (everything is
   prefixed with `.mrl-page` so nothing leaks elsewhere).
   ========================================================================== */

/* ── HERO TYPOGRAPHY ──────────────────────────────────────────────────
   Theme's .h1 has !important at 991px+ (40px). Figma uses 45px. */
.mrl-page .banner-title.h1 {
	font-size: 32px !important;
	line-height: 1.15;
	margin-bottom: 0;
}
.mrl-page .entry-content > h2.font-weight-normal {
	font-size: 18px;
	line-height: 1.4;
	margin-top: .5rem;
	margin-bottom: 1.5rem;
}
@media (min-width: 992px) {
	.mrl-page .banner-title.h1               { font-size: 45px !important; }
	.mrl-page .entry-content > h2.font-weight-normal { font-size: 22px; }
}

/* Yoast breadcrumb — match Figma 18px with thin separator under */
.mrl-page #breadcrumbs {
	font-size: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid rgba(0, 0, 0, .12);
	margin-bottom: 24px;
}
.mrl-page #breadcrumbs a            { color: rgb(var(--secondary-color)); font-weight: 400; }
.mrl-page #breadcrumbs .breadcrumb_last { color: rgb(var(--primary-darker-color)); }
@media (min-width: 992px) { .mrl-page #breadcrumbs { font-size: 18px; } }

/* Filter rows — match Figma row height (~62px) */
.mrl-filter-row {
	gap: 22px;
	min-height: 62px;
	padding: 10px 0;
	border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.mrl-filter-label {
	flex: 0 0 120px;
	font-size: 16px;
	color: rgb(var(--primary-darker-color));
}
.mrl-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }

@media (min-width: 992px) {
	.mrl-page .mrl-filter-label { font-size: 18px; }
}

/* Pills — Figma 38px height, 14-15px text, accent blue when active */
.mrl-pill {
	display: inline-flex;
	align-items: center;
	height: 38px;
	padding: 0 16px;
	border: 0;
	border-radius: 6px;
	background: #12385d;
	color: #fff;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	white-space: nowrap;
}
.mrl-pill:hover:not(.is-active) { background: #1c4a76; }
.mrl-pill.is-active             { background: rgb(var(--secondary-color)); }

/* Toolbar — count text + sort, separator above the grid */
.mrl-toolbar {
	gap: 14px;
	padding-bottom: 18px;
	border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.mrl-page .mrl-count {
	font-size: 16px;
	color: rgba(var(--primary-darker-color), .55);
}
@media (min-width: 992px) { .mrl-page .mrl-count { font-size: 18px; } }

/* Sort select — extends Bootstrap .form-control with a chevron and width cap */
.mrl-sort {
	width: auto;
	min-width: 175px;
	padding-right: 36px;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23011635' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M4 6l4 4 4-4'/></svg>");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 14px 14px;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

/* Card — uses theme's primary color for the soft border (rgb(4,41,78) at 15%) */
.mrl-card {
	background: #fff;
	border: 1px solid rgba(var(--primary-color), .15);
	border-radius: 10px;
	padding: 10px 10px 18px;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s ease, transform .2s ease;
}
.mrl-card:hover {
	box-shadow: 0 10px 24px -8px rgba(var(--primary-color), .18);
	transform: translateY(-2px);
}

/* Card image — needed because a positioned overlay (badge + play) sits on it */
.mrl-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: 10px;
	background: #d9e7f1;
}
.mrl-card__thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.mrl-card__thumb--placeholder {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #d9e7f1, #b6cfe2);
}

/* Badge (top-right of image) — accent blue, uses theme secondary-color */
.mrl-card__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	display: inline-flex;
	align-items: center;
	height: 28px;
	padding: 0 12px;
	border-radius: 6px;
	background: rgb(var(--secondary-color));
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}

/* Play overlay (videos only) — black 25% circle + white triangle */
.mrl-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .25);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color .2s ease;
}
.mrl-card__media:hover .mrl-card__play { background: rgba(0, 0, 0, .4); }
.mrl-card__play svg { width: 24px; height: 28px; margin-left: 4px; }

/* Card body — typography sized explicitly to match Figma; .entry-content
   theme rules would render h3 at 24px / p at 18px which is too large for cards. */
.mrl-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 18px 10px 0;
}
.mrl-page .mrl-card__title {
	font-size: 18px;
	line-height: 1.3;
	font-weight: 700;
	color: rgb(var(--primary-color));
	margin: 0 0 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
@media (min-width: 992px) {
	.mrl-page .mrl-card__title { font-size: 22px; line-height: 1.36; }
}
/* Override theme's `.entry-content a:not(.btn)` rule which would force the
   title link to secondary-color + bold; keep title color from the h3 itself. */
.mrl-page .mrl-card__title a       { color: inherit; text-decoration: none; font-weight: inherit; }
.mrl-page .mrl-card__title a:hover { color: rgb(var(--secondary-color)); }

.mrl-page .mrl-card__excerpt {
	font-size: 14px;
	line-height: 1.45;
	color: rgb(var(--primary-color));
	margin: 0 0 14px;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
@media (min-width: 992px) {
	.mrl-page .mrl-card__excerpt { font-size: 16px; }
}

.mrl-card__date {
	font-size: 13px;
	line-height: 1.4;
	color: rgba(var(--primary-color), .55);
}
@media (min-width: 992px) { .mrl-card__date { font-size: 15px; } }

.mrl-page .mrl-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	color: rgb(var(--secondary-color));
	white-space: nowrap;
	text-decoration: none;
}
.mrl-page .mrl-card__cta:hover { gap: 10px; text-decoration: none; }
.mrl-card__cta-arrow           { width: 12px; height: 12px; flex-shrink: 0; }
@media (min-width: 992px) { .mrl-page .mrl-card__cta { font-size: 16px; } }

/* Skeleton shimmer */
.mrl-skeleton__card {
	background: #fff;
	border: 1px solid rgba(var(--primary-color), .15);
	border-radius: 10px;
	padding: 10px 10px 18px;
}
.mrl-skeleton__line {
	background: linear-gradient(90deg, #e6eef5 25%, #f1f5f9 50%, #e6eef5 75%);
	background-size: 200% 100%;
	animation: mrl-shimmer 1.4s infinite;
	border-radius: 4px;
	height: 12px;
	margin: 12px 10px 8px;
}
.mrl-skeleton__line--thumb { aspect-ratio: 16 / 10; height: auto; margin: 0 0 12px; border-radius: 10px; }
.mrl-skeleton__line--title { height: 18px; margin-top: 18px; width: 85%; }
.mrl-skeleton__line--short { width: 50%; }
@keyframes mrl-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Pagination — flex gap (Bootstrap 4 has no gap-* utility) + page-info width to stop button shift */
.mrl-pagination { gap: 14px; }
.mrl-page-info  { min-width: 120px; text-align: center; }

/* Disclaimer (full-width band — breaks out of .container).
   Override body 18px to 14-15px (Figma: legal text is small). */
.mrl-disclaimer {
	background: #12385d;
	color: rgba(255, 255, 255, .8);
}
.mrl-disclaimer p {
	font-size: 14px;
	line-height: 1.55;
	margin: 0;
	color: rgba(255, 255, 255, .8);
}
.mrl-disclaimer strong { color: #fff; font-weight: 700; }
.mrl-disclaimer a      { color: #29a6ff; font-weight: 400; }
@media (min-width: 992px) { .mrl-disclaimer p { font-size: 15px; } }

/* Responsive: stack filter row + toolbar on small screens */
@media (max-width: 767.98px) {
	.mrl-filter-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	.mrl-filter-label { flex: none; }
	.mrl-toolbar {
		flex-direction: column;
		align-items: flex-start !important;
	}
}
