/**
 * OniGrow Theme — Single Post Stylesheet
 *
 * Styles for individual blog post pages (single.php).
 * Template structure: .og-article > .og-back, .og-hero, .entry-title,
 *   .og-meta, .og-toc, .entry-content, .og-bottom
 * Tokens defined in main.css :root.
 *
 * @package OniGrow
 * @since 1.0.0
 */

/* ── Reading Progress Bar ────────────────────────────────── */

.og-progress {
	position: fixed;
	top: 0;
	left: 0;
	height: 3px;
	width: 0%;
	background: var(--color-gradient);
	z-index: 9999;
	transition: width 0.1s linear;
	pointer-events: none;
}

/* ── Article Container ───────────────────────────────────── */

.og-article {
	max-width: 720px;
	margin: 0 auto;
	padding: var(--spacing-lg, 2rem) var(--spacing-md, 1.5rem) var(--spacing-xl, 3rem);
}

/* ── Back Link ───────────────────────────────────────────── */

.og-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-primary);
	text-decoration: none;
	margin-bottom: var(--spacing-lg, 2rem);
	transition: gap 0.2s ease;
}

.og-back:hover {
	gap: 10px;
}

.og-back svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* ── Featured Image ──────────────────────────────────────── */

.og-hero {
	margin-bottom: var(--spacing-xl, 2.5rem);
	border-radius: var(--radius-md, 12px);
	overflow: hidden;
	aspect-ratio: 16 / 9;
}

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

/* ── Post Meta (date + read time) ────────────────────────── */

.og-meta {
	display: flex;
	align-items: center;
	gap: var(--spacing-sm, 0.75rem);
	font-size: 0.875rem;
	color: var(--color-text-muted);
	margin-bottom: var(--spacing-lg, 2rem);
}

.og-meta__dot::before {
	content: '·';
}

/* ── Table of Contents ───────────────────────────────────── */

.og-toc {
	background: var(--color-bg-alt, #f8f9fa);
	border-left: 4px solid var(--color-primary);
	border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
	padding: 16px 20px;
	margin-bottom: var(--spacing-xl, 2.5rem);
}

.og-toc__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.og-toc__label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-primary);
}

.og-toc__label-icon svg,
.og-toc__toggle svg {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
}

.og-toc__toggle {
	color: var(--color-text-muted);
}

.og-toc__list-wrap {
	overflow: hidden;
}

.og-toc__list {
	margin: 12px 0 0;
	padding-left: 1.25rem;
	list-style: decimal;
}

.og-toc__list li {
	padding-bottom: 8px;
	font-size: 0.9rem;
	line-height: 1.4;
}

.og-toc__list a {
	color: var(--color-text);
	text-decoration: none;
}

.og-toc__list a:hover {
	color: var(--color-primary);
	text-decoration: underline;
}

/* ── Article Content ─────────────────────────────────────── */

.single .entry-content {
	font-size: 1rem;
	line-height: 1.75;
	color: var(--color-text);
}

.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4 {
	margin-top: var(--spacing-xl, 2.5rem);
	margin-bottom: var(--spacing-md, 1.5rem);
	scroll-margin-top: 80px;
}

.single .entry-content p {
	margin-bottom: var(--spacing-md, 1.5rem);
}

.single .entry-content ul,
.single .entry-content ol {
	padding-left: 1.5rem;
	margin-bottom: var(--spacing-md, 1.5rem);
}

.single .entry-content li {
	margin-bottom: 0.5rem;
	line-height: 1.7;
}

.single .entry-content a {
	color: var(--color-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.single .entry-content a:hover {
	text-decoration: none;
}

/* ── Bottom Navigation ───────────────────────────────────── */

.og-bottom {
	margin-top: var(--spacing-xl, 2.5rem);
	padding-top: var(--spacing-lg, 2rem);
	border-top: 1px solid var(--color-border, #e5e7eb);
}

.og-bottom__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--spacing-md, 1.5rem);
}

.og-bottom__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--color-primary);
	text-decoration: none;
	transition: gap 0.2s ease;
}

.og-bottom__btn:hover {
	gap: 10px;
}

.og-bottom__btn svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.og-bottom__dates {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.8125rem;
	color: var(--color-text-muted);
	text-align: right;
}

/* ── Entry Footer (tags) ─────────────────────────────────── */

.single .entry-footer {
	margin-top: var(--spacing-lg, 2rem);
	padding-top: var(--spacing-md, 1.5rem);
	border-top: 1px solid var(--color-border, #e5e7eb);
}

.single .tags-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.single .tags-links a {
	display: inline-block;
	padding: 4px 12px;
	background: var(--color-bg-alt, #f8f9fa);
	border: 1px solid var(--color-border, #e5e7eb);
	border-radius: var(--radius-full, 100px);
	font-size: 0.8125rem;
	color: var(--color-text, #1a1a2e);
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.single .tags-links a:hover {
	background: var(--color-primary, #e1306c);
	border-color: var(--color-primary, #e1306c);
	color: #ffffff;
}
