/* Documentation layout (template-docs.php). Loaded only on /docs/ pages. */

.docs-head { padding-top: 150px; padding-bottom: 48px; }
.docs-head h1 { margin: 0; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.1; }
.docs-eyebrow {
	margin: 0 0 12px;
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--green-bright);
}

/* PRO badge: menu, page heading and page text. */
.pro {
	display: inline-block;
	padding: .25em .55em .2em;
	border-radius: 6px;
	background: #f0c040;
	color: #3a2c00;
	font-family: var(--mono);
	font-size: .62em;
	font-weight: 700;
	letter-spacing: .1em;
	line-height: 1.2;
	vertical-align: middle;
}
.docs-head .pro { font-size: .4em; }
.docs-menu .pro { margin-left: 4px; font-size: 10px; }

/* Layout: one column on phones, menu + text from 900px, plus contents from 1100px. */
.docs-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "side" "toc" "main";
	gap: 28px;
	align-items: start;
	padding-block: 40px 96px;
}
.docs-side { grid-area: side; min-width: 0; }
.docs-toc-wrap { grid-area: toc; min-width: 0; }
.docs-main { grid-area: main; min-width: 0; }

@media (min-width: 900px) {
	.docs-layout { grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "side main"; column-gap: 48px; }
	.docs-layout.has-toc { grid-template-areas: "side toc" "side main"; }
	.docs-side { position: sticky; top: 100px; max-height: calc(100vh - 116px); overflow: auto; padding-right: 4px; }
	body.admin-bar .docs-side { top: 132px; max-height: calc(100vh - 148px); }
}
@media (min-width: 1100px) {
	.docs-layout.has-toc { grid-template-columns: 240px minmax(0, 1fr) 220px; grid-template-areas: "side main toc"; }
	.docs-toc-wrap { position: sticky; top: 100px; max-height: calc(100vh - 116px); overflow: auto; }
	body.admin-bar .docs-toc-wrap { top: 132px; max-height: calc(100vh - 148px); }
}

/* Search */
.docs-search label { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 700; color: var(--ink); }
.docs-search__row { display: flex; gap: 8px; }
.docs-search input {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1.5px solid #5f7186;
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 16px;
}
.docs-search button {
	padding: 10px 14px;
	border: 0;
	border-radius: 10px;
	background: var(--navy-800);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.docs-search button:hover { background: var(--navy-900); }

/* Menu and "On this page" */
.docs-menu { margin-top: 24px; }
.docs-menu > summary,
.docs-toc > summary {
	padding: 6px 0;
	font-family: var(--mono);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink);
	cursor: pointer;
}
.docs-menu__label {
	margin: 18px 0 6px;
	font-family: var(--mono);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-soft);
}
.docs-menu__list { margin: 0; padding: 0; list-style: none; }
.docs-menu__list--top { margin-top: 12px; }
.docs-menu__list a {
	display: block;
	padding: 5px 10px;
	border-radius: 8px;
	color: var(--ink-soft);
	font-size: 15px;
	line-height: 1.4;
}
.docs-menu__list a:hover { background: var(--paper-2); color: var(--navy-800); }
.docs-menu__list a[aria-current="page"] {
	background: #fff;
	box-shadow: inset 3px 0 0 var(--green-deep);
	color: var(--navy-900);
	font-weight: 700;
}
.docs-toc ul { margin: 8px 0 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); list-style: none; }
.docs-toc a { display: block; padding: 3px 0; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.docs-toc a:hover { color: var(--navy-800); text-decoration: underline; }
.docs-toc__h3 { padding-left: 12px; }

@media (max-width: 899px) {
	.docs-menu > summary,
	.docs-toc > summary { padding: 12px 14px; border: 1px solid #c5ced8; border-radius: 12px; background: #fff; }
	.docs-menu[open] > summary,
	.docs-toc[open] > summary { margin-bottom: 8px; }
}
@media (min-width: 900px) and (max-width: 1099px) {
	.docs-toc > summary { padding: 12px 14px; border: 1px solid #c5ced8; border-radius: 12px; background: #fff; }
}

/* Page text */
.docs-content { color: var(--ink); font-size: 17px; line-height: 1.7; }
.docs-content > :first-child { margin-top: 0; }
.docs-content h2 { margin: 1.8em 0 .6em; padding-bottom: .35em; border-bottom: 1px solid var(--line); font-size: 28px; }
.docs-content h3 { font-size: 21px; }
.docs-content [id] { scroll-margin-top: 110px; }
.docs-content a { color: var(--blue-500); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.docs-content a:hover { color: var(--navy-800); text-decoration-thickness: 2px; }
.docs-content code { padding: .1em .35em; border-radius: 6px; background: var(--paper-2); font-family: var(--mono); font-size: .88em; }
.docs-content ul,
.docs-content ol { padding-left: 1.3em; }
.docs-content li { margin-bottom: .35em; }
.docs-content li::marker { color: var(--green-deep); }

/* Tables */
.docs-table { margin: 1.4em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.docs-table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.docs-table th,
.docs-table td { padding: 10px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.docs-table thead th { border-top: 0; background: var(--paper-2); color: var(--navy-900); }
.docs-table tbody tr:nth-child(even) { background: #fafcfd; }

/* Notes in a box */
.docs-content .admonition { margin: 1.6em 0; padding: 14px 18px; border: 1px solid var(--line); border-left: 4px solid var(--green-deep); border-radius: 12px; background: #fff; }
.docs-content .admonition-title { margin: 0 0 6px; color: var(--navy-900); font-weight: 700; }
.docs-content .admonition > :last-child { margin-bottom: 0; }
.docs-content .admonition.warning { border-left-color: var(--amber); }
.docs-content .admonition.info { border-left-color: var(--navy-700); }

/* Screenshots */
.docs-content figure { margin: 1.8em 0; }
.docs-content figure img { display: block; width: 100%; height: auto; border: 1px solid rgba(10, 27, 46, .14); border-radius: 14px; background: #fff; }
.docs-content figcaption { margin-top: 10px; color: var(--ink-soft); font-size: 14px; text-align: center; }

/* Documentation home */
.docs-content .asf-hero { margin: 0 0 2.4em; padding-bottom: 2em; border-bottom: 1px solid var(--line); }
.docs-content .asf-hero__title { margin: 0 0 .4em; color: var(--navy-900); font-size: clamp(26px, 3vw, 38px); font-weight: 700; line-height: 1.15; }
.docs-content .asf-lead { max-width: 40em; margin: 0; color: var(--ink-soft); font-size: 19px; }
.docs-content .asf-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.docs-content a.asf-btn { display: inline-flex; align-items: center; gap: .5em; padding: 12px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; }
.docs-content a.asf-btn--primary { background: var(--navy-800); color: #fff; }
.docs-content a.asf-btn--primary:hover { background: var(--navy-900); color: #fff; }
.docs-content a.asf-btn--ghost { border: 1.5px solid var(--navy-800); background: #fff; color: var(--navy-900); }
.docs-content .asf-standards { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.docs-content .asf-standards__lead { color: var(--ink-soft); font-size: 15px; font-weight: 700; }
.docs-content .asf-std { padding: .3em .6em; border: 1px solid rgba(19, 75, 135, .28); border-radius: 7px; background: rgba(19, 75, 135, .07); color: var(--navy-800); font-family: var(--mono); font-size: 12px; font-weight: 700; white-space: nowrap; }
.docs-content .asf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 1.2em 0; }
.docs-content .asf-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.docs-content .asf-card__num { display: block; margin-bottom: 10px; color: #15724f; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.docs-content .asf-card__title { margin: 0 0 .3em; color: var(--navy-900); font-size: 18px; font-weight: 700; }
.docs-content .asf-card p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.docs-content a.asf-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--navy-900); font-weight: 700; text-decoration: none; }
.docs-content a.asf-link:hover { border-color: var(--navy-700); }
.docs-content .asf-link__arrow { color: #15724f; }

/* Search results */
.docs-results__title { margin-top: 0; font-size: 24px; }
.docs-results { margin: 0; padding: 0; list-style: none; }
.docs-results li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.docs-results a { color: var(--blue-500); font-size: 19px; font-weight: 700; text-decoration: underline; text-underline-offset: .18em; }
.docs-results p { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; }

/* Menu v2: sections open and close on click, like the Herodotus docs. */
.docs-menu nav { margin-top: 8px; }
.docs-menu__list--top { margin-top: 4px; }
.docs-menu__list--top > li > a { padding: 9px 10px; color: var(--ink); font-size: 15px; font-weight: 700; }
.docs-group > summary {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 10px;
	border-radius: 8px;
	color: var(--ink);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	list-style: none;
	cursor: pointer;
}
.docs-group > summary::-webkit-details-marker { display: none; }
.docs-group > summary::before {
	content: "";
	flex: 0 0 7px;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform .15s ease;
}
.docs-group[open] > summary::before { transform: rotate(45deg); }
.docs-group > summary:hover { background: var(--paper-2); color: var(--navy-800); }
.docs-group > .docs-menu__list { margin: 0 0 8px; padding-left: 19px; }
.docs-group > .docs-menu__list a { font-size: 14.5px; }
@media (prefers-reduced-motion: reduce) {
	.docs-group > summary::before { transition: none; }
}
@media (min-width: 900px) {
	.docs-menu { margin-top: 16px; }
	.docs-menu > summary { display: none; }
}

/* Live search results under the search field. */
.docs-search input::placeholder { color: #5f7186; opacity: 1; }
.docs-search__status { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; }
.docs-search__status:empty { display: none; }
.docs-search__results { margin-top: 8px; border: 1px solid #c5ced8; border-radius: 12px; background: #fff; }
.docs-search__results[hidden] { display: none; }
.docs-search__results a { display: block; padding: 10px 12px; border-top: 1px solid var(--line); color: var(--ink); }
.docs-search__results a:first-child { border-top: 0; border-radius: 12px 12px 0 0; }
.docs-search__results a:last-child { border-radius: 0 0 12px 12px; }
.docs-search__results a:only-child { border-radius: 12px; }
.docs-search__results a:hover { background: var(--paper-2); }
.docs-search__results a:focus-visible { background: var(--paper-2); outline-offset: -3px; }
.docs-search__results strong { display: block; color: var(--navy-800); font-size: 15px; }
.docs-search__results span { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.docs-search__results mark { padding: 0 1px; border-radius: 2px; background: #fde68a; color: inherit; }

/* The search field keeps its name for screen readers; on screen the placeholder says it. */
.docs-search > label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); border: 0; white-space: nowrap; }

/* Screenshots: click to see them full size. */
.docs-content .docs-zoom { display: block; width: 100%; padding: 0; border: 0; border-radius: 14px; background: none; cursor: zoom-in; }
.docs-lightbox { max-width: 96vw; max-height: 94vh; padding: 16px; border: 0; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); }
.docs-lightbox::backdrop { background: rgba(4, 32, 56, .82); }
.docs-lightbox__img { display: block; width: auto; height: auto; max-width: calc(96vw - 32px); max-height: calc(94vh - 120px); margin: 0 auto; }
.docs-lightbox__close { display: block; margin: 0 0 12px auto; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--navy-800); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.docs-lightbox__close:hover { background: var(--navy-900); }
.docs-lightbox__caption { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; text-align: center; }

/* Wider sidebar on large screens: 320px instead of 240px, taken from the text column. */
@media (min-width: 1100px) {
	.docs-layout { grid-template-columns: 320px minmax(0, 1fr); }
	.docs-layout.has-toc { grid-template-columns: 320px minmax(0, 1fr) 220px; }
}
