/**
 * Guides hub — /rukovodstva/ niche preview cards.
 * Wide shell (1100px) like /opyt/, /proekty/, longreads.
 */

/* --- Page shell: wide content (default --content-max is 460px) --- */
.page-shell--guides-hub .content,
.page-shell--guides-hub .content.content--wide {
	max-width: 1100px;
	width: 100%;
}

.page-shell--guides-hub .page-title {
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.guides-hub-intro-wrap {
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.guides-hub-intro {
	margin: 0;
	max-width: 52rem;
	font-size: 1.0625rem;
	line-height: 1.65;
	color: #aaaaaa;
}

.guides-hub {
	margin-top: 0;
}

.guides-hub-search-wrap {
	margin: 0 0 1.25rem;
	max-width: 28rem;
}

.guides-hub-search__input {
	width: 100%;
	padding: 12px 16px;
	font: inherit;
	font-size: 0.9375rem;
	color: var(--color-text, #ffffff);
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 12px;
	outline: none;
	transition: border-color 0.2s ease, background 0.2s ease;
	box-sizing: border-box;
}

.guides-hub-search__input::placeholder {
	color: #888888;
}

.guides-hub-search__input:hover {
	border-color: rgba(255, 255, 255, 0.22);
}

.guides-hub-search__input:focus-visible {
	border-color: var(--color-link, #66b2ff);
	background: rgba(255, 255, 255, 0.06);
}

.guides-hub-search-empty {
	margin: 0 0 1.5rem;
	font-size: 0.875rem;
	color: #888888;
}

.guides-hub-search-empty[hidden] {
	display: none;
}

.guides-hub-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
	margin: 0 0 clamp(2rem, 4vw, 2.75rem);
	padding: 0;
	list-style: none;
}

.guides-hub-stats__item {
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: #888888;
}

.guides-hub-stats__item strong {
	color: #ffffff;
	font-weight: 600;
}

.guides-hub-section {
	margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.guides-hub-section[hidden],
.guide-card[hidden] {
	display: none;
}

.guides-hub-section__title {
	margin: 0 0 1.25rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #888888;
}

/* Single column list — full width cards within 1100px shell */
.guides-hub-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
}

.guide-card {
	position: relative;
}

.guide-card__link {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 0;
	border-radius: 16px;
	border: 1px solid rgba(255, 255, 255, 0.06);
	background: rgba(10, 10, 10, 0.55);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	text-decoration: none !important;
	overflow: hidden;
	transition: border-color 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
	box-sizing: border-box;
}

.guide-card__link--disabled {
	cursor: default;
}

.guide-card--soon .guide-card__body {
	opacity: 0.88;
}

.guide-card--soon .guide-card__visual {
	opacity: 1;
}

.guide-card:not(.guide-card--soon) .guide-card__link:hover {
	border-color: color-mix(in srgb, var(--guide-accent) 40%, transparent);
	box-shadow: 0 0 48px color-mix(in srgb, var(--guide-accent) 12%, transparent);
	transform: translateY(-2px);
}

.guide-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	padding: 1.35rem 1.35rem 1.5rem;
}

.guide-card__visual {
	position: relative;
	flex-shrink: 0;
	height: auto;
	aspect-ratio: 16 / 9;
	max-height: 200px;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.2) 100%);
	overflow: hidden;
}

.guide-card__visual--has-image {
	background: #c8c8c8;
}

.guide-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-card:not(.guide-card--soon) .guide-card__link:hover .guide-card__img {
	transform: scale(1.02);
}

.guide-card__visual--has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(270deg, rgba(0, 0, 0, 0.04) 0%, transparent 35%);
	pointer-events: none;
}

@media (min-width: 640px) {
	.guide-card__visual--has-image::after {
		background: linear-gradient(270deg, rgba(0, 0, 0, 0.06) 0%, transparent 25%);
	}
}

.guide-card__glow {
	position: absolute;
	top: -30px;
	right: -20px;
	width: 140px;
	height: 140px;
	border-radius: 50%;
	background: var(--guide-accent);
	opacity: 0;
	filter: blur(48px);
	transition: opacity 0.5s ease;
	pointer-events: none;
}

.guide-card:not(.guide-card--soon) .guide-card__link:hover .guide-card__glow {
	opacity: 0.22;
}

.guide-card__icon-wrap {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.guide-card__svg {
	width: 56px;
	height: 56px;
	color: var(--guide-accent);
	transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.guide-card:not(.guide-card--soon) .guide-card__link:hover .guide-card__svg {
	transform: scale(1.08);
}

.guide-card:not(.guide-card--soon) .guide-card__link:hover .guide-icon-pulse {
	animation: guide-pulse 1.2s ease infinite;
}

@keyframes guide-pulse {
	0%, 100% { opacity: 0.35; transform: scale(1); }
	50% { opacity: 0.7; transform: scale(1.06); }
}

.guide-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 0.65rem;
}

.guide-card__badge {
	display: inline-flex;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--guide-accent);
	background: color-mix(in srgb, var(--guide-accent) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--guide-accent) 28%, transparent);
}

.guide-card--soon .guide-card__badge {
	color: #888888;
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.08);
}

.guide-card__title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.125rem, 2vw, 1.375rem);
	font-weight: 500;
	line-height: 1.3;
	color: #ffffff;
	letter-spacing: -0.01em;
}

.guide-card__excerpt {
	margin: 0;
	flex: 1;
	font-size: 0.9375rem;
	line-height: 1.55;
	color: #aaaaaa;
	max-width: 52rem;
}

.guide-card__action {
	margin-top: 1rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--guide-accent);
}

.guides-hub-empty {
	color: #888888;
}

/* Tablet+: horizontal cards, body left / visual right */
@media (min-width: 640px) {
	.guide-card__link {
		flex-direction: row;
		align-items: stretch;
		min-height: 168px;
	}

	.guide-card__body {
		padding: 1.5rem 1.75rem;
	}

	.guide-card__visual {
		width: min(42%, 320px);
		height: auto;
		min-height: 168px;
		max-height: none;
		aspect-ratio: 16 / 9;
		border-top: none;
		border-left: 1px solid rgba(255, 255, 255, 0.05);
	}

	.guide-card__svg {
		width: 64px;
		height: 64px;
	}
}

@media (max-width: 767px) {
	.page-shell--guides-hub .content,
	.page-shell--guides-hub .content.content--wide {
		padding-left: 20px;
		padding-right: 20px;
		max-width: none;
		box-sizing: border-box;
	}

	.guide-card__visual {
		max-height: 180px;
		aspect-ratio: 16 / 9;
		height: auto;
	}

	.guide-card__body {
		padding: 1.15rem 1.2rem 1.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.guide-card__link,
	.guide-card__svg,
	.guide-card__glow,
	.guide-card__img {
		transition: none;
	}

	.guide-card:not(.guide-card--soon) .guide-card__link:hover {
		transform: none;
	}

	.guide-card:not(.guide-card--soon) .guide-card__link:hover .guide-icon-pulse {
		animation: none;
	}
}
