/* CoreCave editorial — featured-courses section (Phase 3b minimal v3).
 *
 * Scope: .cc-courses-grid only.
 * Targets EduMall's INNER cards container (.modern-grid) — not the outer
 * .edumall-grid-wrapper, which has only one child and so a grid declaration
 * on it does nothing.
 *
 * DOM:
 *   .cc-courses-grid
 *     ...
 *     .edumall-grid-wrapper.edumall-courses
 *       .modern-grid.grid-sm-1     ← cards live here, override its columns
 *         .grid-item.courses (×8)
 *
 * Does the LEAST possible to fix the user complaints:
 *  - full-width rows → 4 / 3 / 2 / 1 grid at AC boundaries (1400 / 1024 / 768)
 *  - English demo excerpt leak
 *  - section heading typography
 *  - card shell + hover lift
 *  - dark-mode surface shift
 *
 * Everything else (price, CTA, meta, title, footer, thumbnail sizing)
 * is delegated to EduMall's existing card CSS.
 */

.cc-courses-grid h2.elementor-heading-title {
	display: block;
	font-family: var(--cc-font-display);
	font-size: var(--cc-fs-h2);
	font-weight: 800;
	line-height: var(--cc-lh-tight);
	letter-spacing: var(--cc-tracking-tight);
	color: var(--cc-ed-ink);
	text-align: start;
	margin-block: 0 var(--cc-ed-sp-6);
}

/* Grid override — targets the real cards wrapper (.modern-grid). */
.cc-courses-grid .modern-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--cc-ed-sp-5);
	margin: 0;
	padding: 0;
}

/* Card shell — only the border/shadow/radius. Internal layout is EduMall. */
.cc-courses-grid .grid-item.courses {
	background: var(--cc-ed-bg);
	border: 1px solid var(--cc-ed-paper-rule);
	border-radius: var(--cc-ed-radius-card);
	box-shadow: var(--cc-ed-shadow-card);
	overflow: hidden;
	transition:
		box-shadow var(--cc-ed-dur-mid) var(--cc-ed-ease),
		transform var(--cc-ed-dur-mid) var(--cc-ed-ease);
}

.cc-courses-grid .grid-item.courses:hover {
	box-shadow: var(--cc-ed-shadow-card-hover);
	transform: translateY(-2px);
}

/* Excerpt suppression — hides English demo copy on Arabic-only block.
 * 18 demo courses still carry the EduMall import "Negotiation..." string
 * as post_content; suppressing it in-section is safer than a DB rewrite. */
.cc-courses-grid .course-loop-excerpt,
.cc-courses-grid .corecave-course-excerpt {
	display: none;
}

/* Breakpoints — aligned to the AC ladder (≥1400 / 1024–1399 / 768–1023 / <768). */
@media (max-width: 1399px) {
	.cc-courses-grid .modern-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 1023px) {
	.cc-courses-grid .modern-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--cc-ed-sp-4);
	}
}

@media (max-width: 767px) {
	.cc-courses-grid .modern-grid {
		grid-template-columns: 1fr;
	}
	.cc-courses-grid h2.elementor-heading-title {
		margin-block-end: var(--cc-ed-sp-4);
	}
}

/* Dark mode — surface only. */
[data-theme="dark"] .cc-courses-grid .grid-item.courses {
	background: var(--cc-ed-bg-tint);
	border-color: var(--cc-ed-paper-rule-strong);
}
