/* =============================================================================
   RHAP Video Library — Public Styles
   ============================================================================= */

/* ── Library layout ─────────────────────────────────────────────────────── */
.rhap-library {
	font-family: inherit;
}

/* Recently Added strip */
.rhap-recent {
	margin-bottom: 2rem;
}
.rhap-section-label {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 .85rem;
	color: #333;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.rhap-recent-row {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: .85rem;
}
@media (max-width: 900px)  { .rhap-recent-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .rhap-recent-row { grid-template-columns: repeat(2, 1fr); } }

/* Library body: sidebar + grid */
.rhap-library-body {
	display: grid;
	grid-template-columns: 210px 1fr;
	gap: 1.75rem;
	align-items: start;
}
@media (max-width: 700px) {
	.rhap-library-body { grid-template-columns: 1fr; }
}

/* ── Series sidebar ─────────────────────────────────────────────────────── */
.rhap-series-nav {
	background: #f4f4f6;
	border-radius: 8px;
	overflow: hidden;
	position: sticky;
	top: 32px;
}
.rhap-series-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.rhap-series-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .5rem;
	padding: .6rem .9rem;
	cursor: pointer;
	border-bottom: 1px solid #e5e5e8;
	transition: background .12s ease;
	user-select: none;
}
.rhap-series-item:last-child { border-bottom: none; }
.rhap-series-item:hover      { background: #eaeaed; }
.rhap-series-item:focus      { outline: 2px solid #0073aa; outline-offset: -2px; }
.rhap-series-item.rhap-series-active {
	background: #1a1a2e;
	color: #fff;
}
.rhap-series-item.rhap-series-active .rhap-series-count {
	background: rgba(255,255,255,.2);
	color: #fff;
}
.rhap-series-name {
	font-size: .85rem;
	font-weight: 500;
	line-height: 1.3;
	flex: 1;
}
.rhap-series-count {
	font-size: .72rem;
	background: #ddd;
	border-radius: 999px;
	padding: .1rem .45rem;
	color: #555;
	flex-shrink: 0;
	white-space: nowrap;
}

/* ── Grid area ──────────────────────────────────────────────────────────── */
.rhap-grid-area   { min-width: 0; }
.rhap-collection-label {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 .85rem;
	color: #333;
	text-transform: uppercase;
	letter-spacing: .06em;
}

/* ── Video grid ─────────────────────────────────────────────────────────── */
.rhap-video-grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(4, 1fr);
}
.rhap-cols-1 { grid-template-columns: 1fr; }
.rhap-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rhap-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rhap-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .rhap-video-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .rhap-video-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px)  { .rhap-video-grid { grid-template-columns: 1fr; } }

/* ── Video tile (card) ──────────────────────────────────────────────────── */
.rhap-video-card {
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	background: #1a1a2e;
	transition: transform .15s ease, box-shadow .15s ease;
	box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.rhap-video-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.rhap-tile-thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.rhap-thumb-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.rhap-tile-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0,0,0,0);
	transition: background .15s ease;
}
.rhap-video-card:hover .rhap-tile-overlay {
	background: rgba(0,0,0,.35);
}
.rhap-tile-play {
	font-size: 2rem;
	color: rgba(255,255,255,.0);
	transition: color .15s ease, transform .15s ease;
	user-select: none;
	position: relative;
	z-index: 1;
}
.rhap-video-card:hover .rhap-tile-play {
	color: rgba(255,255,255,.9);
	transform: scale(1.15);
}
.rhap-tile-lock {
	position: absolute;
	bottom: .5rem;
	right: .6rem;
	font-size: 1.1rem;
	opacity: .9;
	z-index: 1;
}
.rhap-tile-info {
	padding: .55rem .75rem .7rem;
	background: #1a1a2e;
	color: #fff;
}
.rhap-tile-info h4 {
	margin: 0 0 .25rem;
	font-size: .82rem;
	line-height: 1.35;
	color: #e6e6ee;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.rhap-tile-info .rhap-duration {
	font-size: .72rem;
	color: #888;
}
.rhap-tile-meta {
	display: flex;
	align-items: center;
	gap: .5rem;
	flex-wrap: wrap;
}
.rhap-tile-meta .rhap-date {
	font-size: .72rem;
	color: #666;
}
.rhap-tile-meta .rhap-date::before {
	content: '·';
	margin-right: .5rem;
	color: #555;
}

/* ── Blur toggle ─────────────────────────────────────────────────────────── */
.rhap-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: .85rem;
}
.rhap-section-header .rhap-section-label {
	margin-bottom: 0;
}
.rhap-blur-btn {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .3rem .75rem;
	background: transparent;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: .8rem;
	cursor: pointer;
	color: #555;
	transition: background .15s, color .15s;
}
.rhap-blur-btn:hover {
	background: #f0f0f0;
	color: #222;
}
.rhap-blur-btn .dashicons {
	font-size: 1rem;
	width: 1rem;
	height: 1rem;
	line-height: 1;
}

/* Blur thumbnails (all tiles) when blur mode is active */
.rhap-blur-locked .rhap-thumb-img {
	filter: blur(8px);
	transform: scale(1.08);
}
.rhap-thumb-img {
	transition: filter .3s ease, transform .3s ease;
}

/* ── Notice ─────────────────────────────────────────────────────────────── */
.rhap-notice {
	padding: .75rem 1rem;
	border-left: 4px solid #ccc;
	background: #fffbf0;
	margin-bottom: 1rem;
	border-radius: 0 4px 4px 0;
}
.rhap-notice--warning { border-color: #f0a500; }
.rhap-empty { color: #888; font-style: italic; }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.rhap-modal {
	position: fixed;
	inset: 0;
	z-index: 999999; /* above Divi header and all theme elements */
	display: flex;
	align-items: center;
	justify-content: center;
}
.rhap-modal[hidden] { display: none; }
.rhap-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.8);
}
.rhap-modal-content {
	position: relative;
	width: min(92vw, 1000px);
	background: #111;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 16px 48px rgba(0,0,0,.7);
	max-height: calc(100vh - 2rem);
	display: flex;
	flex-direction: column;
}
.rhap-modal-content--small {
	width: min(92vw, 420px);
	background: #fff;
	border-radius: 12px;
	max-height: none;
	display: block;
}
/* Header bar inside the video modal — holds title + close button */
.rhap-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: .45rem .75rem .45rem 1rem;
	background: #1a1a1a;
	flex-shrink: 0;
}
.rhap-modal-header-title {
	color: #ddd;
	font-size: .9rem;
	font-weight: 600;
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Close button — inside the header bar */
.rhap-modal-close {
	background: rgba(255,255,255,.12);
	border: 1px solid rgba(255,255,255,.25);
	color: #fff;
	font-size: .88rem;
	font-weight: 600;
	line-height: 1;
	padding: .3rem .8rem;
	border-radius: 4px;
	cursor: pointer;
	white-space: nowrap;
	flex-shrink: 0;
}
.rhap-modal-close:hover { background: rgba(255,255,255,.28); }
.rhap-modal-content--small .rhap-modal-close {
	position: absolute;
	top: .6rem;
	right: .8rem;
	color: #333;
	background: rgba(0,0,0,.1);
	border: none;
	font-size: 1.4rem;
	padding: .15rem .55rem;
}
.rhap-modal-player {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
}
.rhap-modal-player video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
}

/* Access denied modal body */
.rhap-access-denied {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .85rem;
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: #333;
}
.rhap-lock-icon  { font-size: 3rem; display: block; }
.rhap-access-denied p { margin: 0; font-size: .95rem; }

/* CTA buttons */
.rhap-btn {
	display: inline-block;
	padding: .5rem 1.2rem;
	border-radius: 4px;
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	transition: background .15s ease;
}
.rhap-btn--patreon { background: #f96854; color: #fff; }
.rhap-btn--patreon:hover { background: #e05a49; color: #fff; }

/* ── Overview: latest per series ────────────────────────────────────────── */
.rhap-overview-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 1.5rem 1rem;
}
.rhap-overview-item { display: flex; flex-direction: column; }
.rhap-overview-series-name {
	font-size: .78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	color: #666;
	margin: 0 0 .4rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rhap-overview-item .rhap-video-card { flex: 1; }

/* ── Password gate ──────────────────────────────────────────────────────── */
.rhap-password-gate {
	margin-bottom: 2rem;
}
.rhap-password-card {
	background: #f8f8fa;
	border: 1px solid #e2e2e8;
	border-radius: 10px;
	padding: 1.75rem 2rem;
	max-width: 480px;
	margin: 0 auto;
	text-align: center;
}
.rhap-password-card h3 {
	margin: 0 0 .6rem;
	font-size: 1.15rem;
	color: #1a1a2e;
}
.rhap-password-card p {
	margin: 0 0 1rem;
	font-size: .92rem;
	color: #555;
}
.rhap-password-row {
	display: flex;
	gap: .5rem;
	margin-bottom: .75rem;
}
.rhap-pw-input {
	flex: 1;
	padding: .5rem .75rem;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: .95rem;
	outline: none;
	transition: border-color .15s ease;
}
.rhap-pw-input:focus { border-color: #4a90d9; box-shadow: 0 0 0 2px rgba(74,144,217,.25); }
.rhap-pw-submit {
	padding: .5rem 1.1rem;
	background: #1a1a2e;
	color: #fff;
	border: none;
	border-radius: 5px;
	font-size: .92rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease;
	white-space: nowrap;
}
.rhap-pw-submit:hover:not(:disabled) { background: #2e2e5e; }
.rhap-pw-submit:disabled { opacity: .6; cursor: default; }
.rhap-pw-error {
	color: #c0392b;
	font-size: .87rem;
	margin: 0 0 .75rem;
}
.rhap-pw-separator {
	color: #999;
	font-size: .85rem;
	margin: .5rem 0;
}

/* ── Admin overrides ────────────────────────────────────────────────────── */
.rhap-vl-wrap .widefat code { font-size: .8rem; }
