/**
 * Poker courses: archive, single player, buy modal.
 * Hub layout mirrors poker software hub (.ps-hub-*).
 */

body.h2n-courses-layout .site-content {
	display: block !important;
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

.h2n-courses-hub,
.h2n-course-page {
	width: 100%;
	padding-bottom: 4rem;
}

.h2n-courses-hub .container,
.h2n-course-page .container {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
	box-sizing: border-box;
}

body.post-type-archive-poker_course .breadcrumbs,
body.single-poker_course .breadcrumbs {
	margin-bottom: 2.25rem;
}

.h2n-courses-hub-hero {
	padding: 0 0 1.75rem;
}

/* Single course: no extra gap between lead and player */
body.single-poker_course .h2n-courses-hub-hero {
	padding-bottom: 0;
}

.h2n-courses-hub-title {
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 800;
	color: var(--text-dark);
	margin: 0 0 0.75rem;
	line-height: 1.2;
}

.h2n-courses-hub-lead {
	font-size: 1.1rem;
	line-height: 1.6;
	color: var(--text-gray);
	max-width: 46rem;
	margin: 0;
}

.h2n-courses-hub-lead p {
	margin: 0 0 0.65rem;
	font-size: inherit;
	line-height: inherit;
	color: inherit;
}

.h2n-courses-hub-lead a {
	color: var(--primary-color);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.h2n-courses-hub-lead a:hover {
	color: var(--primary-hover);
	border-bottom-color: var(--primary-color);
}

.h2n-courses-hub-lead > *:first-child {
	margin-top: 0;
}

.h2n-courses-hub-lead > *:last-child,
.h2n-courses-hub-lead p:last-child {
	margin-bottom: 0;
}

.h2n-course-source {
	margin: 0.75rem 0 0;
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--text-muted, #6b7280);
}

.h2n-course-source-item {
	display: inline;
}

.h2n-course-source-sep {
	margin: 0 0.45rem;
	opacity: 0.7;
}

.h2n-course-source-label {
	font-weight: 600;
	margin-right: 0.25rem;
}

.h2n-course-source-link {
	color: var(--primary-color, #2563eb);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: color 0.2s ease, border-bottom-color 0.2s ease;
	word-break: break-word;
}

.h2n-course-source-link:hover {
	color: var(--primary-hover, #1d4ed8);
	border-bottom-color: currentColor;
}

.h2n-courses-hub-content {
	padding: 0.5rem 0 0;
}

.h2n-courses-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.25rem;
}

.h2n-courses-empty {
	padding: 3rem 1rem;
	text-align: center;
	color: var(--text-gray);
	border: 1px dashed var(--border-color);
	border-radius: 12px;
}

.h2n-courses-empty p {
	margin: 0;
}

.h2n-course-extra-content {
	margin-top: 0;
	padding-top: 0;
}

.h2n-course-extra-content > *:first-child {
	margin-top: 0;
}

.h2n-course-extra-content > *:last-child {
	margin-bottom: 0;
}

/* Match software product page H2 treatment inside course body content */
body.single-poker_course .h2n-course-extra-content.article-body h2 {
	font-size: 1.8rem;
	font-weight: 600;
	color: var(--text-light);
	border-bottom-color: var(--border-light);
}

:root:not([data-theme="dark"]) body.single-poker_course .h2n-course-extra-content.article-body h2 {
	color: rgba(0, 0, 0, 0.48);
}

:root[data-theme="dark"] body.single-poker_course .h2n-course-extra-content.article-body h2 {
	color: var(--text-muted);
}

.h2n-course-card {
	background: var(--surface-1, #fff);
	border: 1px solid var(--border-color, #e5e7eb);
	border-radius: 14px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.h2n-course-card:hover {
	border-color: var(--border-strong, #d1d5db);
	box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.08));
	transform: translateY(-2px);
}

.h2n-course-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.h2n-course-card-media {
	aspect-ratio: 16 / 9;
	background: var(--bg-lighter, #f3f4f6);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	overflow: hidden;
}

.h2n-course-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.h2n-course-card-media.has-thumb::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.28) 100%);
	pointer-events: none;
	transition: background 0.2s ease;
}

.h2n-course-card:hover .h2n-course-card-media.has-thumb::after {
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.14) 0%, rgba(15, 23, 42, 0.38) 100%);
}

.h2n-course-card-play {
	position: absolute;
	z-index: 1;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 3rem;
	height: 3rem;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.92);
	color: #0f172a;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
	pointer-events: none;
	transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.h2n-course-card-play svg {
	display: block;
	margin-left: 2px;
}

.h2n-course-card:hover .h2n-course-card-play {
	transform: translate(-50%, -50%) scale(1.06);
	background: #fff;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
}

.h2n-course-card-placeholder {
	color: var(--text-muted, #9ca3af);
}

.h2n-course-card-body {
	padding: 1rem 1.1rem 1.2rem;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	flex: 1;
}

.h2n-course-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.h2n-course-tag {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	background: var(--primary-bg);
	color: var(--primary-dark);
}

.h2n-course-tag-price {
	background: rgba(251, 146, 60, 0.08);
	color: #b45309;
	border: 1px solid rgba(251, 146, 60, 0.22);
	font-weight: 500;
}

:root[data-theme="dark"] .h2n-course-tag-price {
	background: rgba(251, 146, 60, 0.1);
	color: #d4a574;
	border-color: rgba(251, 146, 60, 0.2);
}

.h2n-course-tag-offer {
	background: var(--primary-bg);
	color: var(--primary-dark);
	border: 1px solid rgba(15, 118, 110, 0.22);
	font-weight: 500;
}

:root[data-theme="dark"] .h2n-course-tag-offer {
	border-color: rgba(45, 212, 191, 0.22);
}

.h2n-course-card-title {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.35;
}

.h2n-course-card-tagline {
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.5;
	color: var(--text-gray);
	flex: 1;
}

.h2n-course-card-meta {
	margin: 0;
	font-size: 0.9rem;
	color: var(--text-muted, #6b7280);
}

.h2n-course-player-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 1.25rem;
	align-items: start;
	padding-top: 50px;
	padding-bottom: 50px;
	margin-bottom: 0;
}

.h2n-course-player-main {
	position: relative;
	min-width: 0;
}

.h2n-course-player-stage {
	position: relative;
	background: #0b1220;
	border-radius: 12px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

.h2n-course-player-stage .h2n-course-oembed,
.h2n-course-player-stage .h2n-course-bunny,
.h2n-course-player-stage .h2n-course-html5,
.h2n-course-player-stage iframe,
.h2n-course-player-stage video {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #000;
}

.h2n-course-player-stage .h2n-course-oembed,
.h2n-course-player-stage .h2n-course-bunny {
	position: absolute;
	inset: 0;
}

.h2n-course-player-stage .h2n-course-oembed iframe,
.h2n-course-player-stage .h2n-course-bunny iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.h2n-course-player-empty {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 1.5rem;
	text-align: center;
	color: #e5e7eb;
	background: rgba(11, 18, 32, 0.92);
}

.h2n-course-gate {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 1.5rem;
	text-align: center;
	color: #e5e7eb;
	background: rgba(11, 18, 32, 0.92);
	border-radius: 12px;
	overflow: auto;
}

.h2n-course-gate[hidden] {
	display: none !important;
}

.h2n-course-gate-text {
	margin: 0;
	max-width: 28rem;
	font-size: 1rem;
	line-height: 1.45;
}

.h2n-course-gate-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	justify-content: center;
}

.h2n-course-gate-buy {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	width: min(100%, 22rem);
}

.h2n-course-gate-buy .h2n-course-buy-price {
	margin: 0;
	font-weight: 600;
	font-size: 1.05rem;
	color: #fff;
}

.h2n-course-gate-buy .h2n-course-btn {
	width: 100%;
}

.h2n-course-gate-buy .h2n-course-free-offer {
	margin: 0;
	width: 100%;
	text-align: left;
	background: rgba(251, 146, 60, 0.12);
	border-color: rgba(251, 146, 60, 0.35);
	color: #fdba74;
}

.h2n-course-gate-buy .h2n-course-free-offer a {
	color: #fed7aa;
}

.h2n-course-gate-buy .h2n-course-free-offer a:hover {
	color: #fff7ed;
}

.h2n-course-playlist {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	background: var(--surface-1, #fff);
	border: 1px solid var(--border-color, #e5e7eb);
	border-radius: 12px;
	padding: 1rem;
	/* Keep sidebar ~player-tall: list scrolls, page doesn't stretch */
	max-height: min(32rem, calc(100vh - 8rem));
	min-height: 0;
	position: sticky;
	top: 1rem;
}

.h2n-course-playlist-title {
	margin: 0;
	font-size: 1rem;
	flex-shrink: 0;
}

.h2n-course-playlist-empty {
	margin: 0;
	flex-shrink: 0;
}

.h2n-course-playlist-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	max-height: none;
}

.h2n-course-playlist-item {
	width: 100%;
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	text-align: left;
	border: 1px solid transparent;
	background: transparent;
	border-radius: 8px;
	padding: 0.55rem 0.6rem;
	cursor: pointer;
	color: inherit;
}

.h2n-course-playlist-item:hover,
.h2n-course-playlist-item.is-active {
	background: var(--bg-lighter, #f3f4f6);
	border-color: var(--border-color, #e5e7eb);
}

.h2n-course-playlist-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: calc(0.92rem * 1.35);
	color: var(--text-muted, #6b7280);
	line-height: 0;
}

.h2n-course-playlist-icon svg {
	display: block;
	width: 0.95rem;
	height: 0.95rem;
	flex-shrink: 0;
}

.h2n-course-playlist-item:hover .h2n-course-playlist-icon,
.h2n-course-playlist-item.is-active .h2n-course-playlist-icon {
	color: inherit;
}

.h2n-course-playlist-item.is-locked .h2n-course-playlist-icon {
	color: var(--text-muted, #6b7280);
}

.h2n-course-playlist-item-body {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

body.single-poker_course .h2n-course-playlist h3.h2n-course-playlist-item-title {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	font-family: inherit;
	font-size: 0.92rem;
	font-weight: inherit;
	font-style: normal;
	line-height: 1.35;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
}

.h2n-course-playlist-badge {
	font-size: 0.72rem;
	font-weight: 600;
	color: var(--primary-dark, #1d4ed8);
}

body.single-poker_course .h2n-course-playlist-badge.is-locked,
body.single-poker_course .h2n-course-playlist-item.is-locked h3.h2n-course-playlist-item-title {
	color: var(--text-muted, #6b7280);
}

.h2n-course-buy-price {
	margin: 0 0 0.65rem;
	font-weight: 600;
}

.h2n-course-free-offer {
	margin: 0.75rem 0 0;
	padding: 0.65rem 0.75rem;
	border-radius: 10px;
	border: 1px solid #fddcab;
	background: #fff7ed;
	color: #9a3412;
	font-size: 0.84rem;
	line-height: 1.45;
	font-weight: 500;
}

.h2n-course-free-offer > *:first-child {
	margin-top: 0;
}

.h2n-course-free-offer > *:last-child {
	margin-bottom: 0;
}

.h2n-course-free-offer p {
	margin: 0 0 0.4rem;
}

.h2n-course-free-offer p:last-child {
	margin-bottom: 0;
}

.h2n-course-free-offer a {
	color: #c2410c;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.h2n-course-free-offer a:hover {
	color: #9a3412;
}

:root[data-theme="dark"] .h2n-course-free-offer {
	background: #32220f;
	border-color: rgba(217, 119, 6, 0.28);
	color: #f7c78a;
}

:root[data-theme="dark"] .h2n-course-free-offer a {
	color: #fdba74;
}

:root[data-theme="dark"] .h2n-course-free-offer a:hover {
	color: #fed7aa;
}

.h2n-course-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.65rem 1.1rem;
	border-radius: 10px;
	border: 1px solid transparent;
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.2;
}

.h2n-course-btn[hidden] {
	display: none !important;
}

.h2n-course-btn-primary {
	background: var(--primary-color, #2563eb);
	color: #fff;
}

.h2n-course-btn-primary:hover {
	filter: brightness(1.05);
	color: #fff;
}

:root[data-theme="dark"] .h2n-course-btn-primary,
:root[data-theme="dark"] .h2n-course-btn-primary:hover,
:root[data-theme="dark"] .h2n-course-btn-primary:focus,
:root[data-theme="dark"] .h2n-course-btn-primary:active {
	background: var(--btn-primary-bg);
	color: #fff;
	border-color: var(--btn-primary-border);
	box-shadow: var(--btn-primary-shadow);
	filter: none;
	transform: none;
}

:root[data-theme="dark"] .h2n-course-btn-primary:hover {
	background: var(--btn-primary-bg-hover);
	box-shadow: var(--btn-primary-shadow-hover);
}

.h2n-course-btn-secondary {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.35);
	color: #fff;
}

.h2n-course-btn-block {
	width: 100%;
}

.h2n-course-affiliate-cta {
	margin-top: 1.25rem;
}

.h2n-course-modal[hidden] {
	display: none;
}

.h2n-course-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.h2n-course-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.55);
}

.h2n-course-modal-dialog {
	position: relative;
	width: min(440px, 100%);
	background: var(--surface-1, #fff);
	border-radius: 14px;
	padding: 1.35rem 1.35rem 1.5rem;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	z-index: 1;
}

.h2n-course-modal-close,
.h2n-course-modal-close:hover,
.h2n-course-modal-close:active,
.h2n-course-modal-close:focus {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	font-size: 1.5rem;
	line-height: 1;
	color: #94a3b8;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transform: none;
	transition: color 0.15s ease, background 0.15s ease;
}

.h2n-course-modal-close:hover {
	color: #334155;
	background: #f1f5f9;
}

:root[data-theme="dark"] .h2n-course-modal-close,
:root[data-theme="dark"] .h2n-course-modal-close:hover,
:root[data-theme="dark"] .h2n-course-modal-close:active,
:root[data-theme="dark"] .h2n-course-modal-close:focus {
	color: #94a3b8;
	background: transparent;
}

:root[data-theme="dark"] .h2n-course-modal-close:hover {
	color: #e2e8f0;
	background: rgba(255, 255, 255, 0.06);
}

.h2n-course-modal-close:focus-visible {
	outline: 2px solid var(--primary-color, #2563eb);
	outline-offset: 2px;
}

.h2n-course-modal-dialog .h2n-course-modal-title {
	margin: 0 0 0.4rem;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.3;
	color: inherit;
}

.h2n-course-modal-intro {
	margin: 0 0 1rem;
	color: var(--text-muted, #6b7280);
	font-size: 0.92rem;
}

.h2n-course-modal-dialog label {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin-bottom: 0.75rem;
	font-size: 0.88rem;
	font-weight: 600;
}

.h2n-course-modal-dialog input,
.h2n-course-modal-dialog textarea {
	font: inherit;
	font-weight: 400;
	padding: 0.55rem 0.65rem;
	border: 1px solid var(--border-color, #d1d5db);
	border-radius: 8px;
}

.h2n-course-form-status {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
}

.h2n-course-form-status.is-error {
	color: #b91c1c;
}

.h2n-course-form-status.is-success {
	color: #047857;
}

@media (max-width: 900px) {
	.h2n-course-player-layout {
		grid-template-columns: 1fr;
	}

	.h2n-course-playlist {
		position: static;
		max-height: min(28rem, calc(100vh - 6rem));
	}
}
