/**
 * Category Tiles Styles
 *
 * @package SiteWidgets
 */

.cattiles {
	--cattiles-cols: 3;
	--cattiles-cols-tablet: 2;
	--cattiles-cols-mobile: 1;
	display: grid;
	grid-template-columns: repeat(var(--cattiles-cols), minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
}

.cattile {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	padding: 20px;
	border: 1px solid #d8e2ef;
	border-radius: 20px;
	background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
	box-shadow: 0 16px 32px rgba(18, 31, 53, 0.05);
	transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cattile:hover {
	border-color: #bfd1ee;
	box-shadow: 0 18px 34px rgba(18, 31, 53, 0.08);
	transform: translateY(-1px);
}

.cattile-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e8eef6;
}

.cattile-ico {
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	background: #fff;
}

.cattile-ico img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: grayscale(1) contrast(1.05);
	opacity: 0.7;
}

.cattile-title {
	color: #154ca3;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
	text-decoration: none;
	word-break: break-word;
}

a.cattile-title:hover {
	color: #0f58cb;
	text-decoration: none;
}

.cattile-title--current {
	color: #1b2437;
}

.cattile-body {
	color: #44536a;
	font-size: 14px;
	line-height: 1.8;
	word-break: break-word;
}

a.cattile-child {
	color: #1d5fd1;
	font-size: 14px;
	font-weight: 500;
	line-height: inherit;
	text-decoration: none;
}

a.cattile-child:hover {
	color: #0f58cb;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cattile-sep {
	color: #a9b8cc;
	font-size: 12px;
	user-select: none;
}

a.cattile-child--d1 {
	font-weight: 600;
}

a.cattile-child--d2,
a.cattile-child--d3,
a.cattile-child--d4 {
	color: #4479cf;
	font-size: 13px;
}

.cattiles--deep .cattile-body br {
	display: block;
	content: '';
	margin-top: 6px;
}

span.cattile-child--current {
	color: #1b2437;
	font-weight: 700;
	cursor: default;
}

.cattile-expand {
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	color: #6a7d9c;
	font-size: 12px;
	font-weight: 700;
	font-family: inherit;
	line-height: inherit;
	cursor: pointer;
	white-space: nowrap;
}

.cattile-expand:hover {
	color: #1d5fd1;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.cattiles-ajax-wrap {
	display: block;
}

.cattiles-ajax-content:empty {
	display: none;
}

.cattiles-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 24px;
	border: none;
	border-radius: 12px;
	background: #1b2437;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	cursor: pointer;
	box-shadow: 0 14px 28px rgba(27, 36, 55, 0.18);
	transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.cattiles-btn:hover {
	background: #24314a;
	box-shadow: 0 18px 30px rgba(27, 36, 55, 0.22);
	transform: translateY(-1px);
}

.cattiles-btn:active {
	background: #111827;
	box-shadow: none;
	transform: none;
}

.cattiles-btn:disabled {
	opacity: 0.6;
	cursor: default;
	box-shadow: none;
}

.cattiles-btn.is-loading::after {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: cattiles-spin 0.55s linear infinite;
}

@keyframes cattiles-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 991.98px) {
	.cattiles {
		grid-template-columns: repeat(var(--cattiles-cols-tablet), minmax(0, 1fr));
	}
}

@media (max-width: 575.98px) {
	.cattiles {
		grid-template-columns: repeat(var(--cattiles-cols-mobile), minmax(0, 1fr));
		gap: 12px;
	}

	.cattile {
		padding: 16px;
		border-radius: 18px;
	}

	.cattile-title {
		font-size: 17px;
	}

	.cattile-body,
	a.cattile-child {
		font-size: 13px;
		line-height: 1.75;
	}
}

/* Farpost-like simplification */
.cattiles {
	gap: 10px;
}

.cattile {
	padding: 14px;
	border-radius: 10px;
	background: #fff;
	box-shadow: none;
}

.cattile:hover {
	box-shadow: none;
	transform: none;
}

.cattile-head {
	margin-bottom: 10px;
	padding-bottom: 10px;
}

.cattile-ico {
	width: 32px;
	height: 32px;
	flex-basis: 32px;
	border-radius: 10px;
}

.cattile-title {
	font-size: 15px;
	font-weight: 800;
}

.cattile-body,
a.cattile-child {
	font-size: 13px;
	line-height: 1.7;
}

.cattile-expand {
	font-size: 11px;
}
