/**
 * ABP Course Template System — Frontend Styles
 * ABP-002: Standardizes course page layouts across all LearnDash content.
 */

/* =============================================
   CSS Custom Properties (accent set via inline)
   ============================================= */
:root {
	--abp-cts-accent: #2271b1;
	--abp-cts-text: #1d2327;
	--abp-cts-text-light: #50575e;
	--abp-cts-bg: #ffffff;
	--abp-cts-bg-alt: #f6f7f7;
	--abp-cts-border: #dcdcde;
	--abp-cts-radius: 8px;
	--abp-cts-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	--abp-cts-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* =============================================
   1. TYPOGRAPHY — Consistent text across content
   ============================================= */
.abp-cts-active {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--abp-cts-text);
}

.abp-cts-active h1,
.abp-cts-active h2,
.abp-cts-active h3,
.abp-cts-active h4 {
	color: var(--abp-cts-text);
	font-weight: 600;
	line-height: 1.3;
	margin-top: 1.5em;
	margin-bottom: 0.5em;
}

.abp-cts-active h1 { font-size: 1.75em; }
.abp-cts-active h2 { font-size: 1.4em; }
.abp-cts-active h3 { font-size: 1.2em; }
.abp-cts-active h4 { font-size: 1.05em; }

.abp-cts-active p {
	margin-bottom: 1em;
}

.abp-cts-active ul,
.abp-cts-active ol {
	margin-bottom: 1em;
	padding-left: 1.5em;
}

.abp-cts-active li {
	margin-bottom: 0.35em;
}

/* =============================================
   2. VIDEO SECTION
   ============================================= */
.abp-cts-video-section {
	margin-bottom: 2em;
}

.abp-cts-video-wrap {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
	overflow: hidden;
	border-radius: var(--abp-cts-radius);
	box-shadow: var(--abp-cts-shadow-lg);
	margin-bottom: 1.5em;
	background: #000;
}

.abp-cts-video-wrap iframe,
.abp-cts-video-wrap video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.abp-cts-video-wrap + .abp-cts-video-wrap {
	margin-top: 1em;
}

/* =============================================
   3. BODY CONTENT
   ============================================= */
.abp-cts-body-content {
	margin-bottom: 2em;
}

.abp-cts-body-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--abp-cts-radius);
}

/* =============================================
   4. HANDOUTS BOX
   ============================================= */
.abp-cts-handouts {
	background: var(--abp-cts-bg-alt);
	border: 1px solid var(--abp-cts-border);
	border-left: 4px solid var(--abp-cts-accent);
	border-radius: var(--abp-cts-radius);
	padding: 1.25em 1.5em;
	margin-top: 2em;
	margin-bottom: 1.5em;
}

.abp-cts-handouts-title {
	font-size: 1.1em;
	font-weight: 600;
	margin: 0 0 0.75em;
	color: var(--abp-cts-text);
	display: flex;
	align-items: center;
	gap: 0.4em;
}

.abp-cts-handouts-title .dashicons {
	color: var(--abp-cts-accent);
	font-size: 1.2em;
	width: 1.2em;
	height: 1.2em;
}

.abp-cts-handout-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.abp-cts-handout-list li {
	padding: 0.5em 0;
	border-bottom: 1px solid var(--abp-cts-border);
	margin-bottom: 0;
}

.abp-cts-handout-list li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.abp-cts-handout-list a {
	color: var(--abp-cts-accent);
	text-decoration: none;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	transition: color 0.2s;
}

.abp-cts-handout-list a:hover {
	color: var(--abp-cts-text);
	text-decoration: underline;
}

/* File type icons */
.abp-cts-file-icon {
	display: inline-block;
	width: 1.2em;
	height: 1.2em;
	flex-shrink: 0;
}

.abp-cts-file-icon::before {
	font-family: dashicons;
	font-size: 1.2em;
	line-height: 1;
}

.abp-cts-file-pdf::before { content: "\f497"; color: #d63638; }
.abp-cts-file-doc::before,
.abp-cts-file-docx::before { content: "\f497"; color: #2271b1; }
.abp-cts-file-ppt::before,
.abp-cts-file-pptx::before { content: "\f497"; color: #d35400; }
.abp-cts-file-xls::before,
.abp-cts-file-xlsx::before,
.abp-cts-file-csv::before { content: "\f497"; color: #00a32a; }
.abp-cts-file-zip::before,
.abp-cts-file-rar::before { content: "\f497"; color: #8c8f94; }

/* =============================================
   5. MATERIALS TAB
   ============================================= */
.abp-cts-materials-wrap {
	padding: 0.5em 0;
}

.abp-cts-materials-wrap a {
	color: var(--abp-cts-accent);
	font-weight: 500;
}

.abp-cts-materials-wrap a:hover {
	text-decoration: underline;
}

.abp-cts-materials-wrap ul,
.abp-cts-materials-wrap ol {
	padding-left: 1.5em;
}

.abp-cts-materials-wrap li {
	padding: 0.3em 0;
}

/* =============================================
   6. LEARNDASH CONTENT TABLE / LESSON LIST
   ============================================= */
.abp-cts-active .ld-item-list .ld-item-list-item {
	border-color: var(--abp-cts-border);
	transition: background-color 0.2s;
}

.abp-cts-active .ld-item-list .ld-item-list-item:hover {
	background-color: var(--abp-cts-bg-alt);
}

.abp-cts-active .ld-item-list .ld-section-heading h2 {
	font-size: 1.3em;
	font-weight: 600;
	color: var(--abp-cts-text);
}

/* =============================================
   7. QUIZ STYLES — Card-based (default)
   ============================================= */
.abp-cts-active .wpProQuiz_content {
	font-family: inherit;
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_questionList {
	background: var(--abp-cts-bg);
	border: 1px solid var(--abp-cts-border);
	border-radius: var(--abp-cts-radius);
	padding: 1.5em;
	margin-bottom: 1.5em;
	box-shadow: var(--abp-cts-shadow);
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_question_text {
	font-size: 1.05em;
	font-weight: 500;
	color: var(--abp-cts-text);
	margin-bottom: 1em;
	line-height: 1.5;
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_questionListItem {
	padding: 0.6em 0.8em;
	margin-bottom: 0.4em;
	border-radius: 4px;
	transition: background-color 0.15s;
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_questionListItem:hover {
	background-color: var(--abp-cts-bg-alt);
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_questionListItem label {
	cursor: pointer;
	display: flex;
	align-items: flex-start;
	gap: 0.5em;
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_questionListItem input[type="radio"],
.abp-cts-active .wpProQuiz_content .wpProQuiz_questionListItem input[type="checkbox"] {
	margin-top: 0.25em;
	flex-shrink: 0;
}

/* Quiz buttons */
.abp-cts-active .wpProQuiz_content .wpProQuiz_button,
.abp-cts-active .wpProQuiz_content .wpProQuiz_button2 {
	background-color: var(--abp-cts-accent);
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 0.6em 1.2em;
	font-size: 0.95em;
	font-weight: 500;
	cursor: pointer;
	transition: opacity 0.2s;
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_button:hover,
.abp-cts-active .wpProQuiz_content .wpProQuiz_button2:hover {
	opacity: 0.85;
}

/* Quiz results */
.abp-cts-active .wpProQuiz_results {
	background: var(--abp-cts-bg-alt);
	border: 1px solid var(--abp-cts-border);
	border-radius: var(--abp-cts-radius);
	padding: 1.5em;
}

/* Quiz timer */
.abp-cts-active .wpProQuiz_time_limit .wpProQuiz_progress {
	background-color: var(--abp-cts-accent);
	border-radius: 4px;
	height: 8px;
}

/* Correct / Incorrect indicators */
.abp-cts-active .wpProQuiz_content .wpProQuiz_correct {
	color: #00a32a;
	font-weight: 600;
}

.abp-cts-active .wpProQuiz_content .wpProQuiz_incorrect {
	color: #d63638;
	font-weight: 600;
}

/* =============================================
   8. LEARNDASH BUTTONS
   ============================================= */
.abp-cts-active .ld-content-actions .ld-button,
.abp-cts-active .learndash-wrapper .ld-button {
	border-radius: 4px;
	font-weight: 500;
	letter-spacing: 0.01em;
	transition: opacity 0.2s, transform 0.1s;
}

.abp-cts-active .ld-content-actions .ld-button:hover,
.abp-cts-active .learndash-wrapper .ld-button:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

/* =============================================
   9. TABS STYLING
   ============================================= */
.abp-cts-active .ld-tabs .ld-tabs-navigation .ld-tab {
	font-weight: 500;
	transition: border-color 0.2s;
}

.abp-cts-active .ld-tabs .ld-tabs-content {
	padding: 1.25em 0;
}

/* =============================================
   10. RESPONSIVE
   ============================================= */
@media (max-width: 782px) {
	.abp-cts-active {
		font-size: 15px;
	}

	.abp-cts-active h1 { font-size: 1.5em; }
	.abp-cts-active h2 { font-size: 1.25em; }

	.abp-cts-handouts {
		padding: 1em;
	}

	.abp-cts-active .wpProQuiz_content .wpProQuiz_questionList {
		padding: 1em;
	}
}
