/*
 * Hybrid docs theme: dark nav (awp-web tokens) + light reading column.
 * Design tokens aligned with awp-web var/awp/www/awpweb/lib/css/dark.css; update both when branding changes.
 */

:root {
	--ac-bg-page: #1a1f28;
	--ac-bg-sidebar: #13151e;
	--ac-bg-card: #272b36;
	--ac-bg-card-head: rgba(0, 0, 0, 0.2);
	--ac-bg-hover: rgba(255, 255, 255, 0.06);
	--ac-bg-input: rgba(0, 0, 0, 0.25);
	--ac-bg-stripe-odd: #1e2330;
	--ac-bg-stripe-even: #171c25;
	--ac-header-bg: #272b36;
	--ac-border: rgba(255, 255, 255, 0.12);
	--ac-border-subtle: rgba(255, 255, 255, 0.1);
	--ac-border-input: rgba(255, 255, 255, 0.2);
	--ac-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
	--ac-shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.25);
	--ac-text-heading: #e2e8f0;
	--ac-text-body: #b0b8c8;
	--ac-text-muted: #8b95a2;
	--ac-accent: #6dd7f9;
	--ac-accent-hover: #00a8e0;
	--ac-success: #36d7b7;
	--ac-danger: #ef4444;
	--ac-danger-hover: #b91c1c;
	--ac-warning: #e8b923;
	--ac-toggle-header-active: #0096cc;

	/* Light column (readable on white/off-white) */
	--docs-content-bg: #f8f9fb;
	--docs-content-text: #2d3748;
	--docs-content-muted: #4a5568;
	--docs-link: #007aa3;
	--docs-link-hover: #005f7a;
	--docs-code-bg: #f0f2f5;
	--docs-code-border: #e2e6ea;

	/* Must match fixed sidebar offset (sphinx_rtd_theme uses .wy-nav-side { position: fixed; top: 0 }) */
	--atomicorp-docs-topbar-height: 3rem;
}

/* Page shell */
.wy-body-for-nav {
	background: var(--ac-bg-page);
}

/* Full-width top bar (social) — above RTD grid, all viewports */
.atomicorp-docs-topbar {
	background: #0d0d0d;
	border-bottom: 1px solid var(--ac-border-subtle);
	position: sticky;
	top: 0;
	z-index: 400;
	box-sizing: border-box;
	height: var(--atomicorp-docs-topbar-height);
}

.atomicorp-docs-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	box-sizing: border-box;
	height: 100%;
	padding: 0 1rem 0 1.618em;
}

.atomicorp-docs-topbar__social {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.atomicorp-docs-topbar__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, 0.78);
	line-height: 0;
	border-radius: 4px;
	padding: 0.25rem;
	transition: color 0.15s ease, background 0.15s ease;
}

.atomicorp-docs-topbar__link:hover,
.atomicorp-docs-topbar__link:focus-visible {
	color: var(--ac-accent);
	background: rgba(255, 255, 255, 0.06);
	outline: none;
}

.atomicorp-docs-topbar__icon {
	display: block;
	flex-shrink: 0;
}

/* Sidebar — offset top: RTD uses fixed; top:0 (z-index 200) under our topbar (z-index 400) */
.wy-nav-side {
	top: var(--atomicorp-docs-topbar-height) !important;
	background: var(--ac-bg-sidebar) !important;
	border-right: 1px solid var(--ac-border-subtle);
}

.wy-side-nav-search {
	background: var(--ac-header-bg) !important;
	border-bottom: 1px solid var(--ac-border-subtle);
	padding-top: 0.5rem;
	padding-bottom: 0.75rem;
	text-align: left;
}

/* Left-align logo link (logo_only: no project title beside mark) */
.wy-side-nav-search > a {
	display: block;
	text-align: left !important;
	padding-left: 1.618em;
	padding-right: 1.618em;
	margin: 0;
}

/* Explicit sizing helps layout when intrinsic PNG metadata confuses some engines (e.g. gray+alpha). */
.wy-side-nav-search img.logo {
	display: block !important;
	max-height: 48px;
	width: auto;
	height: auto;
	min-height: 28px;
	min-width: 160px;
	max-width: 100%;
	padding: 0.35rem 0;
	margin: 0 auto 0 0;
	object-fit: contain;
	object-position: left center;
	-webkit-user-select: none;
	user-select: none;
}

.wy-side-nav-search input[type="text"] {
	background: var(--ac-bg-input) !important;
	border: 1px solid var(--ac-border-input) !important;
	color: var(--ac-text-heading) !important;
	border-radius: 4px;
}

.wy-side-nav-search input[type="text"]::placeholder {
	color: var(--ac-text-muted);
	opacity: 1;
}

/* Nav tree */
.wy-menu-vertical header,
.wy-menu-vertical p.caption {
	color: var(--ac-text-muted) !important;
	border-top-color: var(--ac-border-subtle) !important;
}

/* Top-level toctree when this page is inside the global TOC (ul.current) */
.wy-menu-vertical > ul.current {
	background: transparent !important;
}

/*
 * sphinx_rtd_theme paints expanded/current branches with #e3e3e3 / #fcfcfc / #c9c9c9.
 * Our links use light text (--ac-text-body); that must sit on dark surfaces only.
 */
.wy-menu-vertical li.current {
	background: var(--ac-bg-card) !important;
}

/*
 * Current / expanded rows: recolor only. Do NOT set padding with !important here —
 * sphinx_rtd_theme uses deeper selectors (e.g. li.toctree-l2.current>a) with larger
 * horizontal padding for nested levels; a blanket padding !important flattens the tree.
 */
.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a {
	background: var(--ac-bg-hover) !important;
	color: var(--ac-text-heading) !important;
	border: none !important;
	border-left: 3px solid var(--ac-accent) !important;
	font-weight: 600;
}

.wy-menu-vertical li.current > a:hover,
.wy-menu-vertical li.on a:hover {
	background: var(--ac-bg-hover) !important;
	color: var(--ac-accent) !important;
}

.wy-menu-vertical li.toctree-l1.current > a {
	border-left: 3px solid var(--ac-accent) !important;
	border-top: 1px solid var(--ac-border-subtle) !important;
	border-bottom: 1px solid var(--ac-border-subtle) !important;
}

/* RTD nested “current rail” backgrounds — keep dark */
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a {
	background: var(--ac-bg-hover) !important;
	color: var(--ac-text-heading) !important;
}

.wy-menu-vertical li.toctree-l3.current > a,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a {
	background: var(--ac-bg-hover) !important;
	color: var(--ac-text-heading) !important;
}

.wy-menu-vertical a {
	color: var(--ac-text-body) !important;
}

.wy-menu-vertical a:hover {
	background: var(--ac-bg-hover) !important;
	color: var(--ac-accent) !important;
}

/* Toctree +/- control: readable on dark sidebar */
.wy-menu-vertical li button.toctree-expand {
	color: var(--ac-text-muted) !important;
}

.wy-menu-vertical li.current > a button.toctree-expand,
.wy-menu-vertical li.on a button.toctree-expand {
	color: var(--ac-text-heading) !important;
}

.wy-menu-vertical li a:hover button.toctree-expand {
	color: var(--ac-accent) !important;
}

/*
 * Mobile top bar only. sphinx_rtd_theme uses display:none for .wy-nav-top by default
 * and display:block inside @media (max-width: 768px). A global display:flex here would
 * show the hamburger on desktop and break the left sidebar + logo layout.
 */
@media screen and (max-width: 768px) {
	.wy-nav-top {
		display: flex;
		align-items: center;
		justify-content: flex-start;
		gap: 0.75rem;
		padding-left: 0.75rem;
		background: var(--ac-bg-sidebar) !important;
		color: var(--ac-text-heading) !important;
		border-bottom: 1px solid var(--ac-border-subtle);
	}

	.wy-nav-top a {
		color: var(--ac-text-heading) !important;
	}

	.wy-nav-top a:hover {
		color: var(--ac-accent) !important;
	}

	.wy-nav-top i {
		color: var(--ac-accent) !important;
	}
}

/* Main reading column — full width of the pane next to the sidebar */
.wy-nav-content {
	background: var(--docs-content-bg) !important;
	color: var(--docs-content-text);
	max-width: none !important;
}

.wy-nav-content .rst-content {
	color: var(--docs-content-text);
}

.wy-nav-content .rst-content .wy-table-responsive {
	max-width: 100%;
}

.wy-nav-content .rst-content div.highlight {
	max-width: 100%;
	overflow-x: auto;
}

.wy-nav-content .rst-content .section > h1,
.wy-nav-content .rst-content .section > h2,
.wy-nav-content .rst-content .section > h3,
.wy-nav-content .rst-content .section > h4 {
	color: #1a202c;
}

.wy-nav-content .rst-content a.reference,
.wy-nav-content .rst-content a {
	color: var(--docs-link);
}

.wy-nav-content .rst-content a.reference:hover,
.wy-nav-content .rst-content a:hover {
	color: var(--docs-link-hover);
}

/* Breadcrumbs in content header */
.wy-breadcrumbs li a,
.wy-breadcrumbs li.wy-breadcrumbs-aside a {
	color: var(--docs-link);
}

.wy-breadcrumbs li a:hover {
	color: var(--docs-link-hover);
}

/* Code blocks (light, hybrid-friendly) */
.wy-nav-content .rst-content div.highlight,
.wy-nav-content .rst-content pre {
	background: var(--docs-code-bg) !important;
	border: 1px solid var(--docs-code-border);
	border-radius: 4px;
}

.wy-nav-content .rst-content code.literal {
	background: #edf2f7;
	border: 1px solid #e2e8f0;
	border-radius: 3px;
	padding: 0.1em 0.35em;
	color: #2d3748;
}

/* Admonitions — keep readable on light bg */
.wy-nav-content .rst-content .admonition {
	border-radius: 4px;
}

/* Footer / prev-next */
.rst-footer-buttons a.btn,
.rst-footer-buttons a.btn-neutral {
	background: #fff !important;
	border: 1px solid #cbd5e0 !important;
	color: var(--docs-link) !important;
}

.rst-footer-buttons a.btn:hover,
.rst-footer-buttons a.btn-neutral:hover {
	border-color: var(--docs-link) !important;
	color: var(--docs-link-hover) !important;
}
