/*
 * Top-level 'topic' tag cards shown in the torii/workshops grid when no
 * filters are active (see torii_render_workshop_topic_cards() in
 * inc/workshops.php) — a bigger, simpler sibling of .sec-card (the
 * individual workshop card, styled in workshop-listing.css) rendered inside
 * the same .torii-workshop-listing grid.
 */

/* Force 2 columns (2 rows of 2) for the topic-card view specifically,
   overriding the shared 3-column .torii-workshop-listing grid from
   filter-controls.css — this file loads after it, per the alphabetical
   glob() order in functions.php. The shared 781px/599px breakpoints
   already collapse to 2 and 1 columns respectively, so no further
   overrides are needed at smaller widths. */
.torii-workshop-listing--topics {
	grid-template-columns: repeat(2, 1fr);
}

.topic-card {
	position: relative;
	isolation: isolate;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	min-height: 288px;
	padding: 24px;
	border: none;
	border-radius: 24px 24px 0 24px;
	background-color: transparent;
	text-align: left;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.topic-card::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--white);
	border-radius: 24px 24px 0 24px;
	-webkit-mask-image:
		linear-gradient(#000, #000),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M41 11H60V60H11V41A30 30 0 0 1 41 11Z' fill='%23fff'/%3E%3Cpath d='M 0 0 L 11 0 A 11 11 0 0 0 0 11 Z' fill='%23fff' transform='translate(0,49) rotate(180 5.5 5.5)'/%3E%3Cpath d='M 0 0 L 11 0 A 11 11 0 0 0 0 11 Z' fill='%23fff' transform='translate(49,0) rotate(180 5.5 5.5)'/%3E%3C/svg%3E");
	-webkit-mask-repeat: no-repeat, no-repeat;
	-webkit-mask-size:
		100% 100%,
		60px 60px;
	-webkit-mask-position:
		0 0,
		100% 100%;
	-webkit-mask-composite: destination-out;
	mask-image:
		linear-gradient(#000, #000),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M41 11H60V60H11V41A30 30 0 0 1 41 11Z' fill='%23fff'/%3E%3Cpath d='M 0 0 L 11 0 A 11 11 0 0 0 0 11 Z' fill='%23fff' transform='translate(0,49) rotate(180 5.5 5.5)'/%3E%3Cpath d='M 0 0 L 11 0 A 11 11 0 0 0 0 11 Z' fill='%23fff' transform='translate(49,0) rotate(180 5.5 5.5)'/%3E%3C/svg%3E");
	mask-repeat: no-repeat, no-repeat;
	mask-size:
		100% 100%,
		60px 60px;
	mask-position:
		0 0,
		100% 100%;
	mask-composite: subtract;
	transition: background-color 0.2s ease;
}

.topic-card:hover,
.topic-card:focus-visible {
	transform: translateY(-4px);
}

.topic-card:hover::before,
.topic-card:focus-visible::before {
	background: var(--wp--preset--color--brand-primary);
}

/* Background colour per topic, matching the 'filter-colour' term meta also
   used for the product-tag filter pills (filter-controls.css) and the
   sec-card topic tags (workshop-listing.css). */

.topic-card--purple::before {
	background: var(--wp--preset--color--brand-primary);
}

.topic-card--green::before {
	background: var(--wp--preset--color--brand-secondary);
}

.topic-card--orange::before {
	background: var(--wp--preset--color--brand-accent);
}

.topic-card--off-black::before {
	background: var(--wp--preset--color--neutral-900);
}

.topic-card__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.topic-card__heading {
	display: flex;
	align-items: center;
	gap: 12px;
}

.topic-card__icon {
	width: 32px;
	height: 32px;
	flex-shrink: 0;
}

.topic-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.875rem;
	font-weight: 700;
	line-height: 32px;
	color: var(--wp--preset--color--neutral-900);
	margin: 0;
}

.topic-card__description {
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 400;
	line-height: 24px;
	color: var(--wp--preset--color--neutral-900);
	margin: 0;
}

.topic-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-right: 40px;
}

.topic-card__count {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--wp--preset--color--neutral-grey);
}

.topic-card--off-black .topic-card__title,
.topic-card--off-black .topic-card__description,
.topic-card--off-black .topic-card__count {
	color: var(--wp--preset--color--white);
}

.topic-card__arrow {
	position: absolute;
	right: 0;
	bottom: 0;
	flex-shrink: 0;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--brand-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='23' fill='none' viewBox='0 0 26 23'%3E%3Cpath stroke='%232a2637' stroke-linecap='round' stroke-width='2' d='M1 11.032h21.96'/%3E%3Cpath stroke='%232a2637' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m14.062 1 10.095 10.032-10.033 10.095'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
}

/* "Not sure what you need help with?" CTA card — always the last item in
   the top-level grid, linking to the site's Book a Call CTA link. */

.topic-card--cta::before {
	background: var(--wp--preset--color--brand-primary);
}

.topic-card--cta:hover::before,
.topic-card--cta:focus-visible::before {
	background: var(--wp--preset--color--brand-primary);
}
