/* ---------------------------------------------------------------------------
 * Documentation library (page-documentation.php) — prototype lines 504–553.
 * Every value below is the prototype's inline style. Shared tokens and classes
 * (.section, .page-title, .kicker, .sr-only) live in base.css.
 * ------------------------------------------------------------------------ */

.docs .page-title {
	margin-bottom: 10px;
	/* The prototype's documentation H1 (line 507) is the one page heading with no text-wrap
	   declaration, so the shared .page-title value is turned off again here. */
	text-wrap: wrap;
}

/* Intro row: paragraph + "Request printed literature →" ------------------- */
.docs__intro {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px 24px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}
.docs__intro-text { margin: 0; color: var(--text-2); max-width: 640px; text-wrap: pretty; }
.docs__intro-link { font-size: 13px; font-weight: 600; color: var(--orange-text); white-space: nowrap; }
.docs__intro-link:hover { color: var(--orange-text); text-decoration: underline; }

/* Tab row ---------------------------------------------------------------- */
.docs__tabs {
	display: flex;
	gap: 0;
	border-bottom: 1px solid var(--line);
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.docs__tab {
	padding: 12px 20px;
	margin-bottom: -1px;
	border-bottom: 3px solid transparent;
	color: var(--muted-2);
	font-weight: 500;
}
.docs__tab:hover { color: var(--ink); }
.docs__tab.is-current {
	border-bottom-color: var(--orange);
	color: var(--ink);
	font-weight: 600;
}

/* Two-column body -------------------------------------------------------- */
.docs__body {
	display: flex;
	flex-wrap: wrap;
	gap: 32px 40px;
	align-items: flex-start;
}
.docs__side {
	flex: 1 1 220px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.docs__search { display: block; margin: 0; }
.docs__search-input {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--input-line);
	background: #fff;
	color: var(--ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 400;
	/* base.css sets `font: inherit` on form controls, which drags in the body line-height; the
	   prototype's global rule is only `input,select,button,textarea{font-family:inherit}`, so its
	   controls keep the browser's own metrics — 12px padding + 14px text = a 44px field. */
	line-height: normal;
	border-radius: 2px;
	min-width: 0;
	-webkit-appearance: none;
	appearance: none;
}
.docs__search-input::-webkit-search-decoration,
.docs__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.docs__cats { display: flex; flex-direction: column; gap: 2px; }
.docs__cats-label {
	font: 11px var(--font-mono);
	color: var(--muted);
	letter-spacing: .1em;
	margin-bottom: 6px;
}
.docs__cat {
	padding: 9px 12px;
	font-size: 14px;
	border-radius: 2px;
	display: flex;
	justify-content: space-between;
	gap: 8px;
	background: transparent;
	color: var(--ink);
	font-weight: 400;
}
.docs__cat:hover { color: var(--ink); }
.docs__cat.is-on { background: var(--navy); color: #fff; font-weight: 600; }
.docs__cat.is-on:hover { color: #fff; }
.docs__cat-count { font: 11px var(--font-mono); opacity: .7; }

.docs__printed {
	background: var(--navy);
	color: #fff;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
}
.docs__printed-title { font: 600 18px var(--font-display); text-transform: uppercase; }
.docs__printed-text { font-size: 13px; color: var(--dark-text); }
.docs__printed-btn {
	padding: 10px;
	border: 1.5px solid var(--tag-t);
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	border-radius: 2px;
	color: #fff;
}
.docs__printed-btn:hover { border-color: #fff; color: #fff; }

/* Table ------------------------------------------------------------------ */
.docs__panel {
	flex: 999 1 460px;
	min-width: 0;
	background: var(--panel);
	border: 1px solid var(--line);
	overflow-x: auto;
}
.docs__table { min-width: 520px; }
.docs__head,
.docs-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(90px, 150px) 72px 76px;
	gap: 0 12px;
}
.docs__head {
	padding: 10px 20px;
	border-bottom: 1px solid var(--line);
	font: 11px var(--font-mono);
	color: var(--muted);
	letter-spacing: .1em;
}
.docs-row {
	align-items: center;
	padding: 14px 20px;
	border-bottom: 1px solid var(--line-2);
	cursor: pointer;
}
.docs.is-dense .docs-row { padding: 8px 20px; }
.docs-row:hover { background: #fff; }
.docs-row__text { display: flex; flex-direction: column; min-width: 0; }
.docs-row__title { font-weight: 500; text-wrap: pretty; }
.docs-row__cat { font-size: 12px; color: var(--muted); }
.docs-row__models { font: 12px var(--font-mono); color: var(--text-2); overflow-wrap: anywhere; }
.docs-row__rev { font: 12px var(--font-mono); color: var(--text-2); }
.docs-row__fmt {
	font: 600 11px var(--font-mono);
	background: var(--navy);
	color: #fff;
	padding: 5px 9px;
	border-radius: 2px;
	justify-self: end;
	white-space: nowrap;
}
.docs-row__fmt:hover { color: #fff; }
.docs-row__fmt:not(.docs-row__fmt--off):hover { background: var(--orange-hover); }

.docs__empty {
	padding: 28px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-start;
}
.docs__empty-title { font: 600 20px/1.1 var(--font-display); text-transform: uppercase; }
.docs__empty-body { font-size: 13px; color: var(--text-2); text-wrap: pretty; }
.docs__empty-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.docs__empty-clear {
	padding: 8px 14px;
	background: var(--navy);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	border-radius: 2px;
}
.docs__empty-clear:hover { background: var(--orange-hover); color: #fff; }
.docs__empty-ask {
	padding: 8px 14px;
	border: 1.5px solid var(--navy);
	font-size: 13px;
	font-weight: 600;
	border-radius: 2px;
	color: var(--ink);
}
.docs__empty-ask:hover { background: var(--navy); color: #fff; }

.docs__count { padding: 14px 20px; font-size: 12px; color: var(--muted); }

/* Mobile (≤ 899px): iOS Safari zooms the page when a focused control is under 16px. */
@media (max-width: 899.98px) {
	.docs__search-input { font-size: 16px; }
}

/* ---------------------------------------------------------------------------
 * Mobile (designed from the desktop language — no phone reference)
 * ------------------------------------------------------------------------ */
@media (max-width: 899.98px) {
	.docs__cat { min-height: 44px; align-items: center; }
	.docs__intro-link { display: inline-block; padding: 13px 0; margin: -13px 0; }
	.docs__printed-btn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
	/* The PDF badge is the row's only link: a 44px target, not a 15px chip. */
	.docs-row__fmt { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; }
}
/* Below 600px the 520px four-column row would scroll sideways with the badge off-screen: each document
   becomes a card — title + category with the badge at the right, models and revision underneath. The
   column head stays in the DOM for assistive tech. */
@media (max-width: 599.98px) {
	.docs__table { min-width: 0; }
	.docs__head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
	.docs-row {
		grid-template-columns: minmax(0, 1fr) max-content;
		grid-template-areas: "text fmt" "models rev";
		gap: 8px 12px;
		padding: 14px 16px;
		align-items: start;
	}
	.docs-row__text { grid-area: text; }
	.docs-row__models { grid-area: models; }
	.docs-row__rev { grid-area: rev; text-align: right; }
	.docs-row__fmt { grid-area: fmt; }
}
