/**
 * Tabbed Ebook — front-end layout (colors via CSS variables from inline style on .tabbed-ebook).
 */

.tabbed-ebook {
	--ebook-accent: #e63946;
	--ebook-bg: #0a0a0a;
	--ebook-text: #ffffff;
	--ebook-muted: #cfcfcf;
	background: var(--ebook-bg);
	color: var(--ebook-text);
	padding: 40px;
	border-radius: 12px;
	max-width: 100%;
	box-sizing: border-box;
}

.tabbed-ebook *,
.tabbed-ebook *::before,
.tabbed-ebook *::after {
	box-sizing: border-box;
}

.te-header {
	display: grid;
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
	gap: 24px;
	align-items: stretch;
	margin-bottom: 28px;
}

@media (max-width: 767px) {
	.te-header {
		grid-template-columns: 1fr;
	}
}

.te-cover {
	border-radius: 10px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.06);
	min-height: 120px;
}

.te-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.te-header-main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
}

.te-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.te-badge {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--ebook-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.te-display-title {
	margin: 0;
	font-style: italic;
	font-weight: 700;
	line-height: 1.1;
	color: var(--ebook-text);
}

.te-author {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 4px;
}

.te-author-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--ebook-text);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.te-author-name {
	font-size: 15px;
	color: var(--ebook-muted);
}

/* Tab bar */
.te-tablist {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	margin: 0 0 24px;
	padding: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.te-tablist::-webkit-scrollbar {
	height: 6px;
}

.te-tablist::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 999px;
}

.te-tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 14px 18px 16px;
	background: transparent;
	border: none;
	border-bottom: 3px solid transparent;
	color: var(--ebook-muted);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	flex: 0 0 auto;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.te-tab:hover {
	color: var(--ebook-text);
}

.te-tab.is-active {
	color: var(--ebook-text);
	border-bottom-color: var(--ebook-accent);
}

.te-tab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	background: rgba(255, 255, 255, 0.1);
	color: var(--ebook-muted);
}

.te-tab.is-active .te-tab-count {
	background: var(--ebook-accent);
	color: #fff;
}

/* Panels */
.te-panels {
	position: relative;
}

.tab-panel {
	display: none;
}

.tab-panel.is-visible {
	display: block;
}

.te-panel-inner {
	max-width: 900px;
}

.te-subsection-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.te-sub-btn {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: var(--ebook-text);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.04);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.te-sub-btn:hover {
	border-color: var(--ebook-accent);
	background: rgba(230, 57, 70, 0.12);
}

.te-panel-heading {
	margin: 0 0 12px;
	font-size: clamp(22px, 3vw, 32px);
	font-weight: 800;
	line-height: 1.2;
	color: var(--ebook-text);
}

.te-panel-description {
	margin: 0 0 20px;
	font-size: 16px;
	line-height: 1.65;
	color: var(--ebook-muted);
}

.te-panel-description p {
	margin: 0 0 0.75em;
}

.te-panel-description p:last-child {
	margin-bottom: 0;
}

.te-setup-callout {
	margin: 0 0 24px;
	padding: 18px 20px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.04);
}

.te-setup-callout__title {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ebook-accent);
	margin-bottom: 10px;
}

.te-setup-list {
	margin: 0;
	padding-left: 1.1em;
	color: var(--ebook-text);
	line-height: 1.55;
}

.te-setup-list li {
	margin: 0.35em 0;
}

.te-video-card {
	margin-top: 8px;
}

.te-video-card__title {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 10px;
	color: var(--ebook-text);
}

.te-video-card__embed iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	border: 0;
	border-radius: 10px;
	aspect-ratio: 16 / 9;
	height: auto;
	min-height: 200px;
}

.te-video-fallback {
	margin: 0;
}
