/* ==========================================================================
   Custom Tutorials Directory — Frontend Styles
   ========================================================================== */

.ctd-wrapper {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 0;
	box-sizing: border-box;
}

.ctd-wrapper *,
.ctd-wrapper *::before,
.ctd-wrapper *::after {
	box-sizing: border-box;
}

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

.ctd-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	margin-bottom: 24px;
	padding: 16px;
	background: #f7f7f8;
	border-radius: 10px;
}

.ctd-filter-field {
	flex: 1 1 180px;
}

.ctd-filter-search {
	flex: 2 1 240px;
}

.ctd-filter-select,
.ctd-filter-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d7d7db;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	color: #222;
}

.ctd-filter-select:focus,
.ctd-filter-input:focus {
	outline: none;
	border-color: #e02424;
	box-shadow: 0 0 0 2px rgba(224, 36, 36, 0.15);
}

.ctd-filter-submit {
	flex: 0 0 auto;
	padding: 10px 22px;
	background: #e02424;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ctd-filter-submit:hover {
	background: #c11e1e;
}

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

.ctd-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
}

@media (max-width: 640px) {
	.ctd-grid {
		grid-template-columns: 1fr;
	}
}

.ctd-no-results {
	text-align: center;
	padding: 40px 0;
	color: #666;
	font-size: 15px;
}

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

.ctd-card {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ctd-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.ctd-card-thumb {
	position: relative;
	flex: 0 0 160px;
	width: 160px;
	aspect-ratio: 16 / 9;
	background: #e9e9ec;
	overflow: hidden;
}

.ctd-card-thumb img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Red play icon, bottom-right overlay */
.ctd-play-icon {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #e02424;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.ctd-play-icon svg {
	width: 14px;
	height: 14px;
	margin-left: 2px; /* optical centering for the play triangle */
}

.ctd-card-body {
	flex: 1 1 auto;
	min-width: 0; /* allow text to shrink/wrap instead of overflowing the flex row */
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 10px 14px;
}

.ctd-card-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: #1a1a1a;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ctd-card-duration {
	display: inline-block;
	font-size: 12.5px;
	color: #888;
}

@media (max-width: 480px) {
	.ctd-card-thumb {
		flex-basis: 110px;
		width: 110px;
	}
}

/* ---------- Pagination ---------- */

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

.ctd-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 6px;
	background: #f2f2f3;
	color: #333;
	text-decoration: none;
	font-size: 14px;
}

.ctd-pagination .page-numbers.current {
	background: #e02424;
	color: #fff;
}

.ctd-pagination .page-numbers:hover:not(.current) {
	background: #e6e6e8;
}

/* ---------- Loading state (AJAX) ---------- */

.ctd-grid-container.ctd-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ==========================================================================
   Single Tutorial Page
   ========================================================================== */

.ctd-single-wrapper {
	max-width: 900px;
	margin: 0 auto;
	padding: 24px 20px 60px;
}

.ctd-single-header {
	margin-bottom: 16px;
}

.ctd-back-link {
	display: inline-block;
	font-size: 14px;
	font-weight: 600;
	color: #444;
	text-decoration: none;
	padding: 6px 0;
}

.ctd-back-link:hover {
	color: #e02424;
}

.ctd-single-title {
	font-size: 28px;
	line-height: 1.3;
	margin: 0 0 10px;
	color: #1a1a1a;
}

.ctd-single-meta {
	font-size: 13.5px;
	color: #777;
	margin-bottom: 20px;
}

.ctd-single-meta-sep {
	margin: 0 6px;
}

.ctd-video-responsive {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 responsive ratio */
	background: #000;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 24px;
}

.ctd-video-responsive iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ctd-single-fallback-image {
	margin-bottom: 24px;
	border-radius: 10px;
	overflow: hidden;
}

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

.ctd-single-content {
	font-size: 16px;
	line-height: 1.7;
	color: #222;
}
