/* Newfield Resource Library — base styles. Everything here can be overridden in the widget's Style tab. */

.nnf-rl {
	--nnf-rl-accent: #4b2e6f;
	--nnf-rl-accent-contrast: #ffffff;
	--nnf-rl-ink: #1f1a2e;
	--nnf-rl-muted: #5d5870;
	--nnf-rl-line: rgba(31, 26, 46, 0.12);
	position: relative;
}

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

.nnf-rl [hidden] {
	display: none !important;
}

.nnf-rl-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Placeholder when an item has no image ---------- */
.nnf-rl-card__media.nnf-rl-card__media--placeholder {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.14) 0, rgba(255, 255, 255, 0) 45%),
		radial-gradient(circle at 85% 90%, rgba(239, 233, 220, 0.18) 0, rgba(239, 233, 220, 0) 50%),
		linear-gradient(135deg, var(--nnf-rl-ph-from, #6d5b8f) 0%, var(--nnf-rl-ph-to, #3f3158) 100%);
}

/* Faint sound-wave lines behind the icon. */
.nnf-rl-card__media.nnf-rl-card__media--placeholder::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 14px);
	-webkit-mask: linear-gradient(180deg, transparent 20%, #000 50%, transparent 80%);
	mask: linear-gradient(180deg, transparent 20%, #000 50%, transparent 80%);
}

.nnf-rl-card__ph-icon {
	position: relative;
	display: block;
	width: 76px;
	height: 76px;
	background: rgba(255, 255, 255, 0.14);
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 50%;
	transition: transform 0.25s ease, background-color 0.25s ease;
}

.nnf-rl-card__ph-icon::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 34px;
	height: 34px;
	background-color: var(--nnf-rl-ph-icon, #efe9dc);
	-webkit-mask: var(--nnf-rl-ph-glyph) center / contain no-repeat;
	mask: var(--nnf-rl-ph-glyph) center / contain no-repeat;
}

.nnf-rl-card__media--audio { --nnf-rl-ph-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 0 0-9 9v6a3 3 0 0 0 3 3h1a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2H5v-1a7 7 0 0 1 14 0v1h-2a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h1a3 3 0 0 0 3-3v-6a9 9 0 0 0-9-9z'/%3E%3C/svg%3E"); }
.nnf-rl-card__media--video { --nnf-rl-ph-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.14v13.72a1 1 0 0 0 1.52.85l10.6-6.86a1 1 0 0 0 0-1.7L9.52 4.29A1 1 0 0 0 8 5.14z'/%3E%3C/svg%3E"); }
.nnf-rl-card__media--video .nnf-rl-card__ph-icon::after { width: 30px; height: 30px; transform: translateX(3px); }
.nnf-rl-card__media--blog  { --nnf-rl-ph-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm7 1.5V9h5.5L13 3.5zM7 12v2h10v-2H7zm0 4v2h7v-2H7z'/%3E%3C/svg%3E"); }

a.nnf-rl-card__media--placeholder:hover .nnf-rl-card__ph-icon {
	transform: scale(1.06);
	background: rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
	.nnf-rl-card__ph-icon { transition: none; }
	a.nnf-rl-card__media--placeholder:hover .nnf-rl-card__ph-icon { transform: none; }
}

/* ---------- Toolbar: filter buttons + search ---------- */
.nnf-rl__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 14px 24px;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 28px;
}

.nnf-rl__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	order: 1;
}

.nnf-rl__search {
	position: relative;
	flex: 0 1 320px;
	order: 2;
}

/* Filter buttons — outlined light pills on the purple section, cream when active (per the design reference). */
.nnf-rl__tab {
	padding: 8px 20px;
	font-family: var(--nnf-rl-text-font, "DM Sans", Arial, sans-serif);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.01em;
	color: var(--nnf-rl-tab-color, #ece6f1);
	background: transparent;
	border: 1px solid var(--nnf-rl-tab-border, rgba(255, 255, 255, 0.45));
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nnf-rl__tab:hover {
	color: #ffffff;
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.75);
}

.nnf-rl__tab.is-active,
.nnf-rl__tab[aria-pressed="true"] {
	color: var(--nnf-rl-tab-active-color, #3a3150);
	background: var(--nnf-rl-tab-active-bg, #efe9dc);
	border-color: var(--nnf-rl-tab-active-bg, #efe9dc);
}

.nnf-rl__search input[type="search"] {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 10px 44px 10px 16px;
	font: inherit;
	font-size: 15px;
	color: var(--nnf-rl-ink);
	background: #fff;
	border: 1px solid var(--nnf-rl-line);
	border-radius: 999px;
	box-shadow: none;
}

.nnf-rl__search-btn {
	position: absolute;
	top: 50%;
	right: 6px;
	width: 34px;
	height: 34px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transform: translateY(-50%);
}

.nnf-rl__search-btn::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	background-color: var(--nnf-rl-muted);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 0 1 6.32 12.9l5.39 5.39-1.42 1.42-5.39-5.39A8 8 0 1 1 10 2zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 2a8 8 0 0 1 6.32 12.9l5.39 5.39-1.42 1.42-5.39-5.39A8 8 0 1 1 10 2zm0 2a6 6 0 1 0 0 12 6 6 0 0 0 0-12z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.nnf-rl__tab:focus-visible {
	outline: 2px solid var(--nnf-rl-tab-active-bg, #efe9dc);
	outline-offset: 2px;
}

.nnf-rl__search input:focus-visible,
.nnf-rl__search-btn:focus-visible {
	outline: 2px solid var(--nnf-rl-accent);
	outline-offset: 2px;
}

@media (max-width: 767px) {
	.nnf-rl__search {
		flex: 1 1 100%;
		order: 1;
	}
	.nnf-rl__tabs {
		order: 2;
		flex-wrap: nowrap;
		overflow-x: auto;
		width: 100%;
		padding-bottom: 2px;
		scrollbar-width: none;
	}
	.nnf-rl__tab {
		flex: none;
	}
}

/* ---------- Grid ---------- */
.nnf-rl__grid {
	display: grid;
	grid-template-columns: repeat(var(--nnf-rl-cols, 3), minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 32px;
	transition: opacity 0.15s ease;
}

@media (max-width: 1024px) {
	.nnf-rl { --nnf-rl-cols: 2; }
}

@media (max-width: 767px) {
	.nnf-rl { --nnf-rl-cols: 1; }
}

.nnf-rl[aria-busy="true"] .nnf-rl__grid {
	opacity: 0.55;
}

/* ---------- Card ---------- */
.nnf-rl-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	color: var(--nnf-rl-ink);
	background: #ffffff;
	border: 1px solid var(--nnf-rl-line);
	border-radius: 8px;
}

.nnf-rl-card__media {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #eee9f3;
}

.nnf-rl-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.3s ease;
}

a.nnf-rl-card__media:hover img {
	transform: scale(1.03);
}

.nnf-rl-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 20px 22px 24px;
}

.nnf-rl-card__type-wrap {
	margin-bottom: 10px;
}

.nnf-rl-card__type {
	display: inline-block;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--nnf-rl-accent);
	background: #efe9f6;
	border-radius: 999px;
}

.nnf-rl-card--audio .nnf-rl-card__type { background: #f6efe1; color: #7a5212; }
.nnf-rl-card--video .nnf-rl-card__type { background: #e6f0f4; color: #1f5468; }

.nnf-rl-card__title {
	display: block;
	margin: 0 0 10px;
	font-family: var(--nnf-rl-title-font, "Cormorant Garamond", Georgia, serif);
	font-size: var(--nnf-rl-title-size, 20px);
	font-weight: 600;
	line-height: 1.25;
	color: var(--nnf-rl-title-color, #5b4a7e);
}

/* No underline, also when the theme underlines links on hover. */
.nnf-rl .nnf-rl-card__title a,
.nnf-rl .nnf-rl-card__title a:hover,
.nnf-rl .nnf-rl-card__title a:focus {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

/* Line under the title: Podcast Name (Audio/Video) or excerpt (Blog). */
.nnf-rl-card__subtitle {
	margin: -4px 0 12px;
	font-family: var(--nnf-rl-text-font, "DM Sans", Arial, sans-serif);
	font-size: var(--nnf-rl-sub-size, 14px);
	line-height: 1.5;
	color: var(--nnf-rl-text-color, #1a1a1a);
}

.nnf-rl-card__subtitle--podcast {
	font-weight: 500;
}

.nnf-rl-card__desc {
	margin: 0 0 14px;
	font-family: var(--nnf-rl-text-font, "DM Sans", Arial, sans-serif);
	font-size: 15px;
	line-height: 1.6;
	color: var(--nnf-rl-text-color, #1a1a1a);
}

/* ---------- Metadata ---------- */
.nnf-rl-card__meta {
	margin: 0 0 14px;
	font-family: var(--nnf-rl-text-font, "DM Sans", Arial, sans-serif);
	font-size: 14px;
	line-height: 1.5;
	color: var(--nnf-rl-text-color, #1a1a1a);
}

.nnf-rl-card__meta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	margin: 0 0 4px;
}

.nnf-rl-card__meta dt {
	margin: 0;
	font-weight: 600;
	color: inherit;
}

.nnf-rl-card__meta dt::after {
	content: ":";
}

.nnf-rl-card__meta dd {
	margin: 0;
}

.nnf-rl-card__meta-row--participants {
	display: block;
}

.nnf-rl-card__meta ul {
	margin: 2px 0 0;
	padding: 0 0 0 18px;
}

.nnf-rl-card__meta li {
	margin: 0;
}

/* ---------- Button ---------- */
.nnf-rl-card__actions {
	margin-top: auto;
	padding-top: 6px;
}

.nnf-rl-card__button {
	display: inline-block;
	width: var(--nnf-rl-btn-width, auto);
	padding: 10px 20px;
	font-family: var(--nnf-rl-text-font, "DM Sans", Arial, sans-serif);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	color: var(--nnf-rl-text-color, #1a1a1a);
	background: transparent;
	border: 1px solid var(--nnf-rl-text-color, #1a1a1a);
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nnf-rl .nnf-rl-card__button:hover,
.nnf-rl .nnf-rl-card__button:focus-visible {
	color: #ffffff;
	background: var(--nnf-rl-text-color, #1a1a1a);
	text-decoration: none;
}

.nnf-rl a:focus-visible {
	outline: 2px solid var(--nnf-rl-accent);
	outline-offset: 3px;
}

/* ---------- Pagination ---------- */
.nnf-rl__empty {
	padding: 28px;
	text-align: center;
	color: var(--nnf-rl-muted);
	border: 1px dashed var(--nnf-rl-line);
	border-radius: 8px;
}

.nnf-rl__more {
	display: flex;
	justify-content: center;
	margin-top: 36px;
}

.nnf-rl__load {
	display: inline-block;
	min-width: 180px;
	padding: 12px 28px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: var(--nnf-rl-accent-contrast);
	background: var(--nnf-rl-accent);
	border: 1px solid var(--nnf-rl-accent);
	border-radius: 4px;
	cursor: pointer;
}

.nnf-rl__load:hover {
	opacity: 0.9;
}

.nnf-rl__load.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

.nnf-rl__pages {
	margin-top: 36px;
}

.nnf-rl__pages ul.page-numbers,
.nnf-rl__pages ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nnf-rl__pages li > .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	text-align: center;
	text-decoration: none;
	color: var(--nnf-rl-accent);
	border: 1px solid var(--nnf-rl-line);
	border-radius: 4px;
}

.nnf-rl__pages li > .page-numbers.current {
	color: var(--nnf-rl-accent-contrast);
	background: var(--nnf-rl-accent);
	border-color: var(--nnf-rl-accent);
}

@media (prefers-reduced-motion: reduce) {
	.nnf-rl-card__media img,
	.nnf-rl__grid,
	.nnf-rl-card__button {
		transition: none;
	}
	a.nnf-rl-card__media:hover img {
		transform: none;
	}
}
