/**
 * FXNook Docs.
 *
 * Everything is scoped under .fxnd so nothing here can reach the theme.
 * Hubs and the docs home are dark branded panels; articles use a light
 * reading column under a dark header, because long text on black tires
 * the eyes.
 */

.fxnd {
	--fxnd-accent: var(--fxn-green, #9DCC4C);
	--fxnd-accent-ink: var(--fxn-ink, #231F20);
	--fxnd-panel: #1C1819;
	--fxnd-card: #2B2627;
	--fxnd-card-hover: #332E2F;
	--fxnd-line: #3A3536;
	--fxnd-text: var(--fxn-line, #E7E5E2);
	--fxnd-muted: var(--fxn-subtle, #9A9596);
	--fxnd-page: var(--fxn-surface, #F7F7F4);
	--fxnd-ink: var(--fxn-ink, #231F20);
	--fxnd-body: var(--fxn-text, #4A4546);
	--fxnd-soft: var(--fxn-muted, #6B6667);
	--fxnd-rule: var(--fxn-line, #E7E5E2);
	--fxnd-radius: 20px;

	box-sizing: border-box;
	font-size: 16px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
.fxnd *, .fxnd *::before, .fxnd *::after { box-sizing: border-box; }

/* The wrapper our own templates use. Works inside the theme's flex rows. */
.fxnd-page {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	padding: 28px 0 56px;
}

/* ---------------------------------------------------------------- panel */

.fxnd-panel {
	background: var(--fxnd-panel);
	color: var(--fxnd-text);
	border-radius: var(--fxnd-radius);
	padding: 44px 44px 30px;
	box-shadow: 0 24px 60px rgba(13, 15, 17, .18);
	position: relative;
	overflow: hidden;
}
.fxnd-panel::before {
	content: "";
	position: absolute;
	inset: -40% -10% auto auto;
	width: 520px;
	height: 520px;
	background: radial-gradient(closest-side, rgba(157, 204, 76, .10), transparent 70%);
	pointer-events: none;
}
.fxnd-panel > * { position: relative; }

.fxnd-crumbs {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
	margin: 0 0 18px; font-size: 13px; color: var(--fxnd-muted);
}
.fxnd-crumbs a { color: var(--fxnd-muted) !important; text-decoration: none; }
.fxnd-crumbs a:hover { color: var(--fxnd-accent) !important; }
.fxnd-crumbs span:last-child { color: var(--fxnd-text); }

.fxnd-badge {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 7px 16px; border-radius: 999px;
	background: rgba(157, 204, 76, .12); border: 1px solid rgba(157, 204, 76, .22);
	color: var(--fxnd-accent); font-size: 13.5px; font-weight: 700; letter-spacing: .2px;
}
.fxnd-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fxnd-accent); box-shadow: 0 0 0 4px rgba(157, 204, 76, .18); }

.fxnd .fxnd-h1 {
	margin: 18px 0 12px !important; padding: 0 !important;
	font-size: clamp(28px, 3.4vw, 40px) !important; line-height: 1.15 !important;
	font-weight: 700 !important; letter-spacing: -.5px; color: #fff !important;
	text-transform: none !important;
}
.fxnd-lead { margin: 0; max-width: 820px; font-size: 17px; line-height: 1.7; color: var(--fxn-line-strong, #D5D2CE); }

/* ---------------------------------------------------------------- search */

.fxnd-search {
	display: flex; align-items: center; gap: 10px;
	max-width: 560px; margin: 26px 0 0; padding: 0 16px;
	background: #fff; border-radius: 12px; color: var(--fxnd-soft);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .25);
}
.fxnd-search input {
	flex: 1 1 auto; min-width: 0; height: 50px !important; margin: 0 !important; padding: 0 !important;
	border: 0 !important; background: transparent !important; box-shadow: none !important;
	font-size: 15.5px !important; color: var(--fxnd-ink) !important; outline: none;
}
.fxnd-search:focus-within { box-shadow: 0 0 0 3px rgba(157, 204, 76, .45), 0 8px 24px rgba(0, 0, 0, .25); }

/* ---------------------------------------------------------------- cards */

.fxnd-results { margin-top: 34px; }
.fxnd-grid {
	display: grid; gap: 20px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fxnd-card {
	display: flex; flex-direction: column; gap: 10px;
	padding: 26px 26px 24px; border-radius: 14px;
	background: var(--fxnd-card); border: 1px solid var(--fxnd-line);
	color: var(--fxnd-text) !important; text-decoration: none !important;
	transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.fxnd-card:hover, .fxnd-card:focus-visible {
	transform: translateY(-2px); background: var(--fxnd-card-hover);
	border-color: rgba(157, 204, 76, .35); box-shadow: 0 14px 30px rgba(0, 0, 0, .35); outline: none;
}
.fxnd-card[hidden] { display: none; }
.fxnd-card__title { font-size: 19px; font-weight: 600; line-height: 1.3; color: #fff; }
.fxnd-card__text { font-size: 15px; line-height: 1.65; color: var(--fxnd-muted); flex: 1 1 auto; }
.fxnd-card__link { margin-top: 6px; font-size: 15px; font-weight: 700; color: var(--fxnd-accent); }
.fxnd-arrow { display: inline-block; transition: transform .15s ease; }
.fxnd-card:hover .fxnd-arrow, .fxnd-btn:hover .fxnd-arrow { transform: translateX(3px); }

.fxnd-none, .fxnd-empty { margin: 18px 0 0; color: var(--fxnd-muted); }

/* ---------------------------------------------------------------- sections */

.fxnd-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.fxnd-jump a {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
	background: var(--fxnd-card); border: 1px solid var(--fxnd-line); color: var(--fxnd-text) !important;
	font-size: 14px; font-weight: 600; text-decoration: none !important;
}
.fxnd-jump a span { color: var(--fxnd-muted); font-weight: 500; }
.fxnd-jump a:hover { border-color: rgba(157, 204, 76, .45); color: var(--fxnd-accent) !important; }
.fxnd-jump[hidden] { display: none; }

.fxnd-group { scroll-margin-top: 110px; }
.fxnd-group + .fxnd-group { margin-top: 38px; }
.fxnd-group[hidden] { display: none; }
.fxnd .fxnd-group__title {
	display: flex; align-items: center; gap: 12px;
	margin: 0 0 16px !important; padding: 0 !important;
	font-size: 14px !important; font-weight: 700 !important; letter-spacing: 1.2px; text-transform: uppercase !important;
	color: var(--fxnd-accent) !important; line-height: 1.3 !important;
}
.fxnd .fxnd-group__title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--fxnd-line); }

/* ---------------------------------------------------------------- docs home hubs */

.fxnd-hubs { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 34px; }
.fxnd-hubs[hidden] { display: none; }
.fxnd-hubcard {
	display: flex; flex-direction: column; gap: 14px;
	padding: 28px; border-radius: 16px; background: var(--fxnd-card); border: 1px solid var(--fxnd-line);
}
.fxnd-hubcard__head { display: flex; align-items: center; gap: 14px; }
.fxnd-hubcard__icon {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 46px; height: 46px;
	border-radius: 12px; background: rgba(157, 204, 76, .12); color: var(--fxnd-accent);
}
.fxnd-hubcard__icon .fxnd-ico { width: 22px; height: 22px; }
.fxnd .fxnd-hubcard h2 { margin: 0 !important; font-size: 21px !important; font-weight: 600 !important; color: #fff !important; line-height: 1.25 !important; }
.fxnd-hubcard__head p { margin: 2px 0 0; font-size: 13.5px; color: var(--fxnd-muted); }
.fxnd-hubcard__text { margin: 0; color: var(--fxnd-muted); font-size: 15px; }
.fxnd-hubcard__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fxnd-line); }
.fxnd-hubcard__list li { margin: 0; padding: 0; border-bottom: 1px solid var(--fxnd-line); }
.fxnd-hubcard__list a { display: block; padding: 11px 2px; color: var(--fxnd-text) !important; text-decoration: none; font-size: 15px; }
.fxnd-hubcard__list a:hover { color: var(--fxnd-accent) !important; }
.fxnd-hubcard .fxnd-btn { align-self: flex-start; margin-top: 4px; }

/* ---------------------------------------------------------------- buttons */

.fxnd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 14px 26px; border-radius: 12px; border: 0;
	background: var(--fxnd-accent); color: var(--fxnd-accent-ink) !important;
	font-size: 16px; font-weight: 700; line-height: 1.2; text-decoration: none !important; white-space: nowrap;
	box-shadow: 0 8px 22px rgba(157, 204, 76, .25); transition: transform .15s ease, filter .15s ease;
}
.fxnd-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.fxnd-btn--ghost { background: transparent; color: var(--fxnd-accent) !important; box-shadow: none; border: 1px solid rgba(157, 204, 76, .35); padding: 11px 18px; font-size: 14.5px; }
.fxnd-btn--ghost:hover { background: rgba(157, 204, 76, .08); }

/* ---------------------------------------------------------------- help strip */

.fxnd-help {
	display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
	margin-top: 40px; padding: 28px 30px; border-radius: 16px;
	background: linear-gradient(180deg, rgba(157, 204, 76, .05), rgba(157, 204, 76, 0)), var(--fxnd-panel);
	border: 1px solid var(--fxnd-line);
}
.fxnd-help__text strong { display: block; font-size: 21px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.fxnd-help__text span { color: var(--fxnd-muted); font-size: 15.5px; }

.fxnd-foot {
	display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--fxnd-line);
	font-size: 14px; color: var(--fxnd-muted);
}

/* ---------------------------------------------------------------- article */

.fxnd-article__hero { padding-bottom: 34px; }
.fxnd-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; font-size: 13.5px; color: var(--fxnd-muted); }
.fxnd-meta .fxnd-ico { width: 16px; height: 16px; }

.fxnd-article__layout {
	display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: start;
	margin-top: 34px;
}
.fxnd-article__layout--single { grid-template-columns: minmax(0, 1fr); max-width: 860px; }

.fxnd-toc { position: sticky; top: 110px; }
.fxnd-toc__title { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--fxnd-soft); }
.fxnd-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--fxnd-rule); }
.fxnd-toc li { margin: 0; }
.fxnd-toc a {
	display: block; margin-left: -2px; padding: 7px 0 7px 14px; border-left: 2px solid transparent;
	color: var(--fxnd-soft) !important; font-size: 14px; line-height: 1.45; text-decoration: none;
}
.fxnd-toc a:hover { color: var(--fxnd-ink) !important; }
.fxnd-toc a.is-active { color: var(--fxnd-ink) !important; border-left-color: var(--fxnd-accent); font-weight: 600; }

.fxnd-article__main { min-width: 0; }

.fxnd-content {
	background: #fff; border: 1px solid var(--fxnd-rule); border-radius: 16px;
	padding: 40px 44px; color: var(--fxnd-body); font-size: 16.5px; line-height: 1.75;
	box-shadow: 0 1px 2px rgba(17, 20, 24, .04);
}
.fxnd-content > :first-child { margin-top: 0 !important; }
.fxnd-content > :last-child { margin-bottom: 0 !important; }
.fxnd-content p, .fxnd-content ul, .fxnd-content ol, .fxnd-content table, .fxnd-content pre, .fxnd-content details { margin: 0 0 20px; }
.fxnd .fxnd-content h2 {
	margin: 40px 0 14px !important; padding-top: 28px !important; border-top: 1px solid var(--fxnd-rule);
	font-size: 24px !important; font-weight: 700 !important; line-height: 1.3 !important; color: var(--fxnd-ink) !important;
	scroll-margin-top: 110px; text-transform: none !important;
}
.fxnd .fxnd-content > h2:first-child { border-top: 0; padding-top: 0 !important; }
.fxnd .fxnd-content h3 { margin: 28px 0 10px !important; font-size: 19px !important; font-weight: 700 !important; color: var(--fxnd-ink) !important; }
.fxnd-content strong { color: var(--fxnd-ink); }
.fxnd-content a { color: var(--fxn-green-deep, #4A7515); text-decoration: underline; text-underline-offset: 2px; }
.fxnd-content a:hover { color: var(--fxn-green-deeper, #3A5C10); }
.fxnd-content ul { padding-left: 22px; }
.fxnd-content ul li { margin: 0 0 8px; }
.fxnd-content ul li::marker { color: var(--fxn-green-deep, #4A7515); }

/* Numbered lists are steps. */
.fxnd-content ol { list-style: none; counter-reset: fxnd-step; padding: 0; }
.fxnd-content ol > li {
	counter-increment: fxnd-step; position: relative;
	margin: 0; padding: 4px 0 16px 50px; min-height: 36px;
}
.fxnd-content ol > li::before {
	content: counter(fxnd-step);
	position: absolute; left: 0; top: 0;
	width: 32px; height: 32px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: var(--fxnd-panel); color: var(--fxnd-accent);
	font-size: 14px; font-weight: 700; line-height: 1;
}
.fxnd-content ol > li::after {
	content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--fxnd-rule);
}
.fxnd-content ol > li:last-child::after { display: none; }

.fxnd-content code {
	padding: 2px 7px; border-radius: 6px; background: var(--fxn-surface, #F7F7F4); color: var(--fxn-ink, #231F20);
	font-family: Consolas, Monaco, "Courier New", monospace; font-size: .88em; word-break: break-word;
}
.fxnd-content pre {
	position: relative; padding: 18px 20px; border-radius: 12px; overflow-x: auto;
	background: var(--fxnd-panel); color: var(--fxnd-text); border: 1px solid var(--fxnd-line);
	font-size: 14px; line-height: 1.6;
}
.fxnd-content pre code { padding: 0; background: none; color: inherit; font-size: inherit; white-space: pre; word-break: normal; }
.fxnd-copy {
	position: absolute; top: 10px; right: 10px;
	padding: 5px 11px; border-radius: 8px; border: 1px solid #2c3136; background: #2B2627; color: var(--fxnd-text);
	font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.3; min-height: 0; text-transform: none; letter-spacing: 0;
}
.fxnd-copy:hover { border-color: var(--fxnd-accent); color: var(--fxn-green-deep, #4A7515); }
.fxnd-copy.is-done { background: var(--fxnd-accent); border-color: var(--fxnd-accent); color: var(--fxnd-accent-ink); }

.fxnd-content table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--fxnd-rule); border-radius: 12px; overflow: hidden; font-size: 15px; display: table; }
.fxnd-content th, .fxnd-content td { padding: 12px 16px; text-align: left; vertical-align: top; border: 0; border-bottom: 1px solid var(--fxnd-rule); }
.fxnd-content thead th { background: var(--fxn-surface, #F7F7F4); color: var(--fxnd-ink); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.fxnd-content tbody tr:last-child td { border-bottom: 0; }
.fxnd-content tbody tr:hover td { background: var(--fxn-surface, #F7F7F4); }

.fxnd-content details {
	border: 1px solid var(--fxnd-rule); border-radius: 12px; padding: 0; margin: 0 0 10px; background: #fff;
}
.fxnd-content details summary {
	cursor: pointer; list-style: none; padding: 15px 48px 15px 18px; position: relative;
	font-weight: 600; color: var(--fxnd-ink);
}
.fxnd-content details summary::-webkit-details-marker { display: none; }
.fxnd-content details summary::after {
	content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
	width: 24px; height: 24px; border-radius: 50%; background: var(--fxn-surface, #F7F7F4); color: var(--fxnd-ink);
	display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.fxnd-content details[open] summary::after { content: "\2212"; background: var(--fxnd-accent); }
.fxnd-content details > *:not(summary) { margin: 0; padding: 0 18px 16px; }

/* Notes: [fxnd_note type="..."] */
.fxnd-note {
	margin: 0 0 22px; padding: 16px 18px 16px 20px; border-radius: 12px;
	border: 1px solid; border-left-width: 4px; font-size: 15.5px;
}
.fxnd-note > :last-child { margin-bottom: 0 !important; }
.fxnd-note p { margin: 0 0 8px; }
.fxnd-note ul { margin: 6px 0 0; }
.fxnd-note__title { font-weight: 700; margin: 0 0 6px !important; }
.fxnd-note--info    { background: var(--fxn-surface-2, #EFEEEA); border-color: var(--fxn-line, #E7E5E2); border-left-color: var(--fxn-green-deep, #4A7515); }
.fxnd-note--tip     { background: var(--fxn-green-tint, #F2F8E6); border-color: var(--fxn-green-line, #D9EBBB); border-left-color: var(--fxn-green, #9DCC4C); }
.fxnd-note--warning { background: #fff8e8; border-color: #f6e2ae; border-left-color: #d99a0a; }
.fxnd-note--danger  { background: #fff1f1; border-color: #f7cfcf; border-left-color: #e5484d; }
.fxnd-note--info .fxnd-note__title    { color: var(--fxn-text, #4A4546); }
.fxnd-note--tip .fxnd-note__title     { color: var(--fxn-green-deep, #4A7515); }
.fxnd-note--warning .fxnd-note__title { color: #8a5a00; }
.fxnd-note--danger .fxnd-note__title  { color: #b42318; }

/* ---------------------------------------------------------------- vote, pager */

.fxnd-vote {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	margin-top: 20px; padding: 18px 22px; border-radius: 14px; background: #fff; border: 1px solid var(--fxnd-rule);
	color: var(--fxnd-body);
}
.fxnd-vote__q { font-weight: 600; color: var(--fxnd-ink); margin-right: 6px; }
.fxnd-vote button {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 8px 16px; border-radius: 10px; border: 1px solid var(--fxn-line-strong, #D5D2CE); background: #fff; color: var(--fxnd-ink);
	font-size: 14px; font-weight: 600; cursor: pointer; line-height: 1.2; min-height: 0; text-transform: none; letter-spacing: 0;
}
.fxnd-vote button:hover { border-color: var(--fxnd-accent); background: var(--fxn-green-tint, #F2F8E6); }
.fxnd-vote .fxnd-ico { width: 16px; height: 16px; }
.fxnd-vote__thanks { color: var(--fxn-green-deep, #4A7515); font-weight: 600; }
.fxnd-vote.is-done button { display: none; }

.fxnd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.fxnd-pager a {
	display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; border-radius: 14px;
	background: #fff; border: 1px solid var(--fxnd-rule); text-decoration: none !important;
	transition: border-color .15s ease, transform .15s ease;
}
.fxnd-pager a:hover { border-color: var(--fxnd-accent); transform: translateY(-1px); }
.fxnd-pager small { font-size: 12.5px; font-weight: 700; color: var(--fxnd-soft); text-transform: uppercase; letter-spacing: .5px; }
.fxnd-pager span { font-size: 16px; font-weight: 600; color: var(--fxnd-ink); }
.fxnd-pager__next { text-align: right; grid-column: 2; }

.fxnd-dark-help .fxnd-help { margin-top: 20px; }

/* ---------------------------------------------------------------- focus */

.fxnd a:focus-visible, .fxnd button:focus-visible, .fxnd summary:focus-visible {
	outline: 3px solid var(--fxnd-accent); outline-offset: 2px; border-radius: 8px;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
	.fxnd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.fxnd-article__layout { grid-template-columns: minmax(0, 1fr); }
	.fxnd-toc { position: static; background: #fff; border: 1px solid var(--fxnd-rule); border-radius: 14px; padding: 16px 18px; }
}

@media (max-width: 680px) {
	.fxnd-page { padding: 12px 0 36px; }
	.fxnd-panel { padding: 28px 20px 22px; border-radius: 16px; }
	.fxnd-lead { font-size: 16px; }
	.fxnd-grid, .fxnd-hubs { grid-template-columns: minmax(0, 1fr); gap: 14px; }
	.fxnd-card { padding: 20px; }
	.fxnd-content { padding: 26px 20px; font-size: 16px; border-radius: 14px; }
	.fxnd-content table { display: block; overflow-x: auto; }
	.fxnd-help { padding: 22px 20px; }
	.fxnd-help .fxnd-btn { width: 100%; }
	.fxnd-pager { grid-template-columns: minmax(0, 1fr); }
	.fxnd-pager__next { grid-column: 1; }
	.fxnd-foot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.fxnd * { transition: none !important; }
}

/* ---------------------------------------------------------------- print */

@media print {
	.fxnd-panel { background: #fff !important; color: #000 !important; box-shadow: none; padding: 0; }
	.fxnd-panel::before, .fxnd-search, .fxnd-toc, .fxnd-vote, .fxnd-pager, .fxnd-help, .fxnd-copy { display: none !important; }
	.fxnd .fxnd-h1, .fxnd-lead { color: #000 !important; }
	.fxnd-article__layout { display: block; margin: 0; }
	.fxnd-content { border: 0; padding: 0; box-shadow: none; }
	.fxnd-content pre { background: #f4f4f4; color: #000; border-color: #ccc; }
}
