/**
 * Signal Pack Global Components — Category Card System
 * Uses existing brand CSS variables with safe fallbacks (same pattern
 * as the other components in this plugin). Depends on buttons.css
 * being loaded too (cards use .spgc-btn-* classes for their CTA).
 */

.spgc-category-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 26px;
}
@media (max-width: 700px) { .spgc-category-grid { grid-template-columns: 1fr; } }

.spgc-category-grid--compact {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 20px;
}
@media (max-width: 1080px) { .spgc-category-grid--compact { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .spgc-category-grid--compact { grid-template-columns: 1fr 1fr; } }

/* ---------- Standard card ---------- */
.spgc-ccard {
	position: relative;
	background: var(--paper, #ffffff);
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--line, rgba(23, 22, 46, 0.10));
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.spgc-ccard:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(23, 22, 46, 0.10); }

/* Whole-card click target: an invisible link stretched over the entire
   card. Sits above the visible CTA button (which is aria-hidden and
   only there as a visual affordance) so clicking anywhere — image,
   text, or button — goes to the same category page. */
.spgc-ccard-stretched-link,
.spgc-ccard--overlay .spgc-ccard-stretched-link {
	position: absolute;
	inset: 0;
	z-index: 1;
}
.spgc-ccard-stretched-link:focus-visible {
	outline: 2px solid var(--navy, #2C2A78);
	outline-offset: -2px;
}

.spgc-ccard .spgc-cimg { height: 210px; background: var(--grey-alt, #eef0f5); overflow: hidden; }
.spgc-ccard .spgc-cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }

.spgc-ccard .spgc-cbody { padding: 24px; }
.spgc-ccard h3 { font-size: 19px; margin: 0 0 8px; }
.spgc-ccard .spgc-ccount { font-size: 12px; color: var(--grey-text, #55536b); margin: 0 0 10px; }
.spgc-ccard p { font-size: 13.5px; color: var(--grey-text, #55536b); line-height: 1.55; margin: 0 0 18px; }
.spgc-ccard .spgc-cactions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Large homepage card ---------- */
.spgc-ccard--large .spgc-cimg { height: 320px; }
.spgc-ccard--large h3 { font-size: 24px; }

/* ---------- Compact mobile card ---------- */
.spgc-ccard--compact .spgc-cimg { height: 130px; }
.spgc-ccard--compact .spgc-cbody { padding: 16px; }
.spgc-ccard--compact h3 { font-size: 13.5px; margin-bottom: 6px; line-height: 1.3; }
.spgc-ccard--compact p { font-size: 11.5px; margin-bottom: 12px; min-height: 32px; }
.spgc-ccard--compact .spgc-cactions .spgc-btn { width: 100%; justify-content: center; }

/* ---------- Image-overlay card ---------- */
.spgc-ccard--overlay { position: relative; border-radius: 12px; overflow: hidden; height: 260px; }
.spgc-ccard--overlay img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spgc-ccard--overlay::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(180deg, rgba(23, 22, 46, 0) 40%, rgba(23, 22, 46, 0.78) 100%);
}
.spgc-overlay-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px; z-index: 1; }
.spgc-ccard--overlay h3 { color: #fff; margin: 0 0 6px; }
.spgc-ccard--overlay p { color: rgba(255, 255, 255, 0.85); margin: 0 0 12px; }

/* ---------- Horizontal promotional card ---------- */
.spgc-ccard--horizontal { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.spgc-ccard--horizontal .spgc-cimg { height: auto; }
.spgc-ccard--horizontal .spgc-cbody { display: flex; flex-direction: column; justify-content: center; padding: 32px; }
@media (max-width: 700px) {
	.spgc-ccard--horizontal { grid-template-columns: 1fr; }
	.spgc-ccard--horizontal .spgc-cimg { height: 180px; }
}
