/* Ketabbin 1.2 — manageable hero slider, richer controls and demo polish. */

.kb-hero-slider {
	position: relative;
	height: clamp(500px, 57vw, 570px);
	max-height: 570px;
	min-height: 500px;
	overflow: hidden;
	border: 1px solid var(--line);
	background: #020d18;
	isolation: isolate;
}

.kb-hero-slider__track,
.kb-hero-slide {
	position: absolute;
	inset: 0;
}

.kb-hero-slide {
	direction: rtl;
	display: flex;
	align-items: stretch;
	background-color: #020d18;
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
	opacity: 0;
	visibility: hidden;
	transform: scale(1.025);
	pointer-events: none;
	transition: opacity .75s ease, transform 1.1s ease, visibility 0s linear .8s;
}

.kb-hero-slide.is-active {
	opacity: 1;
	visibility: visible;
	transform: scale(1);
	pointer-events: auto;
	transition-delay: 0s;
}

.kb-hero-slide__shade {
	position: absolute;
	inset: 0;
	z-index: 1;
	background:
		linear-gradient(90deg, rgba(2, 13, 24, .06) 0, rgba(2, 13, 24, .02) 48%, rgba(2, 13, 24, .78) 72%, rgba(2, 13, 24, .96) 100%),
		linear-gradient(0deg, rgba(2, 13, 24, .4), transparent 44%);
}

.kb-hero-slide__copy {
	position: relative;
	z-index: 2;
	width: min(43%, 580px);
	margin-right: auto;
	padding: 68px 62px 78px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	color: #f2eadb;
}

.kb-hero-slide__copy :is(h1, h2) {
	max-width: 510px;
	margin: 20px 0 15px;
	font-size: clamp(48px, 4.4vw, 72px);
	line-height: 1.32;
	letter-spacing: -3px;
}

.kb-hero-slide__copy p {
	max-width: 420px;
	margin: 0;
	color: rgba(242, 234, 219, .72);
	font-size: 13px;
	line-height: 2;
}

.kb-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
	position: relative;
	overflow: hidden;
	border-radius: 10px !important;
	background: linear-gradient(135deg, var(--amber-soft), var(--amber) 64%, #d98a00) !important;
	box-shadow: 0 12px 30px rgba(242, 169, 0, .16), inset 0 1px rgba(255, 255, 255, .38);
	transform: translateZ(0);
}

.kb-button::after,
.woocommerce a.button::after,
.woocommerce button.button::after {
	content: "";
	position: absolute;
	top: -70%;
	bottom: -70%;
	left: -45%;
	width: 28%;
	background: rgba(255, 255, 255, .28);
	transform: rotate(18deg) translateX(-260%);
	transition: transform .55s ease;
}

.kb-button:hover::after,
.woocommerce a.button:hover::after,
.woocommerce button.button:hover::after {
	transform: rotate(18deg) translateX(600%);
}

.kb-button:hover,
.kb-button:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 18px 38px rgba(242, 169, 0, .25), inset 0 1px rgba(255, 255, 255, .4);
}

.kb-button--hero {
	min-width: 190px;
	margin-top: 25px;
	min-height: 52px;
}

.kb-button--outline {
	background: transparent !important;
	color: var(--text) !important;
	box-shadow: inset 0 0 0 1px var(--amber), 0 10px 24px rgba(7, 27, 44, .08);
}

.kb-hero-slider__controls {
	position: absolute;
	z-index: 5;
	left: 26px;
	bottom: 24px;
	display: flex;
	direction: ltr;
	gap: 8px;
}

.kb-hero-slider__controls button {
	width: 48px;
	height: 48px;
	border: 1px solid rgba(242, 169, 0, .5);
	border-radius: 50%;
	background: rgba(2, 13, 24, .68);
	backdrop-filter: blur(12px);
	color: #f2eadb;
	font-size: 21px;
	transition: .25s ease;
}

.kb-hero-slider__controls button:hover {
	background: var(--amber);
	color: var(--ink);
	transform: scale(1.08);
}

.kb-hero-slider__dots {
	position: absolute;
	z-index: 5;
	right: 62px;
	bottom: 31px;
	display: flex;
	direction: ltr;
	gap: 8px;
}

.kb-hero-slider__dots button {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 1px solid rgba(242, 234, 219, .72);
	border-radius: 50%;
	background: transparent;
	transition: .3s ease;
}

.kb-hero-slider__dots button.is-active {
	width: 30px;
	border-radius: 8px;
	border-color: var(--amber);
	background: var(--amber);
}

.kb-hero-slider__count {
	position: absolute;
	z-index: 5;
	left: 30px;
	top: 28px;
	direction: ltr;
	color: rgba(242, 234, 219, .58);
	font: 700 10px/1.2 Arial, sans-serif;
	letter-spacing: 2px;
}

.kb-hero-slider__count b {
	color: var(--amber);
	font-size: 14px;
}

.kb-text-link,
.kb-section-head > a,
.kb-chat__conversation > header > a,
.kb-my-library > header > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 6px 15px;
	border: 1px solid color-mix(in srgb, var(--amber) 65%, var(--line));
	border-radius: 9px;
	background: color-mix(in srgb, var(--amber) 8%, transparent);
	color: var(--amber);
	font-size: 11px;
	font-weight: 800;
	transition: .22s ease;
}

.kb-text-link:hover,
.kb-section-head > a:hover,
.kb-chat__conversation > header > a:hover,
.kb-my-library > header > a:hover {
	background: var(--amber);
	color: var(--ink);
	transform: translateY(-2px);
	box-shadow: 0 10px 25px rgba(242, 169, 0, .18);
}

.kb-incoming article > button,
.kb-purpose-tabs button,
.kb-chat__rooms button,
.kb-reader-controls button,
.kb-reader__body nav button {
	border-radius: 8px;
	transition: background .2s, color .2s, border-color .2s, transform .2s;
}

.kb-incoming article > button:hover,
.kb-purpose-tabs button:hover,
.kb-chat__rooms button:hover {
	border-color: var(--amber);
	color: var(--amber);
	transform: translateY(-1px);
}

.kb-empty-panel,
.kb-empty-inline {
	position: relative;
	overflow: hidden;
	border: 1px dashed var(--line-strong);
	border-radius: 12px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, var(--amber) 12%), var(--surface));
	padding: 28px;
}

.kb-empty-panel::after,
.kb-empty-inline::after {
	content: "KETABBIN";
	position: absolute;
	left: 12px;
	bottom: -10px;
	color: var(--line);
	font: 800 42px/1 Arial, sans-serif;
	letter-spacing: 4px;
}

.kb-demo-label {
	display: inline-flex;
	width: max-content;
	margin-bottom: 9px;
	padding: 3px 9px;
	border: 1px solid var(--line-strong);
	border-radius: 99px;
	color: var(--amber);
	font-size: 9px;
	font-weight: 800;
}

.kb-epub-card > img {
	display: block;
	width: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
}

.kb-stats.is-demo {
	position: relative;
	padding-bottom: 38px;
}

.kb-stats.is-demo > small {
	position: absolute;
	right: 20px;
	bottom: 10px;
	color: var(--muted);
	font-size: 9px;
}

@media (max-width: 1000px) {
	.kb-hero-slider {
		height: 570px;
	}

	.kb-hero-slide__shade {
		background: linear-gradient(90deg, rgba(2, 13, 24, .12), rgba(2, 13, 24, .35) 36%, rgba(2, 13, 24, .94) 100%);
	}

	.kb-hero-slide__copy {
		width: 52%;
		padding-inline: 38px;
	}
}

@media (max-width: 700px) {
	.kb-hero-slider {
		height: 620px;
		min-height: 620px;
	}

	.kb-hero-slide {
		background-position: 35% center;
	}

	.kb-hero-slide__shade {
		background: linear-gradient(0deg, rgba(2, 13, 24, .96) 0, rgba(2, 13, 24, .84) 48%, rgba(2, 13, 24, .08) 100%);
	}

	.kb-hero-slide__copy {
		width: 100%;
		justify-content: flex-end;
		padding: 32px 24px 94px;
	}

	.kb-hero-slide__copy :is(h1, h2) {
		font-size: 42px;
		letter-spacing: -2px;
	}

	.kb-hero-slider__dots {
		right: 24px;
	}

	.kb-hero-slider__controls {
		left: 18px;
	}

	.kb-hero-slider__count {
		left: 18px;
		top: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kb-hero-slide {
		transform: none;
		transition: opacity .01ms;
	}
}
