/*!
 * Cakery Categories - statisch stylesheet, geen JavaScript.
 * Alle instelbare waarden komen als custom properties binnen op .ccats.
 * De plugin laadt bewust geen fonts: Myorie en Jost staan al in Elementor.
 */

.ccats {
	--ccats-gold: #A9A083;
	--ccats-gold-light: #C9BE9E;
	--ccats-ink-soft: #7C7263;
	--ccats-cut: 14px;
	--ccats-cut-badge: 5px;
	--ccats-cut-frame: 10px;
	--ccats-ratio: 5 / 4;
	--ccats-zoom: 1.06;
	--ccats-gap: 14px;
	--ccats-cols: 2;
	--ccats-offset: 0px;
	--ccats-pad-y: 34px;
	--ccats-pad-x: 36px;
	--ccats-ov-top: rgba(30, 23, 15, .30);
	--ccats-ov-mid: rgba(30, 23, 15, .52);
	--ccats-ov-bottom: rgba(24, 18, 12, .86);
	--ccats-ov-opacity: 1;
	--ccats-ov-hover: .82;
	--ccats-frame-color: rgba(201, 190, 158, .5);
	--ccats-frame-inset: 16px;
	--ccats-frame-w: 1px;
	/* Verticale rustmaat: de instelling van de site wint, met de
	   ontwerpwaarde van deze sectie als terugval. */
	padding-top: var(--cakery-space-top, 0px);
	padding-bottom: var(--cakery-space-bottom, 0px);
}

.ccats-oct {
	clip-path: polygon(
		var(--c) 0,
		calc(100% - var(--c)) 0,
		100% var(--c),
		100% calc(100% - var(--c)),
		calc(100% - var(--c)) 100%,
		var(--c) 100%,
		0 calc(100% - var(--c)),
		0 var(--c)
	);
}

/* ---------- Kop ---------- */

.ccats__head {
	max-width: 560px;
	margin: 0 auto 54px;
	text-align: center;
}

.ccats__eyebrow {
	margin: 0 0 14px;
	color: var(--ccats-gold);
	font-size: 11px;
	letter-spacing: .3em;
	text-transform: uppercase;
}

.ccats__title {
	margin: 0;
	font-family: "Myorie", Georgia, serif;
	font-size: clamp(32px, 4.4vw, 50px);
	font-weight: 400;
	line-height: 1.15;
}

.ccats__sub {
	margin: 14px 0 0;
	color: var(--ccats-ink-soft);
	font-size: 16px;
	font-weight: 300;
	line-height: 1.65;
}

/* ---------- Raster ---------- */

.ccats__grid {
	display: grid;
	grid-template-columns: repeat(var(--ccats-cols), minmax(0, 1fr));
	gap: var(--ccats-gap);
}

/* Optionele verspringing: elke even tegel zakt een stukje. Standaard 0, dan
   staan de tegels netjes uitgelijnd in een blok. */
.ccats--stagger .ccats__tile:nth-child(even) {
	transform: translateY(var(--ccats-offset));
}

/* ---------- De tegel ---------- */

/* Eén <a> om de hele inhoud: één tabstop per tegel, geen geneste links. */
.ccats__tile {
	--c: var(--ccats-cut);
	position: relative;
	display: block;
	aspect-ratio: var(--ccats-ratio);
	overflow: hidden;
	color: #F7F1E6;
	text-decoration: none;
	isolation: isolate;
}

.ccats__tile img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.1s cubic-bezier(.2, .7, .3, 1);
}

.ccats__tile:hover img,
.ccats__tile:focus-visible img {
	transform: scale(var(--ccats-zoom));
}

/* De overlay trekt bij hover juist terug, zodat de tegel oplicht in plaats van
   donkerder wordt. Bewust andersom dan gebruikelijk. */
.ccats__tile::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		180deg,
		var(--ccats-ov-top) 0%,
		var(--ccats-ov-mid) 48%,
		var(--ccats-ov-bottom) 100%
	);
	opacity: var(--ccats-ov-opacity);
	transition: opacity .6s ease;
}

.ccats__tile:hover::before,
.ccats__tile:focus-visible::before {
	opacity: var(--ccats-ov-hover);
}

/* Gouden haarlijn die bij hover intekent; verwijst naar het frame om het logo. */
.ccats__frame {
	--c: var(--ccats-cut-frame);
	position: absolute;
	inset: var(--ccats-frame-inset);
	border: var(--ccats-frame-w) solid var(--ccats-frame-color);
	opacity: 0;
	transform: scale(1.012);
	pointer-events: none;
	transition: opacity .5s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
}

.ccats__tile:hover .ccats__frame,
.ccats__tile:focus-visible .ccats__frame {
	opacity: 1;
	transform: none;
}

.ccats__tile:focus-visible {
	outline: 1px solid var(--ccats-gold-light);
	outline-offset: 4px;
}

.ccats__body {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100%;
	padding: var(--ccats-pad-y) var(--ccats-pad-x);
}

.ccats__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.ccats__num {
	--c: var(--ccats-cut-badge);
	padding: 7px 11px;
	border: 1px solid rgba(201, 190, 158, .4);
	color: var(--ccats-gold-light);
	font-size: 11px;
	letter-spacing: .2em;
}

.ccats__count {
	color: rgba(247, 241, 230, .62);
	font-size: 11px;
	letter-spacing: .22em;
	text-transform: uppercase;
}

.ccats__name {
	margin: 0;
	font-family: "Myorie", Georgia, serif;
	font-size: clamp(26px, 2.6vw, 36px);
	font-weight: 400;
	line-height: 1.15;
}

.ccats__desc {
	display: block;
	max-width: 34ch;
	margin-top: 10px;
	color: rgba(247, 241, 230, .75);
	font-size: 14px;
	font-weight: 300;
	line-height: 1.6;
}

.ccats__cta {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-top: 20px;
	padding-bottom: 7px;
	border-bottom: 1px solid rgba(201, 190, 158, .45);
	color: #FFF6E4;
	font-size: 11px;
	letter-spacing: .2em;
	text-transform: uppercase;
	transition: border-color .4s ease, color .4s ease;
}

.ccats__cta svg {
	width: 15px;
	height: 15px;
	transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.ccats__tile:hover .ccats__cta,
.ccats__tile:focus-visible .ccats__cta {
	border-color: var(--ccats-gold-light);
	color: #FFFFFF;
}

.ccats__tile:hover .ccats__cta svg,
.ccats__tile:focus-visible .ccats__cta svg {
	transform: translateX(5px);
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
	.ccats__grid {
		grid-template-columns: 1fr;
	}

	.ccats__tile {
		aspect-ratio: 4 / 3;
	}

	.ccats--stagger .ccats__tile:nth-child(even) {
		transform: none;
	}

	.ccats__body {
		padding: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ccats__tile img,
	.ccats__frame,
	.ccats__cta,
	.ccats__cta svg,
	.ccats__tile::before {
		transition: none;
	}

	.ccats__tile:hover img,
	.ccats__tile:focus-visible img {
		transform: none;
	}

	.ccats__tile:hover .ccats__cta svg,
	.ccats__tile:focus-visible .ccats__cta svg {
		transform: none;
	}

	.ccats__frame {
		transform: none;
	}
}
