/* CMP Publications – frontend card grid */

.cmp-pub-grid {
	display: grid;
	grid-template-columns: repeat(var(--cmp-pub-cols-d, 4), 1fr);
	gap: var(--cmp-pub-gap, 32px);
	max-width: var(--cmp-pub-maxw, 1200px);
	margin-left: auto;
	margin-right: auto;
	font-family: var(--cmp-pub-font, 'Open Sans', sans-serif);
}

@media (max-width: 980px) {
	.cmp-pub-grid {
		grid-template-columns: repeat(var(--cmp-pub-cols-t, 2), 1fr);
	}
}

@media (max-width: 600px) {
	.cmp-pub-grid {
		grid-template-columns: repeat(var(--cmp-pub-cols-m, 1), 1fr);
	}
}

.cmp-pub-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.cmp-pub-card-media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--cmp-pub-radius, 12px);
	aspect-ratio: var(--cmp-pub-ratio, 1 / 1);
	text-decoration: none;
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.cmp-pub-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.cmp-pub-card-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e8eaee 0%, #cfd3da 100%);
}

.cmp-pub-card-overlay {
	position: absolute;
	inset: 0;
	background: var(--cmp-pub-overlay, linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 70%));
	pointer-events: none;
}

.cmp-pub-card-title-onimage {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 20px 22px;
	color: var(--cmp-pub-onimg-color, #ffffff);
	font-size: var(--cmp-pub-onimg-size, 20px);
	font-weight: var(--cmp-pub-onimg-weight, 600);
	text-transform: var(--cmp-pub-onimg-transform, uppercase);
	line-height: 1.25;
}

.cmp-pub-card-title-below {
	margin-top: 16px;
	text-align: center;
	font-size: var(--cmp-pub-below-size, 18px);
	font-weight: var(--cmp-pub-below-weight, 700);
	text-transform: var(--cmp-pub-below-transform, uppercase);
	color: var(--cmp-pub-below-color, #333333);
	line-height: 1.35;
}

.cmp-pub-card-title-below a {
	color: inherit;
	text-decoration: none;
}

.cmp-pub-card-title-below a:hover {
	color: #b8961e; /* CMP gold */
}

.cmp-pub-card-subtitle {
	margin-top: 6px;
	text-align: center;
	font-size: 14px;
	color: #666666;
}

.cmp-pub-card-price {
	margin-top: 6px;
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	color: #b8961e; /* CMP gold */
}

/* Hover effects */
.cmp-pub-hover-zoom .cmp-pub-card-media:hover img {
	transform: scale(1.06);
}

.cmp-pub-hover-lift .cmp-pub-card:hover .cmp-pub-card-media {
	transform: translateY(-5px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

/* Product card style (CMP Kids): contained product shot, no overlay */
.cmp-pub-style-product .cmp-pub-card-media {
	aspect-ratio: var(--cmp-pub-prod-ratio, 1 / 1);
	border-radius: var(--cmp-pub-prod-radius, 8px);
	background: var(--cmp-pub-prod-bg, transparent);
}

.cmp-pub-style-product .cmp-pub-card-media img {
	object-fit: contain;
	padding: var(--cmp-pub-prod-pad, 12px);
	box-sizing: border-box;
}

.cmp-pub-style-product .cmp-pub-card-overlay {
	display: none;
}

.cmp-pub-style-product .cmp-pub-card-title-below {
	font-size: var(--cmp-pub-prod-title-size, 15px);
	font-weight: var(--cmp-pub-prod-title-weight, 600);
	text-transform: var(--cmp-pub-prod-title-transform, none);
	color: var(--cmp-pub-prod-title-color, #333333);
	text-align: var(--cmp-pub-prod-title-align, center);
	margin-top: 12px;
}

.cmp-pub-style-product .cmp-pub-card-subtitle,
.cmp-pub-style-product .cmp-pub-card-price {
	text-align: var(--cmp-pub-prod-title-align, center);
}

.cmp-pub-style-product .cmp-pub-card-title-onimage {
	color: var(--cmp-pub-prod-title-color, #333333);
	text-transform: var(--cmp-pub-prod-title-transform, none);
}

/* Placeholder cards (shown when a shortcode has no content yet) */
.cmp-pub-card--placeholder .cmp-pub-card-placeholder {
	background: linear-gradient(110deg, #e8eaee 8%, #f4f5f7 24%, #e8eaee 40%);
	background-size: 200% 100%;
	animation: cmp-pub-shimmer 2.2s linear infinite;
}

.cmp-pub-card--placeholder .cmp-pub-card-title-onimage {
	color: #9aa0a8;
}

.cmp-pub-card--placeholder .cmp-pub-card-overlay {
	background: none;
}

.cmp-pub-title-placeholder {
	color: #b6bac1;
}

@keyframes cmp-pub-shimmer {
	to {
		background-position: -200% 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cmp-pub-card-media,
	.cmp-pub-card-media img {
		transition: none;
	}

	.cmp-pub-card--placeholder .cmp-pub-card-placeholder {
		animation: none;
	}
}

.cmp-pub-empty {
	font-family: var(--cmp-pub-font, 'Open Sans', sans-serif);
	color: #666666;
}

/* ---- Popup modal ---- */
.cmp-pub-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: var(--cmp-pub-popup-overlay, rgba(0, 0, 0, 0.7));
	font-family: var(--cmp-pub-font, 'Open Sans', sans-serif);
}

.cmp-pub-modal-overlay.is-open {
	display: flex;
}

body.cmp-pub-modal-open {
	overflow: hidden;
}

.cmp-pub-modal {
	position: relative;
	background: #ffffff;
	border-radius: var(--cmp-pub-popup-radius, 12px);
	max-width: var(--cmp-pub-popup-maxw, 900px);
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.cmp-pub-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 50%;
	background: #000080; /* CMP navy */
	color: #ffffff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.cmp-pub-modal-close:hover,
.cmp-pub-modal-close:focus {
	background: #b8961e; /* CMP gold */
}

.cmp-pub-modal-body {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 28px;
	padding: 32px;
}

@media (max-width: 700px) {
	.cmp-pub-modal-body {
		grid-template-columns: 1fr;
		padding: 24px 20px;
	}
}

.cmp-pub-modal-main {
	border-radius: 10px;
	overflow: hidden;
	background: #f4f5f7;
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cmp-pub-modal-main-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.cmp-pub-modal-thumbs-label {
	margin-top: 14px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #000080; /* CMP navy */
}

.cmp-pub-modal-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.cmp-pub-modal-thumb {
	width: 56px;
	height: 56px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	background: #f4f5f7;
}

.cmp-pub-modal-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cmp-pub-modal-thumb.is-active,
.cmp-pub-modal-thumb:hover {
	border-color: #b8961e; /* CMP gold */
}

.cmp-pub-modal-title {
	margin: 0 0 4px;
	font-size: 26px;
	font-weight: 600;
	color: #000080; /* CMP navy */
	line-height: 1.25;
}

.cmp-pub-modal-subtitle {
	margin: 0 0 14px;
	font-size: 16px;
	color: #666666;
}

.cmp-pub-modal-meta {
	list-style: none;
	margin: 0 0 14px;
	padding: 12px 0;
	border-top: 1px solid #ececec;
	border-bottom: 1px solid #ececec;
	font-size: 14px;
	color: #333333;
}

.cmp-pub-modal-meta li {
	margin: 4px 0;
}

.cmp-pub-modal-price {
	font-size: 20px;
	font-weight: 700;
	color: #b8961e; /* CMP gold */
	margin-bottom: 14px;
}

.cmp-pub-modal-desc {
	font-size: 15px;
	line-height: 1.65;
	color: #333333;
}

.cmp-pub-modal-cta {
	display: inline-block;
	margin-top: 18px;
	padding: 12px 26px;
	background: #000080; /* CMP navy */
	color: #ffffff !important;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none !important;
}

.cmp-pub-modal-cta:hover {
	background: #b8961e; /* CMP gold */
}
