/* 5thAXIS — Category Sub-Groups */

.axis5th-csg {
	--axis5th-csg-accent:       #c4191f;
	--axis5th-csg-columns:      3;
	--axis5th-csg-gap:          1.25rem;
	--axis5th-csg-card-border:  #e5e5e5;
	--axis5th-csg-title-color:  #18181b;
	--axis5th-csg-tag-bg:       #f4f4f5;
	--axis5th-csg-tag-color:    #4a4a4a;
}

/* ── Grids ─────────────────────────────────────────────────────────── */

.axis5th-csg__grid {
	display: grid;
	grid-template-columns: repeat( var(--axis5th-csg-columns), minmax(0, 1fr) );
	gap: var(--axis5th-csg-gap);
}

/* ── Card ──────────────────────────────────────────────────────────── */

.axis5th-csg-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--axis5th-csg-card-border);
	padding: 16px;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.axis5th-csg-card:hover {
	border-color: var(--axis5th-csg-accent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ── Card image ────────────────────────────────────────────────────── */

.axis5th-csg-card__img-link {
	display: block;
	text-decoration: none;
}

.axis5th-csg-card__image {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f0f0f0;
	overflow: hidden;
}

.axis5th-csg-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.axis5th-csg-card:hover .axis5th-csg-card__image img {
	transform: scale(1.04);
}

/* ── Card body ─────────────────────────────────────────────────────── */

.axis5th-csg-card__body {
	padding-top: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.axis5th-csg-card__title-link {
	text-decoration: none;
	color: inherit;
}

.axis5th-csg-card__title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--axis5th-csg-title-color);
	margin: 0;
	transition: color 0.2s ease;
}

.axis5th-csg-card:hover .axis5th-csg-card__title {
	color: var(--axis5th-csg-accent);
}

/* ── Tags ──────────────────────────────────────────────────────────── */

.axis5th-csg-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.axis5th-csg-tag {
	display: inline-flex;
	align-items: center;
	background: var(--axis5th-csg-tag-bg);
	color: var(--axis5th-csg-tag-color);
	font-size: 0.73rem;
	font-weight: 500;
	padding: 0.3rem 0.65rem;
	border-radius: 3px;
	text-decoration: none;
	white-space: nowrap;
}

.axis5th-csg-tag[hidden] {
	display: none;
}

/* Tag links: subtle hover so they read as clickable. */
a.axis5th-csg-tag {
	transition: background-color 0.15s ease, color 0.15s ease;
}

a.axis5th-csg-tag:hover,
a.axis5th-csg-tag:focus-visible {
	background: var(--axis5th-csg-accent);
	color: #fff;
}

/* "+N more" is a real <button> that expands the hidden tags in place. */
.axis5th-csg-tag--more {
	font-family: inherit;
	line-height: inherit;
	font-weight: 600;
	border: 0;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.axis5th-csg-tag--more:hover,
.axis5th-csg-tag--more:focus-visible {
	background: var(--axis5th-csg-accent);
	color: #fff;
}

/* ── Supporting section ────────────────────────────────────────────── */

.axis5th-csg__supporting {
	margin-top: 3rem;
}

.axis5th-csg__supporting-label {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #6c6c6c;
	margin: 0 0 1.25rem;
}

/* Supporting cards have no body padding offset — image-only layout. */
.axis5th-csg-card--supporting .axis5th-csg-card__body {
	padding-bottom: 1.1rem;
}

.axis5th-csg-card--supporting .axis5th-csg-card__title {
	font-size: 1.1rem;
}

/* ── Empty state ───────────────────────────────────────────────────── */

.axis5th-csg-empty {
	color: #6c6c6c;
	font-size: 0.9rem;
	padding: 2rem 0;
	text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 900px) {
	.axis5th-csg {
		--axis5th-csg-columns: 2;
	}
}

@media (max-width: 560px) {
	.axis5th-csg {
		--axis5th-csg-columns: 1;
	}
}

/* Responsive fix: keep tags and labels readable on phones (were ~11px). */
@media (max-width: 480px) {
	.axis5th-csg-tag,
	.axis5th-csg__supporting-label { font-size: 0.75rem; }
}
