/* ================================================================
   Education Articles Plugin — Article Detail Page Styles
   Design reference: Figma 7402-161971 (IUX Landing Page)
   Colors / font tokens mirror those in articles.css.
   ================================================================ */

/* ── Design tokens ──────────────────────────────────────────── */
:root {
	--sa-white:        #ffffff;
	--sa-black:        #000000;
	--sa-gray-100:     #f2f2f2;
	--sa-gray-200:     #dfdfdf;
	--sa-gray-400:     #9f9f9f;
	--sa-gray-500:     #808080;
	--sa-gray-600:     #606060;
	--sa-gray-800:     #202020;
	--sa-gray-900:     #151515;
	--sa-primary:      #0fef9e;
	--sa-font:         'Manrope', sans-serif;

	/* Layout */
	--sa-content-w:    994px;
	--sa-page-px:      120px;
	--sa-bar-px:       224px;

	/* Radii */
	--sa-radius-xs:    4px;
	--sa-radius-s:     8px;
	--sa-radius-m:     12px;
	--sa-radius-pill:  999px;
}

/* ── Outer wrapper ──────────────────────────────────────────── */
.art-detail {
	font-family: var(--sa-font);
	background-color: var(--sa-black);
	width: 100%;
	position: relative;
}

/* ══════════════════════════════════════════════════════════════
   Breadcrumb bar
   ══════════════════════════════════════════════════════════════ */
.art-detail__bar {
	background-color: var(--sa-white);
}

.art-detail__bar-inner {
	max-width: 1440px;
	margin-inline: auto;
	padding: 24px var(--sa-bar-px);
	box-sizing: border-box;
}

.art-detail__breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px;
	font-size: 12px;
	font-weight: 500;
	line-height: 18px;
	color: var(--sa-gray-500);
}

.art-detail__bc-link {
	color: var(--sa-black);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.18s ease;
}
.art-detail__bc-link:hover {
	color: var(--sa-primary);
}

.art-detail__bc-sep {
	display: flex;
	align-items: center;
	color: var(--sa-black);
	flex-shrink: 0;
}

.art-detail__bc-current {
	color: var(--sa-gray-500);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 60ch;
}

/* ══════════════════════════════════════════════════════════════
   Content area (white background)
   ══════════════════════════════════════════════════════════════ */
.art-detail__content-wrap {
	background-color: var(--sa-white);
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0 var(--sa-page-px);
	box-sizing: border-box;
}

.art-detail__content {
	width: 100%;
	max-width: var(--sa-content-w);
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-bottom: 48px;
}

/* ── Article header ─────────────────────────────────────────── */
.art-detail__header {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding-top: 16px;
}

.art-detail__h1 {
	font-size: 32px;
	font-weight: 500;
	line-height: 48px;
	color: var(--sa-black);
	margin: 0;
}

.art-detail__meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.art-detail__author-block {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.art-detail__avatar-wrap {
	flex-shrink: 0;
}

.art-detail__avatar-img {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.art-detail__avatar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--sa-gray-100);
	flex-shrink: 0;
}

.art-detail__author-name {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-black);
	white-space: nowrap;
}

.art-detail__meta-sep {
	font-size: 14px;
	color: var(--sa-gray-600);
	line-height: 20px;
	user-select: none;
}

.art-detail__date,
.art-detail__read-time {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-gray-600);
	white-space: nowrap;
}

/* Share row */
.art-detail__share-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.art-detail__share-label {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-black);
	white-space: nowrap;
}

.art-share-icons {
	display: flex;
	align-items: center;
	gap: 8px;
}

.art-share-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	text-decoration: none;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.art-share-icon:hover {
	opacity: 0.8;
	transform: scale(1.1);
}
.art-share-icon svg {
	display: block;
	width: 24px;
	height: 24px;
}

/* ── Thumbnail ──────────────────────────────────────────────── */
.art-detail__thumb {
	width: 100%;
	border-radius: var(--sa-radius-m);
	overflow: hidden;
	aspect-ratio: 16/7;
	background: var(--sa-gray-100);
}

.art-detail__thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: var(--sa-radius-m);
}

/* ── Table of Contents ──────────────────────────────────────── */
.art-detail__toc {
	background: var(--sa-gray-100);
	border-radius: var(--sa-radius-xs);
	overflow: hidden;
}

.art-detail__toc-toggle {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 16px 24px;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
	font-family: var(--sa-font);
}
.art-detail__toc-toggle:focus-visible {
	outline: 2px solid var(--sa-primary);
	outline-offset: -2px;
}

.art-detail__toc-icon {
	flex-shrink: 0;
	display: flex;
	color: var(--sa-black);
}

.art-detail__toc-heading {
	flex: 1;
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
	color: var(--sa-black);
}

.art-detail__toc-chevron {
	flex-shrink: 0;
	display: flex;
	color: var(--sa-black);
	transition: transform 0.25s ease;
}
.art-detail__toc-toggle[aria-expanded="true"] .art-detail__toc-chevron {
	transform: rotate(180deg);
}

.art-detail__toc-list {
	list-style: none;
	margin: 0;
	padding: 0 24px 16px 60px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.art-detail__toc-list[hidden] {
	display: none;
}

.art-detail__toc-list li {
	font-size: 14px;
	line-height: 20px;
}

.art-detail__toc-link {
	color: var(--sa-gray-600);
	text-decoration: none;
	transition: color 0.18s ease;
}
.art-detail__toc-link:hover {
	color: var(--sa-primary);
}

/* ── Article body ───────────────────────────────────────────── */
.art-detail__body {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-gray-600);
	border-bottom: 1px solid var(--sa-gray-200);
	padding-bottom: 32px;
}


.art-detail__body h2 {
	font-size: 32px;
	font-weight: 500;
	line-height: 48px;
	color: var(--sa-black);
	margin-top: 32px;
	margin-bottom: 16px;
}

.art-detail__body h3 {
	font-size: 24px;
	font-weight: 500;
	line-height: 36px;
	color: var(--sa-black);
	margin-top: 24px;
	margin-bottom: 16px;
}

.art-detail__body h4 {
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
	color: var(--sa-black);
	margin-top: 20px;
	margin-bottom: 12px;
}

.art-detail__body p {
	margin: 0 0 12px;
}

.art-detail__body a {
	color: var(--sa-gray-900);
	text-decoration: underline;
	font-weight: 500;
	font-size: 12px;
}
.art-detail__body a:hover {
	color: var(--sa-primary);
}

.art-detail__body ul,
.art-detail__body ol {
	padding-left: 24px;
	margin-bottom: 16px;
}

.art-detail__body li {
	margin-bottom: 8px;
}

.art-detail__body img {
	max-width: 100%;
	height: auto;
	border-radius: var(--sa-radius-m);
	display: block;
	margin: 16px auto;
}

.art-detail__body blockquote {
	background: var(--sa-gray-100);
	border-radius: var(--sa-radius-xs);
	padding: 24px;
	margin: 16px 0;
}

.art-detail__body blockquote .art-detail__callout-icon {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.art-detail__body blockquote .art-detail__callout-title {
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
	color: var(--sa-black);
}

/* Inline text link (from Figma "Textlink" component) */
.art-detail__body .textlink {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

/* ── Bottom row: Tags + Share ───────────────────────────────── */
.art-detail__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.art-detail__bottom-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.art-detail__tag {
	display: inline-flex;
	align-items: center;
	padding: 2px 12px;
	background: var(--sa-gray-100);
	border-radius: var(--sa-radius-pill);
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	color: var(--sa-gray-800);
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease;
}
.art-detail__tag:hover {
	background: var(--sa-gray-200);
	color: var(--sa-black);
}

/* ══════════════════════════════════════════════════════════════
   Related Articles (dark background)
   ══════════════════════════════════════════════════════════════ */
.art-detail__related {
	background-color: var(--sa-black);
	padding: 32px 0 48px;
	position: relative;
	overflow: hidden;
}

.art-detail__related-inner {
	max-width: 1440px;
	margin-inline: auto;
	padding-inline: var(--sa-bar-px);
	box-sizing: border-box;
	position: relative;
}

.art-detail__related-title {
	font-size: 24px;
	font-weight: 600;
	line-height: 36px;
	color: var(--sa-white);
	margin: 0 0 16px;
}

/* Slider layout: ← button | viewport | button → */
.art-detail__related-slider {
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Viewport clips the track; drag cursor */
.art-detail__related-viewport {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}
.art-detail__related-viewport.is-grabbing {
	cursor: grabbing;
}

/* Single-row flex track — JS sets translateX and card widths */
.art-detail__related-track {
	display: flex;
	flex-wrap: nowrap;
	gap: 24px;
	will-change: transform;
}

/* Related article card — width driven by JS via inline style */
.art-detail__rel-card {
	flex: 0 0 auto;
	min-width: 240px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.art-detail__rel-card-img-link {
	display: block;
	text-decoration: none;
}

.art-detail__rel-thumb {
	width: 100%;
	aspect-ratio: 16/9;
	border-radius: var(--sa-radius-s);
	overflow: hidden;
	background: var(--sa-gray-800);
}
.art-detail__rel-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: var(--sa-radius-s);
}
.art-detail__rel-thumb-placeholder {
	width: 100%;
	height: 100%;
	background: var(--sa-gray-800);
	border-radius: var(--sa-radius-s);
}

.art-detail__rel-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Type / Level breadcrumb */
.art-detail__rel-breadcrumb {
	display: flex;
	align-items: center;
	gap: 2px;
}

.art-detail__rel-bc-item {
	font-size: 12px;
	font-weight: 500;
	line-height: 18px;
	color: var(--sa-primary);
	text-decoration: underline;
}

.art-detail__rel-bc-sep {
	font-size: 12px;
	color: var(--sa-gray-400);
	line-height: 18px;
	margin-inline: 2px;
}

.art-detail__rel-title {
	font-size: 18px;
	font-weight: 500;
	line-height: 28px;
	height: 56px; /* 2 lines × 28px — keeps all cards the same height */
	color: var(--sa-gray-100);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.art-detail__rel-title a {
	color: inherit;
	text-decoration: none;
}
.art-detail__rel-title a:hover {
	color: var(--sa-primary);
}

.art-detail__rel-excerpt {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-gray-400);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	height: 60px;
}

.art-detail__rel-meta {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-gray-400);
	flex-wrap: wrap;
}
.art-detail__rel-meta time {
	white-space: nowrap;
}

.art-detail__rel-sep {
	user-select: none;
}

.art-detail__rel-time {
	display: flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
}
.art-detail__rel-time svg {
	flex-shrink: 0;
}

.art-detail__rel-tags {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;        /* Firefox */
	-webkit-overflow-scrolling: touch;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
}
.art-detail__rel-tags::-webkit-scrollbar {
	display: none;               /* Chrome / Safari */
}
.art-detail__rel-tags.is-grabbing {
	cursor: grabbing;
}

.art-detail__rel-tag {
	display: inline-flex;
	align-items: center;
	padding: 2px 12px;
	background: var(--sa-gray-800);
	border-radius: var(--sa-radius-pill);
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
	color: var(--sa-gray-100);
}

/* Prev/Next arrow buttons — always visible on all breakpoints */
.art-detail__rel-arrow {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--sa-gray-800);
	border: 1px solid rgba(255, 255, 255, 0.12);
	cursor: pointer;
	color: var(--sa-white);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.18s ease, opacity 0.18s ease;
	flex-shrink: 0;
}
.art-detail__rel-arrow:hover:not([disabled]) {
	background: var(--sa-gray-700, #374151);
}
.art-detail__rel-arrow[disabled] {
	opacity: 0.3;
	cursor: default;
}

/* ══════════════════════════════════════════════════════════════
   CTA Section (dark background)
   ══════════════════════════════════════════════════════════════ */
.art-detail__cta {
	background-color: var(--sa-black);
	position: relative;
	overflow: hidden;
	padding: 32px 64px;
	box-sizing: border-box;
}

.art-detail__cta-glow {
	position: absolute;
	width: 202px;
	height: 152px;
	bottom: -80px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--sa-primary);
	border-radius: var(--sa-radius-pill);
	filter: blur(200px);
	pointer-events: none;
}

.art-detail__cta-inner {
	max-width: 1440px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	position: relative;
}

.art-detail__cta-title {
	font-size: 32px;
	font-weight: 500;
	line-height: 48px;
	color: var(--sa-white);
	text-align: center;
	margin: 0;
}

.art-detail__cta-desc {
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: var(--sa-gray-400);
	text-align: center;
	margin: 0;
	max-width: 640px;
}

.art-detail__cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	background: var(--sa-primary);
	border-radius: var(--sa-radius-xs);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	color: var(--sa-gray-800);
	text-decoration: none;
	transition: opacity 0.18s ease;
}
.art-detail__cta-btn:hover {
	opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════
   Scroll-to-top button
   ══════════════════════════════════════════════════════════════ */
.art-detail__scroll-top {
	position: fixed;
	bottom: 40px;
	right: 40px;
	width: 48px;
	height: 48px;
	border-radius: 24px;
	background: var(--sa-primary);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sa-gray-800);
	box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 2px 16px rgba(0,0,0,.16);
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 100;
}
.art-detail__scroll-top[hidden] {
	display: none;
}
.art-detail__scroll-top:hover {
	opacity: 0.9;
	transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════
   Responsive — Tablet (600–1023px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
	:root {
		--sa-page-px: 40px;
		--sa-bar-px:  40px;
	}

	.art-detail__h1 {
		font-size: 24px;
		line-height: 36px;
	}

	.art-detail__cta-title {
		font-size: 24px;
		line-height: 36px;
	}
}

/* ══════════════════════════════════════════════════════════════
   Responsive — Mobile (<600px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 599px) {
	:root {
		--sa-page-px: 16px;
		--sa-bar-px:  16px;
	}

	.art-detail__h1 {
		font-size: 20px;
		line-height: 30px;
	}

	.art-detail__meta-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	/* Breadcrumb: truncate article title */
	.art-detail__bc-current {
		max-width: 20ch;
	}

	.art-detail__cta {
		padding-inline: 24px;
	}

	.art-detail__cta-title {
		font-size: 20px;
		line-height: 30px;
	}

	.art-detail__scroll-top {
		bottom: 24px;
		right: 16px;
	}
}

/* ══════════════════════════════════════════════════════════════
   Article body — WordPress block editor / classic content styles
   ══════════════════════════════════════════════════════════════ */
.art-detail__body .wp-block-image {
	margin: 24px 0;
}
.art-detail__body .wp-block-image img {
	border-radius: var(--sa-radius-m);
}
.art-detail__body .wp-block-image figcaption {
	font-size: 14px;
	text-align: center;
	color: var(--sa-black);
	margin-top: 8px;
}

.art-detail__body .wp-block-quote {
	background: var(--sa-gray-100);
	border-radius: var(--sa-radius-xs);
	padding: 24px;
	border: none;
	margin: 16px 0;
}
.art-detail__body .wp-block-quote p {
	font-size: 14px;
	color: var(--sa-gray-600);
}

/* Reset WordPress global styles that might conflict */
.art-detail__body > * + * {
	margin-top: 0;
}
