/* ── Archive reading drawer ──────────────────────────────────────────
 *
 * Slide-over story reader used on archive listing pages (built by
 * assets/js/article-drawer.js as a body-level singleton, outside any
 * transformed ancestors). The article interior reuses .single-article
 * styles from assets/css/single-article.css, which listing pages also
 * enqueue.
 */

.nam-article-drawer {
	display: none;
	inset: 0;
	position: fixed;
	/* Explicit viewport width: the fixed root's containing block can keep a
	 * stale classic-scrollbar gutter deduction after the scroll lock hides
	 * the scrollbar, leaving a 15px uncovered strip. Scroll is locked while
	 * open, so 100vw equals the visible viewport. */
	width: 100vw;
	z-index: 100000;
}

.nam-article-drawer.is-open {
	display: block;
}

.nam-article-drawer__scrim {
	animation: nam-drawer-fade 0.25s ease-out;
	background: rgba(2, 20, 60, 0.55);
	inset: 0;
	position: absolute;
}

.nam-article-drawer__panel {
	animation: nam-drawer-slide 0.3s ease-out;
	background: var(--wdg-color-white, #fff);
	bottom: 0;
	box-shadow: -18px 0 48px rgba(6, 20, 47, 0.28);
	display: flex;
	flex-direction: column;
	outline: none;
	position: absolute;
	right: 0;
	top: 0;
	width: min(780px, 100vw);
}

@keyframes nam-drawer-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes nam-drawer-slide {
	from { transform: translateX(60px); opacity: 0; }
	to { transform: none; opacity: 1; }
}

/* ── Top bar ────────────────────────────────────────────────────── */

.nam-article-drawer__bar {
	align-items: center;
	background: var(--wdg-color-white, #fff);
	border-bottom: 1px solid #e3e6ec;
	display: flex;
	flex: 0 0 auto;
	gap: 0.75rem;
	padding: 0.7rem 1rem;
}

.nam-article-drawer__back {
	align-items: center;
	background: none;
	border: 0;
	color: var(--wdg-color-primary, #0032a0);
	cursor: pointer;
	display: inline-flex;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	gap: 0.45rem;
	letter-spacing: 0.05em;
	min-width: 0;
	padding: 0.4rem 0.2rem;
	text-align: left;
	text-transform: uppercase;
}

.nam-article-drawer__back:hover,
.nam-article-drawer__back:focus {
	color: var(--wdg-color-secondary, #00a9e0);
}

.nam-article-drawer__back svg {
	flex: 0 0 auto;
}

.nam-article-drawer__back-label {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nam-article-drawer__full {
	border: 1px solid var(--wdg-color-primary, #0032a0);
	border-radius: 999px;
	color: var(--wdg-color-primary, #0032a0);
	flex: 0 0 auto;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	line-height: 1;
	margin-left: auto;
	padding: 0.55rem 0.95rem;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.nam-article-drawer__full:hover,
.nam-article-drawer__full:focus {
	background: var(--wdg-color-primary, #0032a0);
	color: #fff;
	text-decoration: none;
}

.nam-article-drawer__x {
	align-items: center;
	background: var(--wdg-color-white, #fff);
	border: 1px solid #d7dce4;
	border-radius: 50%;
	box-sizing: border-box;
	color: var(--wdg-color-primary, #0032a0);
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 auto;
	height: 38px;
	justify-content: center;
	padding: 0;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	width: 38px;
}

.nam-article-drawer__x:hover,
.nam-article-drawer__x:focus {
	background: var(--wdg-color-primary, #0032a0);
	border-color: var(--wdg-color-primary, #0032a0);
	color: #fff;
}

/* ── Body ───────────────────────────────────────────────────────── */

.nam-article-drawer__body {
	-webkit-overflow-scrolling: touch;
	flex: 1 1 auto;
	overflow-y: auto;
	padding: clamp(1.2rem, 3vw, 2.4rem);
}

.nam-article-drawer__article {
	margin: 0 auto;
	max-width: 46rem;
}

.nam-article-drawer__loading {
	animation: nam-drawer-spin 0.6s linear infinite;
	border: 3px solid var(--wdg-color-cool-gray, #bbbcbc);
	border-radius: 50%;
	border-top-color: var(--wdg-color-primary, #0032a0);
	height: 30px;
	margin: 4rem auto;
	width: 30px;
}

@keyframes nam-drawer-spin {
	to { transform: rotate(360deg); }
}

/* Background scroll lock while the drawer is open. */
.nam-drawer-lock {
	overflow: hidden !important;
}

/* ── Mobile ─────────────────────────────────────────────────────── */

@media (max-width: 640px) {
	.nam-article-drawer__panel {
		width: 100%;
	}

	.nam-article-drawer__bar {
		gap: 0.5rem;
		padding: 0.6rem 0.75rem;
	}

	.nam-article-drawer__back-label {
		max-width: 38vw;
	}

	.nam-article-drawer__body {
		padding: 1rem 1rem 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nam-article-drawer__scrim,
	.nam-article-drawer__panel {
		animation: none;
	}

	.nam-article-drawer__full,
	.nam-article-drawer__x {
		transition: none;
	}
}
