/**
 * Resource Manager Pro - Frontend Styles
 *
 * Design tokens are exposed as CSS custom properties so the admin
 * Settings page can override --rmp-primary / --rmp-secondary via an
 * inline <style> tag without needing a build step.
 *
 * @package ResourceManagerPro
 */

:root {
	--rmp-bg: #F5F8FC;
	--rmp-card-bg: #FFFFFF;
	--rmp-primary: #2F80ED;
	--rmp-secondary: #39C6F0;
	--rmp-text: #1E293B;
	--rmp-text-light: #64748B;
	--rmp-border-radius: 20px;
	--rmp-border-color: #E2E8F0;
	--rmp-shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.04);
	--rmp-shadow-md: 0 8px 24px rgba(30, 41, 59, 0.08);
	--rmp-shadow-lg: 0 20px 40px rgba(47, 128, 237, 0.16);
}

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

.rmp-page {
	background: var(--rmp-bg);
	color: var(--rmp-text);
	padding-bottom: 64px;
}

.rmp-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
	box-sizing: border-box;
}

.rmp-resources-wrap * {
	box-sizing: border-box;
}

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

.rmp-breadcrumbs {
	font-size: 13px;
	color: var(--rmp-text-light);
	margin: 24px 0 12px;
}

.rmp-breadcrumbs a {
	color: var(--rmp-text-light);
	text-decoration: none;
	transition: color 0.2s ease;
}

.rmp-breadcrumbs a:hover {
	color: var(--rmp-primary);
}

.rmp-breadcrumb-sep {
	margin: 0 8px;
	opacity: 0.5;
}

.rmp-breadcrumb-current {
	color: var(--rmp-text);
	font-weight: 500;
}

.rmp-breadcrumbs-hero a,
.rmp-breadcrumbs-hero .rmp-breadcrumb-current {
	color: rgba(255, 255, 255, 0.85);
}

.rmp-breadcrumbs-hero a:hover {
	color: #fff;
}

/* -----------------------------------------------------------------
   Archive Header
----------------------------------------------------------------- */

.rmp-archive-header {
	text-align: center;
	padding: 32px 0 40px;
}

.rmp-archive-title {
	font-size: 40px;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin: 0 0 12px;
	color: var(--rmp-text);
}

.rmp-archive-subtitle {
	font-size: 17px;
	color: var(--rmp-text-light);
	max-width: 560px;
	margin: 0 auto;
}

/* -----------------------------------------------------------------
   Hero Banner (dark, animated starfield)
----------------------------------------------------------------- */

.rmp-archive-hero {
	position: relative;
	width: 100vw;
	margin-left: calc( 50% - 50vw );
	margin-right: calc( 50% - 50vw );
	margin-top: 0;
	margin-bottom: 44px;
	overflow: hidden;
	isolation: isolate;
	border-radius: 0;
	background: radial-gradient(ellipse 900px 520px at 50% -10%, #1c3564 0%, #0d1a30 55%, #0a1424 100%);
	padding: 68px 32px 76px;
	text-align: center;
	color: #ffffff;
}

.rmp-archive-hero::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--rmp-primary), var(--rmp-secondary), var(--rmp-primary));
	z-index: 2;
}

.rmp-archive-hero-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	z-index: 0;
}

.rmp-archive-glow-orb {
	position: absolute;
	z-index: 0;
	width: 520px;
	height: 520px;
	max-width: 90vw;
	top: -220px;
	left: 50%;
	transform: translateX(-50%);
	background: radial-gradient(circle, rgba(47, 128, 237, 0.45), rgba(57, 198, 240, 0.12) 55%, transparent 72%);
	border-radius: 50%;
	filter: blur(6px);
	pointer-events: none;
}

.rmp-archive-hero-inner {
	position: relative;
	z-index: 1;
	max-width: 760px;
	margin: 0 auto;
}

.rmp-archive-eyebrow {
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--rmp-secondary);
	margin: 0 0 20px;
}

.rmp-archive-hero-title {
	font-size: 48px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
	margin: 0 0 22px;
	color: #ffffff;
}

.rmp-archive-grad {
	display: inline;
	background: linear-gradient(135deg, #bcd9ff, var(--rmp-secondary));
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.rmp-archive-hero .rmp-archive-lede {
	font-size: 18px;
	line-height: 1.65;
	color: rgba(226, 235, 250, 0.75);
	margin: 0 auto;
}

@media (max-width: 782px) {
	.rmp-archive-hero {
		margin-left: -24px;
		margin-right: -24px;
		width: auto;
	}
}

@media (max-width: 640px) {
	.rmp-archive-hero {
		padding: 52px 20px 60px;
	}

	.rmp-archive-hero-title {
		font-size: 30px;
	}

	.rmp-archive-hero .rmp-archive-lede {
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rmp-archive-hero-canvas {
		display: none;
	}
}

/* -----------------------------------------------------------------
   Filter Bar
----------------------------------------------------------------- */

.rmp-filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 28px;
}

.rmp-filter-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rmp-filter-tab {
	appearance: none;
	border: 1px solid var(--rmp-border-color);
	background: #fff;
	color: var(--rmp-text-light);
	font-size: 14px;
	font-weight: 600;
	padding: 10px 20px;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.rmp-filter-tab:hover {
	border-color: var(--rmp-primary);
	color: var(--rmp-primary);
}

.rmp-filter-tab.is-active {
	background: linear-gradient(135deg, var(--rmp-primary), var(--rmp-secondary));
	border-color: transparent;
	color: #fff;
	box-shadow: var(--rmp-shadow-sm);
}

.rmp-search-box {
	position: relative;
	min-width: 260px;
}

.rmp-search-input {
	width: 100%;
	padding: 11px 18px 11px 40px;
	border-radius: 999px;
	border: 1px solid var(--rmp-border-color);
	background: #fff;
	font-size: 14px;
	color: var(--rmp-text);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rmp-search-input:focus {
	border-color: var(--rmp-primary);
	box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.15);
}

.rmp-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	pointer-events: none;
}

.rmp-search-icon::before {
	content: "";
	position: absolute;
	width: 11px;
	height: 11px;
	border: 2px solid var(--rmp-text-light);
	border-radius: 50%;
	top: 0;
	left: 0;
}

.rmp-search-icon::after {
	content: "";
	position: absolute;
	width: 6px;
	height: 2px;
	background: var(--rmp-text-light);
	transform: rotate(45deg);
	top: 11px;
	left: 9px;
	border-radius: 1px;
}

/* -----------------------------------------------------------------
   Result Count
----------------------------------------------------------------- */

.rmp-result-count {
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
	font-size: 14px;
	color: var(--rmp-text-light);
	margin-bottom: 20px;
	font-weight: 500;
}

/* -----------------------------------------------------------------
   Cards Grid
----------------------------------------------------------------- */

.rmp-cards-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}

.rmp-cards-grid.rmp-columns-1 { grid-template-columns: repeat(1, 1fr); }
.rmp-cards-grid.rmp-columns-2 { grid-template-columns: repeat(2, 1fr); }
.rmp-cards-grid.rmp-columns-4 { grid-template-columns: repeat(4, 1fr); }

.rmp-no-results {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--rmp-text-light);
	padding: 48px 0;
	font-size: 15px;
}

/* -----------------------------------------------------------------
   Card
----------------------------------------------------------------- */

.rmp-card {
	position: relative;
	background: var(--rmp-card-bg);
	border-radius: var(--rmp-border-radius);
	overflow: hidden;
	box-shadow: var(--rmp-shadow-sm);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--rmp-border-color);
}

.rmp-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--rmp-shadow-lg);
}

.rmp-card-gradient-border {
	height: 6px;
	width: 100%;
	background: linear-gradient(90deg, var(--rmp-primary), var(--rmp-secondary));
	flex-shrink: 0;
}

.rmp-card-media {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--rmp-bg);
}

.rmp-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.rmp-card:hover .rmp-card-image {
	transform: scale(1.04);
}

.rmp-card-image-placeholder {
	background: linear-gradient(135deg, rgba(47, 128, 237, 0.12), rgba(57, 198, 240, 0.12));
}

.rmp-card-body {
	padding: 22px 24px 24px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.rmp-card-top-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.rmp-badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rmp-primary);
	background: rgba(47, 128, 237, 0.1);
	padding: 5px 12px;
	border-radius: 999px;
}

.rmp-card-icon {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

.rmp-card-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 8px;
	color: var(--rmp-text);
}

.rmp-card-title a {
	color: inherit;
	text-decoration: none;
}

.rmp-card-title a:hover {
	color: var(--rmp-primary);
}

.rmp-card-subtitle {
	font-size: 14px;
	font-weight: 600;
	color: var(--rmp-text-light);
	margin: 0 0 8px;
}

.rmp-card-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: var(--rmp-text-light);
	margin: 0 0 20px;
	flex-grow: 1;
}

.rmp-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid var(--rmp-border-color);
}

.rmp-card-duration {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--rmp-text-light);
	font-weight: 500;
}

.rmp-card-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	color: #fff;
	background: linear-gradient(135deg, var(--rmp-primary), var(--rmp-secondary));
	padding: 9px 18px;
	border-radius: 999px;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	white-space: nowrap;
}

.rmp-card-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(47, 128, 237, 0.35);
	filter: brightness(1.05);
	color: #fff;
}

.rmp-card-featured {
	outline: 2px solid var(--rmp-secondary);
	outline-offset: 2px;
}

/* -----------------------------------------------------------------
   Load More / Pagination
----------------------------------------------------------------- */

.rmp-load-more-wrap {
	text-align: center;
	margin-top: 36px;
}

.rmp-load-more-btn {
	appearance: none;
	border: 1px solid var(--rmp-primary);
	background: #fff;
	color: var(--rmp-primary);
	font-size: 14px;
	font-weight: 700;
	padding: 12px 28px;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.rmp-load-more-btn:hover {
	background: var(--rmp-primary);
	color: #fff;
}

.rmp-load-more-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.rmp-pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 36px;
	flex-wrap: wrap;
}

.rmp-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--rmp-border-color);
	color: var(--rmp-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.2s ease;
}

.rmp-pagination .page-numbers:hover {
	border-color: var(--rmp-primary);
	color: var(--rmp-primary);
}

.rmp-pagination .page-numbers.current {
	background: linear-gradient(135deg, var(--rmp-primary), var(--rmp-secondary));
	border-color: transparent;
	color: #fff;
}

/* -----------------------------------------------------------------
   Loading state
----------------------------------------------------------------- */

.rmp-resources-wrap.is-loading .rmp-cards-grid {
	opacity: 0.4;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* -----------------------------------------------------------------
   Single Resource - Hero
----------------------------------------------------------------- */

.rmp-hero {
	position: relative;
	overflow: hidden;
	background: radial-gradient(ellipse 900px 520px at 50% -10%, #1c3564 0%, #0d1a30 55%, #0a1424 100%);
	background-size: cover;
	background-position: center;
	color: #fff;
	padding: 48px 0 56px;
}

.rmp-hero::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, var(--rmp-primary), var(--rmp-secondary), var(--rmp-primary));
	z-index: 2;
}

.rmp-hero::after {
	content: "";
	position: absolute;
	z-index: 0;
	width: 520px;
	height: 520px;
	max-width: 90vw;
	top: -220px;
	left: 50%;
	transform: translateX(-50%);
	background: radial-gradient(circle, rgba(47, 128, 237, 0.45), rgba(57, 198, 240, 0.12) 55%, transparent 72%);
	border-radius: 50%;
	filter: blur(6px);
	pointer-events: none;
}

.rmp-hero > .rmp-container {
	position: relative;
	z-index: 1;
}

.rmp-badge-hero {
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.25);
	color: #fff;
	margin-bottom: 16px;
}

.rmp-single-title {
	font-size: 38px;
	font-weight: 800;
	line-height: 1.2;
	margin: 0 0 12px;
	max-width: 720px;
}

.rmp-single-subtitle {
	font-size: 17px;
	opacity: 0.92;
	max-width: 640px;
	margin: 0 0 20px;
}

.rmp-single-meta {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
	font-size: 14px;
	opacity: 0.9;
}

/* -----------------------------------------------------------------
   Single Resource - Content
----------------------------------------------------------------- */

.rmp-single-container {
	padding-top: 40px;
}

.rmp-single-layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}

.rmp-single-content {
	background: var(--rmp-card-bg);
	border-radius: var(--rmp-border-radius);
	padding: 36px;
	box-shadow: var(--rmp-shadow-sm);
	border: 1px solid var(--rmp-border-color);
}

.rmp-single-featured-image {
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 28px;
}

.rmp-single-featured-image img {
	width: 100%;
	height: auto;
	display: block;
}

.rmp-single-body {
	font-size: 16px;
	line-height: 1.75;
	color: var(--rmp-text);
}

.rmp-single-body p {
	margin: 0 0 18px;
}

.rmp-single-full-content {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--rmp-border-color);
}

.rmp-single-cta {
	margin-top: 32px;
}

.rmp-single-btn {
	padding: 14px 32px;
	font-size: 15px;
}

.rmp-prev-next-nav {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--rmp-border-color);
	flex-wrap: wrap;
}

.rmp-nav-prev,
.rmp-nav-next {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-decoration: none;
	color: var(--rmp-text);
	max-width: 45%;
}

.rmp-nav-next {
	text-align: right;
	margin-left: auto;
}

.rmp-nav-label {
	font-size: 12px;
	font-weight: 700;
	color: var(--rmp-primary);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.rmp-nav-title {
	font-size: 14px;
	font-weight: 600;
}

.rmp-related-resources {
	margin-top: 48px;
}

/* -----------------------------------------------------------------
   Single Resource - PDF Preview (iframe)
----------------------------------------------------------------- */

.rmp-pdf-preview {
	margin-top: 32px;
	padding-top: 32px;
	border-top: 1px solid var(--rmp-border-color);
}

.rmp-pdf-preview-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 16px;
	color: var(--rmp-text);
}

.rmp-pdf-preview-frame-wrap {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid var(--rmp-border-color);
	box-shadow: var(--rmp-shadow-sm);
	background: var(--rmp-bg);
}

.rmp-pdf-preview-iframe {
	display: block;
	width: 100%;
	height: 800px;
	border: 0;
}

.rmp-pdf-preview-fallback {
	margin: 10px 2px 0;
	font-size: 13px;
	color: var(--rmp-text-light);
}

.rmp-pdf-preview-fallback a {
	color: var(--rmp-primary);
	font-weight: 600;
	text-decoration: none;
	margin-left: 4px;
}

.rmp-pdf-preview-fallback a:hover {
	text-decoration: underline;
}

@media (max-width: 640px) {
	.rmp-pdf-preview-iframe {
		height: 520px;
	}
}

.rmp-related-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 24px;
}

/* -----------------------------------------------------------------
   Responsive
----------------------------------------------------------------- */

@media (max-width: 1024px) {
	.rmp-cards-grid,
	.rmp-cards-grid.rmp-columns-3,
	.rmp-cards-grid.rmp-columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.rmp-cards-grid,
	.rmp-cards-grid.rmp-columns-2,
	.rmp-cards-grid.rmp-columns-3,
	.rmp-cards-grid.rmp-columns-4 {
		grid-template-columns: repeat(1, 1fr);
	}

	.rmp-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}

	.rmp-search-box {
		min-width: 0;
	}

	.rmp-archive-title {
		font-size: 30px;
	}

	.rmp-single-title {
		font-size: 28px;
	}

	.rmp-single-content {
		padding: 24px;
	}

	.rmp-prev-next-nav {
		flex-direction: column;
	}

	.rmp-nav-prev,
	.rmp-nav-next {
		max-width: 100%;
	}

	.rmp-nav-next {
		text-align: left;
		margin-left: 0;
	}
}