/*
 * WW List Child Categories – Front-end styles
 * Author: Web Wizards Inc
 * Version: 1.0.0
 */

/* ── Wrapper ───────────────────────────────────────────────────────────────── */
.ccd-child-categories {
	margin: 1.5rem 0 2rem;
	width: 100%;
	box-sizing: border-box;
	max-width: 100%;
}

/* ── Grid ──────────────────────────────────────────────────────────────────── */
.ccd-grid {
	display: grid;
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Column variants – JS also reads the CCD.columns value if needed */
.ccd-cols-2 .ccd-grid { grid-template-columns: repeat(2, 1fr); }
.ccd-cols-3 .ccd-grid { grid-template-columns: repeat(3, 1fr); }
.ccd-cols-4 .ccd-grid { grid-template-columns: repeat(4, 1fr); }
.ccd-cols-5 .ccd-grid { grid-template-columns: repeat(5, 1fr); }
.ccd-cols-6 .ccd-grid { grid-template-columns: repeat(6, 1fr); }

/* ── Card / Item ───────────────────────────────────────────────────────────── */
.ccd-item {
	margin: 0;
	padding: 0;
	list-style: none !important;
	list-style-type: none !important;
}

.ccd-item::marker {
	content: none !important;
	display: none !important;
}

.ccd-item::before,
.ccd-item::after {
	content: none !important;
	display: none !important;
}

.ccd-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 1rem 0.75rem;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: box-shadow 0.18s ease, transform 0.18s ease;
	height: 100%;
	gap: 0.5rem;
}

.ccd-link:hover,
.ccd-link:focus-visible {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* ── Thumbnail ─────────────────────────────────────────────────────────────── */
.ccd-image {
	display: block;
	width: 100%;
	max-width: 120px;
	margin: 0 auto;
}

.ccd-image img.ccd-thumb {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
	object-fit: cover;
	aspect-ratio: 1 / 1;
}

.ccd-image .ccd-thumb--placeholder:not(img) {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 4px;
	background: #f0f0f0;
}

/* ── Labels ────────────────────────────────────────────────────────────────── */
.ccd-name {
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.3;
}

.ccd-count {
	font-size: 0.8rem;
	color: #767676;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media ( max-width: 900px ) {
	.ccd-cols-5 .ccd-grid,
	.ccd-cols-6 .ccd-grid { grid-template-columns: repeat(4, 1fr); }
}

@media ( max-width: 680px ) {
	.ccd-cols-4 .ccd-grid,
	.ccd-cols-5 .ccd-grid,
	.ccd-cols-6 .ccd-grid { grid-template-columns: repeat(3, 1fr); }
}

@media ( max-width: 480px ) {
	.ccd-cols-3 .ccd-grid,
	.ccd-cols-4 .ccd-grid,
	.ccd-cols-5 .ccd-grid,
	.ccd-cols-6 .ccd-grid { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 340px ) {
	.ccd-grid { grid-template-columns: 1fr !important; }
}

/* ── JS-driven reveal animation (added by ccd-scripts.js) ─────────────────── */
.ccd-will-animate {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.ccd-visible {
	opacity: 1;
	transform: translateY(0);
}
