/*
 * DN Okuma Deneyimi -- reading-experience additions for single posts.
 * Adds: breadcrumb, chapter badge, reading-progress bar, auto table of
 * contents (desktop sidebar + mobile <details>), and a restyle of the
 * theme's own prev/next chapter nav (targeted by tag, no template edit).
 * Uses the site's real design tokens (see theme.css @theme block) --
 * no new colors or fonts introduced.
 */

.dn-reading-head {
	max-width: 108rem;
	margin-inline: auto;
	padding-top: 1.5rem;
}

.dn-breadcrumb {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	font-family: var(--font-sans);
	font-size: 0.8125rem;
	color: var(--color-neutral);
	opacity: 0.75;
	margin-bottom: 0.9rem;
}
.dn-breadcrumb a {
	color: inherit;
	text-decoration: none;
}
.dn-breadcrumb a:hover {
	color: var(--color-secondary-600);
}
.dn-bc-sep {
	opacity: 0.5;
}
.dn-bc-current {
	color: var(--color-primary-900);
	font-weight: 500;
	opacity: 1;
}

.dn-chip {
	display: inline-block;
	font-family: var(--font-sans);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--color-primary-600);
	background: rgba(27, 73, 101, 0.08);
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	margin-bottom: 0.9rem;
}

.dn-progress-track {
	position: sticky;
	top: 0;
	z-index: 30;
	height: 3px;
	background: rgba(27, 73, 101, 0.12);
	margin-bottom: 1.1rem;
	border-radius: 2px;
	overflow: hidden;
}
.dn-progress-fill {
	height: 100%;
	width: 0%;
	background: var(--color-secondary-600);
	border-radius: 2px;
}

.dn-toc-mobile {
	display: none;
	border: 1px solid rgba(27, 73, 101, 0.16);
	border-radius: 10px;
	padding: 0 1rem;
	margin-bottom: 0.5rem;
	background: #fff;
}
.dn-toc-mobile summary {
	font-family: var(--font-sans);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--color-primary-600);
	padding: 0.9rem 0;
	cursor: pointer;
}
.dn-toc-mobile ul {
	list-style: none;
	margin: 0;
	padding: 0 0 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.dn-toc-mobile a {
	font-family: var(--font-sans);
	font-size: 0.85rem;
	color: var(--color-neutral);
	text-decoration: none;
}

.dn-reading-grid {
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	gap: 3.5rem;
	align-items: start;
	max-width: 108rem;
	margin-inline: auto;
}
.dn-toc {
	position: sticky;
	top: 1.2rem;
}
.dn-toc-kicker {
	font-family: var(--font-sans);
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-secondary-700);
	font-weight: 600;
	margin-bottom: 0.75rem;
}
.dn-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}
.dn-toc a {
	display: block;
	padding: 0.45rem 0.6rem;
	border-radius: 6px;
	font-family: var(--font-sans);
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--color-neutral);
	opacity: 0.75;
	text-decoration: none;
}
.dn-toc li.dn-toc-h3 a {
	padding-left: 1.2rem;
	font-size: 0.8rem;
}
.dn-toc a:hover {
	color: var(--color-primary-600);
	opacity: 1;
}
.dn-reading-body {
	min-width: 0;
	max-width: 84rem;
}
.dn-reading-body-solo {
	margin-inline: auto;
}

/* Widen the theme's own narrow max-w-3xl wrapper (single.php's <article>
   and its bottom <nav>) so the reading grid has room -- needs the extra
   type selector to outrank the existing .max-w-3xl utility class. */
main > article.max-w-3xl,
main > nav.max-w-3xl {
	max-width: 108rem;
	margin-inline: auto;
}

/* Restyle the theme's own prev/next nav (single.php's bottom <nav>) --
   targeted by structure only, no template file touched. */
main > nav.max-w-3xl {
	gap: 1.25rem;
}
main > nav a {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1.1rem 1.3rem;
	border: 1px solid rgba(27, 73, 101, 0.16);
	border-radius: 12px;
	text-decoration: none;
	min-height: 44px;
	box-sizing: border-box;
	flex: 1;
	color: var(--color-primary-900);
	font-family: var(--font-serif);
	font-size: 1rem;
	font-weight: 600;
}
main > nav a:hover {
	border-color: var(--color-primary-600);
	color: var(--color-primary-600);
}

@media (max-width: 56rem) {
	.dn-reading-grid {
		grid-template-columns: 1fr;
	}
	.dn-toc {
		display: none;
	}
	.dn-toc-mobile {
		display: block;
	}
}
