/* ---------- Layout ---------- */
.cptva-wrapper {
	max-width: 1200px;
	margin: 0 auto;
}

.cptva-search-form {
	display: flex;
	gap: 8px;
	margin-bottom: 28px;
	max-width: 420px;
}

.cptva-search-input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 15px;
}

.cptva-search-btn {
	padding: 10px 18px;
	border: none;
	border-radius: 6px;
	background: #1a56db;
	color: #fff;
	cursor: pointer;
	font-size: 15px;
}

.cptva-search-btn:hover {
	background: #17469c;
}

.cptva-month-heading {
	margin: 34px 0 16px;
	font-size: 22px;
	font-weight: 700;
	border-bottom: 2px solid #eee;
	padding-bottom: 8px;
}

.cptva-month-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}

/* ---------- Card ---------- */
.cptva-card {
	background: #fff;
	border: 1px solid #eaeaea;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cptva-card:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.cptva-thumb-btn {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.cptva-thumb-img,
.cptva-thumb-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background-color: #d9d9d9;
}

/* Shown until JS grabs a frame from a self-hosted file, or permanently
   for providers we can't fetch a thumbnail from (no featured image set). */
.cptva-thumb-placeholder {
	background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='40' height='40' fill='%23999'%3E%3Cpath d='M17 10.5V7a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-3.5l4 4v-11l-4 4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}

.cptva-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 54px;
	height: 54px;
	line-height: 54px;
	text-align: center;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 20px;
}

.cptva-card-title {
	margin: 14px 16px 6px;
	font-size: 17px;
	line-height: 1.35;
}

.cptva-title-btn {
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	color: #1a1a1a;
	text-align: left;
	cursor: pointer;
}

.cptva-title-btn:hover,
.cptva-title-static {
	color: #1a1a1a;
}

.cptva-title-btn:hover {
	color: #1a56db;
}

.cptva-card-desc {
	margin: 0 16px 18px;
	font-size: 14px;
	color: #555;
	line-height: 1.5;

	/* Show roughly 5 lines, then cut off with an ellipsis. */
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

button.cptva-desc-btn {
	display: -webkit-box; /* override default 'display: block' from the button reset below */
	width: 100%;
	background: none;
	border: none;
	padding: 0;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.cptva-no-results {
	padding: 30px 0;
	color: #777;
}

/* ---------- Pagination ---------- */
.cptva-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 34px 0 10px;
}

.cptva-page-link {
	padding: 8px 13px;
	border: 1px solid #ddd;
	background: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}

.cptva-page-link.is-active {
	background: #1a56db;
	color: #fff;
	border-color: #1a56db;
}

/* ---------- Modal ---------- */
.cptva-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
}

.cptva-modal.is-open {
	display: block;
}

.cptva-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.cptva-modal-box {
	position: relative;
	z-index: 1;
	max-width: 900px;
	width: 92%;
	margin: 4vh auto;
	background: #fff;
	border-radius: 10px;
	padding: 20px;
	max-height: 92vh;
	overflow-y: auto;
}

.cptva-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #333;
}

.cptva-modal-title {
	margin: 0 40px 16px 0;
	font-size: 20px;
}

.cptva-modal-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
}

.cptva-modal-video iframe,
.cptva-modal-video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.cptva-modal-actions {
	margin-top: 16px;
}

.cptva-modal-download {
	display: inline-block;
	padding: 10px 18px;
	background: #1a56db;
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	font-size: 14px;
}

.cptva-modal-download:hover {
	background: #17469c;
}

@media (max-width: 600px) {
	.cptva-month-grid {
		grid-template-columns: 1fr;
	}
}
