/* ===== Hide featured image on single video (theme/Divi fallback) ===== */
body.iiv-single-video .post-thumbnail,
body.iiv-single-video .entry-featured-image-url,
body.iiv-single-video .wp-post-image,
body.iiv-single-video .et_pb_post_main_image_container,
body.iiv-single-video .et_post_meta_wrapper .post-thumbnail,
body.iiv-single-video .et_pb_post .entry-featured-image-url,
body.iiv-single-video > .site .wp-post-image {
	display: none !important;
}

/* Hide publish date on single video (author link stays visible) */
body.iiv-single-video .et_pb_title_meta_container,
body.iiv-single-video .entry-meta,
body.iiv-single-video .post-meta {
	font-size: 0;
}

body.iiv-single-video .et_pb_title_meta_container a,
body.iiv-single-video .entry-meta a,
body.iiv-single-video .post-meta a {
	font-size: 0.9rem;
}

body.iiv-single-video .published,
body.iiv-single-video .entry-date,
body.iiv-single-video .post-date,
body.iiv-single-video time.published,
body.iiv-single-video time.entry-date {
	display: none !important;
}

body.iiv-single-video .iiv-video-wrap,
body.iiv-single-video .iiv-video-wrap iframe {
	display: block !important;
}

/* ===== Video & description ===== */
.iiv-video-wrap {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
	border-radius: 12px;
	background: #111;
	margin: 1rem 0 1.5rem;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.iiv-video-wrap iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.iiv-short-desc {
	font-size: 1.05rem;
	line-height: 1.6;
	margin: 0 0 1.5rem;
}

/* ===== Unlock panel ===== */
.iiv-unlock-panel {
	background: #f7f9fc;
	border: 1px solid #dbe4f0;
	border-radius: 12px;
	padding: 1.25rem 1.5rem;
	margin-top: 2rem;
}

.iiv-unlock-panel h3 { margin-top: 0; }

.iiv-unlock-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	margin: 1rem 0;
}

.iiv-unlock-form input[type="password"],
.iiv-unlock-form input[type="text"] {
	flex: 1 1 200px;
	padding: 0.65rem 0.85rem;
	border: 1px solid #c5d0de;
	border-radius: 8px;
	font-size: 1rem;
}

.iiv-unlock-form button {
	padding: 0.65rem 1.25rem;
	border: 0;
	border-radius: 8px;
	background: #c0392b;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.iiv-unlock-form button:hover { background: #a93226; }
.iiv-unlock-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.iiv-message { margin-top: 0.75rem; font-weight: 600; }
.iiv-message.iiv-success { color: #1e7e34; }
.iiv-message.iiv-error { color: #b32d2e; }

/* ===== Reserved content ===== */
.iiv-reserved-content { margin-top: 2rem; }
.iiv-section { margin-bottom: 2.5rem; }
.iiv-section h2 { font-size: 1.35rem; margin-bottom: 1rem; }

/* Glossary expandable */
.iiv-glossary-expandable {
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.iiv-glossary-expandable summary {
	padding: 1rem 1.25rem;
	cursor: pointer;
	list-style: none;
	background: #f7f9fc;
	font-weight: 600;
	font-size: 1.1rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	user-select: none;
}

.iiv-glossary-expandable summary::-webkit-details-marker { display: none; }
.iiv-glossary-expandable summary::marker { content: ''; }

.iiv-glossary-expandable summary::after {
	content: '▾';
	font-size: 1rem;
	color: #666;
	transition: transform 0.2s;
}

.iiv-glossary-expandable[open] summary::after {
	transform: rotate(180deg);
}

.iiv-glossary-expandable summary:hover {
	background: #eef2f7;
}

.iiv-glossary-content {
	padding: 1.25rem 1.5rem;
	line-height: 1.7;
}

/* ===== Exercise engine ===== */
.iiv-exercise-engine {
	--iiv-accent: #c0392b;
	--iiv-selected: #1592f3;
	--iiv-selected-bg: #e3f2fd;
	--iiv-ok: #1e7e34;
	--iiv-ok-bg: #e8f5e9;
	--iiv-bad: #b32d2e;
	--iiv-bad-bg: #fdecea;
}

.iiv-ex-progress {
	font-size: 0.9rem;
	color: #666;
	margin-bottom: 0.75rem;
}

.iiv-ex-timestamp-link {
	display: inline-flex;
	align-items: center;
	gap: 0.2rem;
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: #1592f3;
	text-decoration: none;
}

.iiv-ex-timestamp-link:hover,
.iiv-ex-timestamp-link:focus {
	color: #0d6ecd;
	text-decoration: underline;
}

.iiv-ex-timestamp-icon {
	font-size: 0.75rem;
}

.iiv-ex-timestamp-time {
	color: #666;
	font-weight: 400;
}

.iiv-ex-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 1.25rem 1.5rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
	animation: iivFadeIn 0.35s ease;
}

@keyframes iivFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.iiv-ex-question {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 1rem;
	line-height: 1.7;
}

.iiv-ex-hint {
	font-size: 0.9rem;
	color: #666;
	margin: 0 0 1rem;
}

.iiv-ex-blank {
	display: inline-block;
	min-width: 5rem;
	padding: 0.05em 0.5em;
	margin: 0 0.15em;
	border-bottom: 3px solid var(--iiv-accent);
	text-align: center;
	font-weight: 700;
	color: #222;
	transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.iiv-ex-blank.is-filled {
	color: var(--iiv-selected);
	border-bottom-color: var(--iiv-selected);
}

.iiv-ex-blank.is-correct {
	color: var(--iiv-ok);
	border-bottom-color: var(--iiv-ok);
	background: var(--iiv-ok-bg);
}

.iiv-ex-blank.is-wrong {
	color: var(--iiv-bad);
	border-bottom-color: var(--iiv-bad);
	background: var(--iiv-bad-bg);
}

.iiv-ex-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.iiv-ex-options-column {
	flex-direction: column;
	align-items: stretch;
}

.iiv-ex-option {
	padding: 0.55rem 1rem;
	border: 2px solid #d0d7e2;
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: 0.95rem;
	font-family: inherit;
	color: #222;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.iiv-ex-options-column .iiv-ex-option {
	border-radius: 10px;
	text-align: left;
}

.iiv-ex-option:hover:not(:disabled) {
	border-color: var(--iiv-selected);
}

.iiv-ex-option.is-selected {
	border-color: var(--iiv-selected);
	background: var(--iiv-selected-bg);
	color: #0d47a1;
}

.iiv-ex-option.is-correct {
	border-color: var(--iiv-ok);
	background: var(--iiv-ok-bg);
	color: var(--iiv-ok);
}

.iiv-ex-option.is-wrong {
	border-color: var(--iiv-bad);
	background: var(--iiv-bad-bg);
	color: var(--iiv-bad);
}

.iiv-ex-option:disabled {
	cursor: default;
}

.iiv-ex-actions {
	display: flex;
	gap: 0.75rem;
	align-items: center;
	flex-wrap: wrap;
}

.iiv-ex-btn {
	padding: 0.6rem 1.25rem;
	border-radius: 8px;
	border: 0;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	background: var(--iiv-accent);
	color: #fff;
	font-size: 0.95rem;
}

.iiv-ex-btn:hover:not(:disabled) {
	filter: brightness(0.95);
}

.iiv-ex-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.iiv-ex-btn.iiv-ex-secondary {
	background: #eef2f7;
	color: #333;
}

.iiv-ex-feedback {
	margin-top: 0.75rem;
	font-weight: 600;
	min-height: 1.25rem;
}

.iiv-ex-feedback.is-ok { color: var(--iiv-ok); }
.iiv-ex-feedback.is-bad { color: var(--iiv-bad); }

.iiv-ex-correct-answer {
	margin-top: 0.4rem;
	padding: 0.5rem 0.75rem;
	background: #f3f8fd;
	border-left: 3px solid #1592f3;
	border-radius: 4px;
	color: #1d3557;
	font-weight: 400;
	font-size: 0.95rem;
	line-height: 1.45;
}

.iiv-ex-correct-answer strong {
	color: #0d6ecd;
	font-weight: 600;
}

.iiv-ex-order-selected {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	min-height: 2.75rem;
	padding: 0.55rem;
	border: 2px dashed #c5d0de;
	border-radius: 10px;
	margin-bottom: 0.75rem;
}

.iiv-ex-order-pool {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1rem;
}

/* ===== Complete screen ===== */
.iiv-ex-complete {
	text-align: center;
	padding: 2.5rem 1.5rem;
	background: linear-gradient(135deg, #f0faf2 0%, #e8f5e9 100%);
	border-radius: 16px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
	animation: iivFadeIn 0.4s ease;
}

.iiv-ex-complete-icon {
	width: 72px;
	height: 72px;
	color: #d4a017;
	margin: 0 auto 1rem;
	display: block;
	filter: drop-shadow(0 4px 8px rgba(212, 160, 23, 0.3));
}

.iiv-ex-complete-score {
	font-size: 3rem;
	font-weight: 800;
	color: var(--iiv-ok);
	line-height: 1;
	margin-bottom: 0.35rem;
}

.iiv-ex-complete-score-label {
	font-size: 0.95rem;
	color: #555;
	margin-bottom: 1.5rem;
	text-transform: lowercase;
}

.iiv-ex-complete-message {
	font-size: 1.2rem;
	font-weight: 600;
	color: #222;
	margin-bottom: 1.75rem;
	line-height: 1.4;
}

.iiv-ex-retry {
	padding: 0.75rem 1.75rem;
	border-radius: 8px;
	border: 0;
	background: var(--iiv-accent);
	color: #fff;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	font-size: 1rem;
	box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
	transition: transform 0.15s, box-shadow 0.15s;
}

.iiv-ex-retry:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(192, 57, 43, 0.35);
}

/* =====================================================================
   Listing video (shortcode [iiv_videos])
   ===================================================================== */

.iiv-videos {
	--iiv-card-radius: 16px;
	--iiv-card-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
	--iiv-card-shadow-hover: 0 14px 32px rgba(0, 0, 0, 0.14);
	--iiv-card-border: #e6ebf2;
	--iiv-accent: #c0392b;
	--iiv-text: #1d2530;
	--iiv-muted: #5b6471;
	margin: 1.5rem 0 2rem;
	color: var(--iiv-text);
}

/* ---- Filter selectors ---- */
.iiv-videos-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
}

.iiv-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 1.1rem;
	border: 1.5px solid var(--iiv-card-border);
	background: #fff;
	border-radius: 999px;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--iiv-muted);
	cursor: pointer;
	text-decoration: none;
	transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}

.iiv-filter-btn:hover {
	border-color: var(--iiv-accent);
	color: var(--iiv-text);
}

.iiv-filter-btn.is-active {
	background: var(--iiv-accent);
	border-color: var(--iiv-accent);
	color: #fff;
	font-weight: 600;
}

/* ---- Grid ---- */
.iiv-videos-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.5rem;
}

@media (max-width: 1024px) {
	.iiv-videos-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.25rem;
	}
}

@media (max-width: 600px) {
	.iiv-videos-grid {
		grid-template-columns: 1fr;
		gap: 1.1rem;
	}
}

/* ---- Card ---- */
.iiv-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--iiv-card-border);
	border-radius: var(--iiv-card-radius);
	overflow: hidden;
	box-shadow: var(--iiv-card-shadow);
	transition: transform 0.2s, box-shadow 0.2s;
}

.iiv-card:hover,
.iiv-card:focus-within {
	transform: translateY(-3px);
	box-shadow: var(--iiv-card-shadow-hover);
}

.iiv-card.is-hidden {
	display: none;
}

/* ---- Cover ---- */
.iiv-card-cover {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: #0d0d0d;
	overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
	.iiv-card-cover {
		padding-bottom: 56.25%;
		height: 0;
	}
}

.iiv-card-img,
.iiv-card-img-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: center;
	transition: transform 0.4s ease;
}

.iiv-card:hover .iiv-card-img {
	transform: scale(1.03);
}

.iiv-card-img-placeholder {
	background: linear-gradient(135deg, #2c3e50 0%, #4a5d72 100%);
}

/* Reserved video overlay */
.iiv-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: rgba(0, 0, 0, 0.6);
	text-align: center;
	padding: 1rem;
	backdrop-filter: blur(1px);
	transition: background 0.2s;
}

.iiv-card:hover .iiv-card-overlay {
	background: rgba(0, 0, 0, 0.7);
}

.iiv-overlay-icon {
	color: #fff;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.iiv-card-overlay-label {
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---- Card body ---- */
.iiv-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1rem 1.15rem 1.15rem;
	flex: 1;
}

.iiv-card-title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.35;
	font-weight: 700;
	color: var(--iiv-text);
}

.iiv-card-title a {
	color: inherit;
	text-decoration: none;
	background: none;
	box-shadow: none;
}

.iiv-card-title a:hover,
.iiv-card-title a:focus {
	color: var(--iiv-accent);
}

/* ---- Resource status row ---- */
.iiv-card-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.4rem;
}

.iiv-status-sep {
	color: var(--iiv-muted);
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1;
	user-select: none;
}

.iiv-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.22rem 0.55rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	border-radius: 999px;
	border: 1px solid transparent;
	line-height: 1;
}

.iiv-badge svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

.iiv-badge-open {
	background: #e6f6ec;
	color: #1e7e34;
	border-color: #b8e0c4;
}

.iiv-badge-closed {
	background: #fdecea;
	color: #b32d2e;
	border-color: #f4c8c4;
}

/* ---- CTA ---- */
.iiv-card-cta {
	margin-top: auto;
	padding-top: 0.4rem;
}

.iiv-card-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 1.1rem;
	border-radius: 999px;
	background: var(--iiv-accent);
	color: #fff !important;
	font-weight: 600;
	font-size: 0.92rem;
	text-decoration: none !important;
	box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
	transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.iiv-card-btn:hover,
.iiv-card-btn:focus {
	background: #a93226;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(192, 57, 43, 0.35);
	color: #fff !important;
}

.iiv-card-btn-arrow {
	transition: transform 0.15s;
}

.iiv-card-btn:hover .iiv-card-btn-arrow {
	transform: translateX(2px);
}

/* ---- Pagination ---- */
.iiv-videos-pagination {
	margin-top: 1.75rem;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.iiv-videos-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.2rem;
	height: 2.2rem;
	padding: 0 0.65rem;
	border-radius: 8px;
	border: 1px solid var(--iiv-card-border);
	background: #fff;
	color: var(--iiv-muted);
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.iiv-videos-pagination .page-numbers:hover {
	border-color: var(--iiv-accent);
	color: var(--iiv-text);
}

.iiv-videos-pagination .page-numbers.current {
	background: var(--iiv-accent);
	border-color: var(--iiv-accent);
	color: #fff;
}

/* ---- Empty states ---- */
.iiv-videos-empty {
	text-align: center;
	color: var(--iiv-muted);
	padding: 2rem 1rem;
	font-style: italic;
}

