/*
 * Docs hub: topic cards on the tutorial hub and the topic pages.
 * Loaded by inc/docs-hub.php for page-import-export-video-tutorials.php and page-docs-topic.php.
 * Uses the design tokens and the tutorial-hub__* shell from app.css.
 */

/* ---------- Hub: topic cards ---------- */

.tutorial-hub__grid--start {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.docs-topic-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100%;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 8px;
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.048), rgba(255, 255, 255, 0.014)),
		rgba(28, 27, 27, 0.86);
	box-shadow: 0 26px 80px rgba(0, 0, 0, 0.18);
	transition: transform 0.35s ease, border-color 0.35s ease, background-color 0.35s ease;
}

.docs-topic-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.11), transparent 36%);
	opacity: 0.9;
	pointer-events: none;
}

.docs-topic-card--start::before {
	background: radial-gradient(circle at 20% 0%, rgba(168, 85, 247, 0.16), transparent 38%);
}

.docs-topic-card:hover,
.docs-topic-card:focus-within {
	transform: translateY(-6px);
	border-color: rgba(34, 211, 238, 0.26);
	background-color: rgba(32, 31, 31, 0.96);
}

.docs-topic-card__head,
.docs-topic-card__desc,
.docs-topic-card__list,
.docs-topic-card__foot {
	position: relative;
	z-index: 1;
}

.docs-topic-card__head {
	display: flex;
	gap: 16px;
	align-items: center;
	padding: 28px 28px 14px;
}

.docs-topic-card__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: var(--gradient-btn);
	box-shadow: 0 0 38px rgba(168, 85, 247, 0.24);
	color: #fff;
}

.docs-topic-card__icon .material-symbols-outlined {
	display: block;
	width: 1em;
	height: 1em;
	font-size: 25px;
	line-height: 1;
	text-align: center;
	color: inherit;
}

.docs-topic-card__title {
	margin: 0;
	font-family: 'Geist', sans-serif;
	font-size: clamp(1.22rem, 1.9vw, 1.6rem);
	font-weight: 830;
	letter-spacing: -0.025em;
	line-height: 1.14;
	color: var(--color-on-surface);
}

.docs-topic-card__title a {
	color: inherit;
	text-decoration: none;
}

/* The title link covers the whole card; the preview links sit above it. */
.docs-topic-card__title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
}

.docs-topic-card__count {
	margin-left: auto;
	flex: 0 0 auto;
	padding: 5px 10px;
	border: 1px solid rgba(34, 211, 238, 0.24);
	border-radius: 999px;
	background: rgba(34, 211, 238, 0.07);
	font-family: 'Geist', sans-serif;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #22d3ee;
}

.docs-topic-card__desc {
	margin: 0;
	padding: 0 28px 18px;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	line-height: 1.62;
	color: var(--color-on-surface-variant);
	opacity: 0.86;
}

.docs-topic-card__list {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0 28px 20px;
	list-style: none;
}

.docs-topic-card__list li {
	min-width: 0;
}

.docs-topic-card__list a {
	position: relative;
	z-index: 2;
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 8px;
	background: rgba(14, 14, 14, 0.38);
	font-family: 'Geist', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.38;
	text-decoration: none;
	color: rgba(229, 226, 225, 0.9);
	transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.docs-topic-card__list a:hover {
	transform: translateX(3px);
	border-color: rgba(34, 211, 238, 0.28);
	background: rgba(34, 211, 238, 0.08);
	color: var(--color-on-surface);
}

.docs-topic-card__list .material-symbols-outlined {
	flex: 0 0 auto;
	margin-top: 1px;
	font-size: 18px;
	color: #22d3ee;
}

.docs-topic-card__list span.docs-topic-card__text {
	display: -webkit-box;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.docs-topic-card__foot {
	padding: 0 28px 28px;
}

.docs-topic-card__cta {
	display: inline-flex;
	gap: 8px;
	align-items: center;
	font-family: 'Geist', sans-serif;
	font-size: 12px;
	font-weight: 850;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	text-decoration: none;
	color: #22d3ee;
}

.docs-topic-card__cta .material-symbols-outlined {
	font-size: 18px;
	transition: transform 0.3s ease;
}

.docs-topic-card:hover .docs-topic-card__cta .material-symbols-outlined {
	transform: translateX(4px);
}

.docs-topic-card__empty {
	margin: 0;
	padding: 0 28px 18px;
	font-family: 'Geist', sans-serif;
	font-size: 14px;
	color: var(--color-on-surface-variant);
	opacity: 0.7;
}

/* ---------- Topic page ---------- */

.docs-topic .tutorial-hub__hero {
	padding-bottom: clamp(48px, 6vw, 84px);
}

.docs-topic__title {
	font-size: clamp(2.2rem, 5vw, 4.1rem);
}

.docs-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin-bottom: 26px;
	font-family: 'Geist', sans-serif;
	font-size: 13px;
	font-weight: 700;
	color: var(--color-on-surface-variant);
}

.docs-breadcrumb a {
	display: inline-flex;
	gap: 6px;
	align-items: center;
	text-decoration: none;
	color: #22d3ee;
}

.docs-breadcrumb a:hover {
	color: #fff;
}

.docs-breadcrumb .material-symbols-outlined {
	font-size: 17px;
}

.docs-breadcrumb [aria-current] {
	opacity: 0.8;
}

.docs-stat {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 22px;
	padding: 26px 28px 28px;
}

.docs-stat__main {
	display: flex;
	gap: 22px;
	align-items: center;
}

.docs-stat__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 14px;
	background: var(--gradient-btn);
	box-shadow: 0 0 56px rgba(168, 85, 247, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.28);
	color: #fff;
}

.docs-stat__icon .material-symbols-outlined {
	font-size: 36px;
	line-height: 1;
	color: inherit;
}

.docs-stat__number {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.docs-stat__number strong {
	font-family: 'Geist', sans-serif;
	font-size: clamp(3.6rem, 6.4vw, 5.2rem);
	font-weight: 850;
	letter-spacing: -0.055em;
	line-height: 0.82;
	background: linear-gradient(135deg, #fff 18%, #c4a1ff 58%, #22d3ee 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}

.docs-stat__number > span {
	font-family: 'Geist', sans-serif;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.26em;
	text-transform: uppercase;
	color: var(--color-on-surface-variant);
	opacity: 0.85;
}

.docs-stat__split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.docs-stat__split-item {
	display: grid;
	grid-template-columns: auto 1fr;
	grid-template-areas: 'icon num' 'icon label';
	column-gap: 12px;
	align-items: center;
	padding: 14px 16px;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 8px;
	background: rgba(14, 14, 14, 0.4);
}

.docs-stat__split-item .material-symbols-outlined {
	grid-area: icon;
	font-size: 26px;
	color: #22d3ee;
}

.docs-stat__split-item:last-child .material-symbols-outlined {
	color: #ff6b6b;
}

.docs-stat__split-item strong {
	grid-area: num;
	font-family: 'Geist', sans-serif;
	font-size: 1.5rem;
	font-weight: 850;
	line-height: 1;
	color: var(--color-on-surface);
}

.docs-stat__split-item > span:last-child {
	grid-area: label;
	margin-top: 3px;
	font-family: 'Geist', sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	color: var(--color-on-surface-variant);
	opacity: 0.8;
}

.docs-stat__latest {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 12px;
	align-items: center;
	padding: 14px 16px;
	border: 1px solid rgba(34, 211, 238, 0.18);
	border-radius: 8px;
	background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(168, 85, 247, 0.06));
	text-decoration: none;
	transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.docs-stat__latest:hover {
	transform: translateY(-2px);
	border-color: rgba(34, 211, 238, 0.45);
}

.docs-stat__latest-label {
	grid-column: 1;
	font-family: 'Geist', sans-serif;
	font-size: 10.5px;
	font-weight: 850;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #22d3ee;
}

.docs-stat__latest-title {
	grid-column: 1;
	display: -webkit-box;
	overflow: hidden;
	font-family: 'Geist', sans-serif;
	font-size: 14.5px;
	font-weight: 750;
	line-height: 1.38;
	color: var(--color-on-surface);
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.docs-stat__latest .material-symbols-outlined {
	grid-column: 2;
	grid-row: 1 / span 2;
	font-size: 22px;
	color: #22d3ee;
	transition: transform 0.3s ease;
}

.docs-stat__latest:hover .material-symbols-outlined {
	transform: translateX(4px);
}

.docs-topic__body {
	position: relative;
	z-index: 1;
	padding: 0 0 clamp(60px, 8vw, 110px);
}

.docs-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 28px;
	padding: 14px 16px;
	border: 1px solid rgba(255, 255, 255, 0.07);
	border-radius: 8px;
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.016)), rgba(20, 19, 19, 0.7);
}

.docs-toolbar__field {
	position: relative;
	flex: 1 1 320px;
	max-width: 520px;
}

.docs-toolbar__field .material-symbols-outlined {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	font-size: 21px;
	color: #22d3ee;
	pointer-events: none;
}

.docs-toolbar__input {
	width: 100%;
	min-height: 46px;
	padding: 0 14px 0 44px;
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 8px;
	background: rgba(14, 14, 14, 0.55);
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	color: var(--color-on-surface);
	outline: none;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.docs-toolbar__input::placeholder {
	color: rgba(196, 199, 199, 0.55);
}

.docs-toolbar__input:focus {
	border-color: rgba(34, 211, 238, 0.5);
	box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.docs-toolbar__count {
	font-family: 'Geist', sans-serif;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--color-on-surface-variant);
}

.docs-grid {
	margin-top: 0;
}

@media (max-width: 1040px) {
	.docs-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

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

.docs-grid .blog-card[hidden] {
	display: none;
}

.docs-grid .blog-card__body {
	padding: 26px 28px 28px;
}

.docs-grid .blog-card__title {
	font-size: clamp(1.2rem, 1.6vw, 1.5rem);
}

.docs-grid .blog-card__excerpt {
	display: -webkit-box;
	overflow: hidden;
	margin: 14px 0 24px;
	font-size: 15px;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.docs-empty {
	margin: 40px 0 0;
	padding: 28px;
	border: 1px dashed rgba(255, 255, 255, 0.14);
	border-radius: 8px;
	font-family: 'Geist', sans-serif;
	text-align: center;
	color: var(--color-on-surface-variant);
}

.docs-empty[hidden] {
	display: none;
}

/* ---------- Other topics ---------- */

.docs-others {
	position: relative;
	z-index: 1;
	padding: 0 0 clamp(60px, 8vw, 110px);
}

.docs-others__title {
	margin: 0 0 22px;
	font-family: 'Geist', sans-serif;
	font-size: clamp(1.4rem, 2.4vw, 2rem);
	font-weight: 830;
	letter-spacing: -0.03em;
	color: var(--color-on-surface);
}

.docs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.docs-chip {
	display: inline-flex;
	gap: 10px;
	align-items: center;
	min-height: 48px;
	padding: 0 18px 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)), rgba(255, 255, 255, 0.025);
	font-family: 'Geist', sans-serif;
	font-size: 14px;
	font-weight: 750;
	text-decoration: none;
	color: var(--color-on-surface);
	transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.docs-chip:hover {
	transform: translateY(-2px);
	border-color: rgba(34, 211, 238, 0.34);
	background-color: rgba(34, 211, 238, 0.08);
}

.docs-chip .material-symbols-outlined {
	font-size: 20px;
	color: #22d3ee;
}

.docs-chip small {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.08em;
	color: var(--color-on-surface-variant);
	opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
	.docs-topic-card,
	.docs-chip {
		transition: none;
	}

	.docs-topic-card:hover,
	.docs-chip:hover {
		transform: none;
	}
}

/* ---------- Hub console: counters with 3+ digits ---------- */

.tutorial-hub__console-body .tutorial-hub__metric {
	min-width: 0;
	padding: 22px 22px 20px;
}

.tutorial-hub__console-body .tutorial-hub__metric strong {
	font-size: clamp(2.25rem, 4vw, 3.5rem);
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.05em;
	white-space: nowrap;
}

@media (max-width: 980px) {
	.tutorial-hub__console-body .tutorial-hub__metric strong {
		font-size: clamp(2.6rem, 9vw, 3.6rem);
	}
}


/* ---------- Search form (topic select + submit) ---------- */

.docs-search {
	flex-wrap: wrap;
}

.docs-toolbar__select-wrap {
	position: relative;
	flex: 0 1 220px;
}

.docs-toolbar__select {
	width: 100%;
	min-height: 46px;
	padding: 0 38px 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.09);
	border-radius: 8px;
	background: rgba(14, 14, 14, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2322d3ee' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 14px center;
	font-family: 'Geist', sans-serif;
	font-size: 15px;
	color: var(--color-on-surface);
	outline: none;
	appearance: none;
	cursor: pointer;
}

.docs-toolbar__select:focus {
	border-color: rgba(34, 211, 238, 0.5);
	box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.docs-toolbar__submit {
	min-height: 46px;
	padding: 0 22px;
	border: 0;
	border-radius: 8px;
	background: var(--gradient-btn);
	font-family: 'Geist', sans-serif;
	font-size: 14px;
	font-weight: 800;
	color: #fff;
	cursor: pointer;
}

.docs-toolbar__submit:hover {
	filter: brightness(1.1);
}

@media (max-width: 760px) {
	.docs-toolbar__field,
	.docs-toolbar__select-wrap {
		flex: 1 1 100%;
		max-width: none;
	}
	.docs-toolbar__submit {
		flex: 1 1 100%;
	}
}

/* ---------- Pagination ---------- */

.docs-pagination {
	clear: both;
	margin-top: 48px;
}

.docs-pagination .nav-links,
nav.docs-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.docs-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
	font-family: 'Geist', sans-serif;
	font-size: 13px;
	font-weight: 780;
	text-decoration: none;
	color: var(--color-on-surface-variant);
}

.docs-pagination .page-numbers.current,
.docs-pagination a.page-numbers:hover {
	border-color: rgba(34, 211, 238, 0.36);
	background: rgba(34, 211, 238, 0.1);
	color: var(--color-on-surface);
}

.docs-search-results__hero {
	padding-bottom: 8px;
}
