/* aptcloud Pay developer docs (/developers/). Uses the aptcloud theme's tokens. */
.aptpay-docs {
	--dx-code-bg: #0e1a2b;
	--dx-code-fg: #dfe8f3;
	--dx-code-tab: #9fb0c6;
	--dx-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dx-hero__kicker { margin: 0 0 .6rem; color: var(--c-primary); font-weight: 600; }
.dx-hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }
.dx-hero__actions .btn--ghost { border-color: var(--c-border); color: var(--c-text); background: var(--c-surface); }
.dx-hero__actions .btn--ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }

.dx-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-top: 2.5rem; padding-bottom: 5rem; }
@media (min-width: 1000px) {
	.dx-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 3.5rem; }
}

/* table of contents */
.dx-toc { font-size: .95rem; }
.dx-toc__title { margin: 0 0 .6rem; color: var(--c-muted); font-size: .85rem; font-weight: 600; }
.dx-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--c-border); }
.dx-toc a { display: block; margin-left: -2px; padding: .32rem 0 .32rem .9rem; border-left: 2px solid transparent; color: var(--c-muted); text-decoration: none; }
.dx-toc a:hover { color: var(--c-text); }
.dx-toc a[aria-current="true"] { border-left-color: var(--c-primary); color: var(--c-primary); font-weight: 600; }
@media (min-width: 1000px) {
	.dx-toc { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 96px); align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
}
@media (max-width: 999px) {
	.dx-toc ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; border: 0; }
	.dx-toc a { margin: 0; padding: .3rem .7rem; border: 1px solid var(--c-border); border-radius: 999px; font-size: .88rem; }
	.dx-toc a[aria-current="true"] { border-color: var(--c-primary); }
}

/* body copy */
.dx-body { min-width: 0; max-width: 820px; }
.dx-body section { scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 96px); padding-bottom: 1rem; }
.dx-body section + section { margin-top: 2.5rem; padding-top: 2.5rem; border-top: 1px solid var(--c-border); }
.dx-body h2 { margin: 0 0 1rem; font-size: clamp(1.6rem, 3vw, 2rem); }
.dx-body h3 { margin: 2rem 0 .7rem; font-size: 1.2rem; scroll-margin-top: 96px; }
.dx-body p, .dx-body li { line-height: 1.7; }
.dx-body p { margin: 0 0 1rem; }
.dx-body ul, .dx-body ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.dx-body li + li { margin-top: .35rem; }
.dx-body :not(pre) > code {
	padding: .1em .38em; border-radius: 6px; background: var(--c-bg-soft); border: 1px solid var(--c-border);
	font-family: var(--dx-mono); font-size: .86em; overflow-wrap: anywhere;
}
.dx-body a { color: var(--c-primary); }

.dx-steps { counter-reset: dx; list-style: none; padding: 0 !important; display: grid; gap: .75rem; }
.dx-steps li { counter-increment: dx; position: relative; margin: 0 !important; padding: .9rem 1rem .9rem 3.2rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); }
.dx-steps li::before {
	content: counter(dx); position: absolute; left: 1rem; top: .95rem; display: grid; place-items: center;
	width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; font-size: .85rem;
}

.dx-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem 1.5rem; margin: 1.5rem 0 0; }
.dx-facts dt { color: var(--c-muted); font-size: .85rem; }
.dx-facts dd { margin: .2rem 0 0; overflow-wrap: anywhere; }

.dx-table { width: 100%; margin: .5rem 0 1.25rem; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.dx-table th, .dx-table td { padding: .65rem .8rem; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
.dx-table thead th { color: var(--c-muted); font-size: .85rem; font-weight: 600; border-bottom-width: 2px; }
.dx-table td:first-child { white-space: nowrap; }
.dx-table tr:target td { background: var(--c-warn-soft); }
.dx-table em { color: var(--c-muted); font-size: .85em; font-style: normal; }

.dx-flow { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; color: var(--c-muted); }
.dx-pill { padding: .2rem .7rem; border-radius: 999px; background: var(--c-primary-soft); color: var(--c-primary); font-family: var(--dx-mono); font-size: .85rem; }
.dx-pill--ok { background: var(--c-ok-soft); color: var(--c-ok); }
.dx-pill--warn { background: var(--c-warn-soft); color: #a8700f; }

.dx-checklist { list-style: none; padding: 0 !important; }
.dx-checklist li { position: relative; padding-left: 1.8rem; }
.dx-checklist li::before {
	content: ""; position: absolute; left: 0; top: .35em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
	background: var(--c-ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233f8a5a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 70% no-repeat;
}

/* code blocks with language tabs */
.dx-code { margin: .75rem 0 1.5rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--dx-code-bg); color: var(--dx-code-fg); overflow: hidden; box-shadow: var(--shadow-sm); }
.dx-code__tabs { display: flex; gap: .25rem; padding: .4rem .5rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); overflow-x: auto; }
.dx-code__tabs button {
	flex: none; padding: .45rem .8rem; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dx-code-tab);
	font: 500 .85rem var(--font); cursor: pointer;
}
.dx-code__tabs button:hover { color: #fff; }
.dx-code__tabs button[aria-selected="true"] { color: #fff; border-bottom-color: #6fa8e6; }
.dx-code__tabs button:focus-visible, .dx-copy:focus-visible { outline: 2px solid #6fa8e6; outline-offset: -2px; }
.dx-code__panel { position: relative; }
.dx-code__panel[hidden] { display: none; }
.dx-code pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-family: var(--dx-mono); font-size: .84rem; line-height: 1.65; tab-size: 4; }
.dx-code code { font-family: inherit; white-space: pre; }
.dx-copy {
	position: absolute; top: .5rem; right: .5rem; padding: .3rem .6rem; border: 1px solid rgba(255, 255, 255, .15); border-radius: 6px;
	background: rgba(14, 26, 43, .85); color: var(--dx-code-tab); font: 500 .78rem var(--font); cursor: pointer; opacity: 0; transition: opacity .15s;
}
.dx-code__panel:hover .dx-copy, .dx-copy:focus-visible, .dx-copy.is-done { opacity: 1; }
.dx-copy.is-done { color: #7cc08f; border-color: #7cc08f; }
@media (hover: none) { .dx-copy { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
	.dx-copy { transition: none; }
}
