/* Documentation pages (pages/documentation.php). The page itself uses Tailwind; this file styles the guide text that
   includes/Docs/DocsMarkdown.php renders (.docs-body), the search results (assets/js/public-website/docs.js) and the
   "On this page" highlight. */

.docs-body {
    color: #334155;
    font-size: 17px;
    line-height: 1.65;
}

.docs-body > * + *,
.docs-body li > * + *,
.docs-body .docs-callout > * + * {
    margin-top: 1.25rem;
}

.docs-body h2,
.docs-body h3,
.docs-body h4 {
    color: #0f172a;
    scroll-margin-top: 7rem;
}

.docs-body h2 {
    margin-top: 3rem;
    font-size: 1.625rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.docs-body h3 {
    margin-top: 2.25rem;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
}

.docs-body h4 {
    margin-top: 1.75rem;
    font-size: 1.0625rem;
    font-weight: 700;
}

.docs-body > :first-child {
    margin-top: 0;
}

.docs-body a {
    color: #4338ca;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.docs-body a:hover {
    color: #3730a3;
}

.docs-body strong,
.docs-body b {
    font-weight: 700;
    color: #0f172a;
}

/* A button or field name from the editor ({editor::...}). */
.docs-body .docs-ui {
    font-weight: 700;
    color: #0f172a;
}

.docs-body a .docs-ui {
    color: inherit;
}

.docs-body ul {
    list-style: disc;
    padding-left: 1.4rem;
}

.docs-body ul > li + li {
    margin-top: 0.5rem;
}

.docs-body ul > li::marker {
    color: #94a3b8;
}

/* Numbered lists are steps: a number in a circle, the step's text and screenshots next to it. */
.docs-body ol.docs-steps {
    list-style: none;
    padding: 0;
    counter-reset: docs-step;
}

.docs-body ol.docs-steps > li {
    position: relative;
    min-height: 1.875rem;
    padding-left: 2.875rem;
    counter-increment: docs-step;
}

.docs-body ol.docs-steps > li + li {
    margin-top: 1.75rem;
}

.docs-body ol.docs-steps > li::before {
    content: counter(docs-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 9999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.875rem;
    text-align: center;
}

.docs-body li ol.docs-steps {
    list-style: decimal;
    padding-left: 1.4rem;
}

.docs-body li ol.docs-steps > li {
    padding-left: 0;
}

.docs-body li ol.docs-steps > li::before {
    content: none;
}

.docs-body li > ul,
.docs-body li > ol {
    margin-top: 0.75rem;
}

.docs-body figure.docs-shot {
    margin: 1.25rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.docs-body figure.docs-shot img {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.docs-body figure.docs-shot .docs-shot__zoom {
    position: relative;
    display: block;
    align-self: flex-start;
    max-width: 100%;
    border-radius: 0.75rem;
    cursor: zoom-in;
}

.docs-body figure.docs-shot .docs-shot__zoom:focus-visible {
    outline: 3px solid #4f46e5;
    outline-offset: 3px;
}

/* The enlarged screenshot (docs.js). */
html.docs-zoom-open {
    overflow: hidden;
}

.docs-zoom {
    width: 100vw;
    max-width: 100vw;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
}

.docs-zoom::backdrop {
    background: rgba(15, 23, 42, 0.92);
}

.docs-zoom__frame {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.docs-zoom__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
}

.docs-zoom__text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.docs-zoom__hint {
    display: block;
    color: #cbd5e1;
    font-size: 0.75rem;
}

.docs-zoom__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    cursor: pointer;
}

.docs-zoom__close:hover,
.docs-zoom__close:focus-visible {
    background: rgba(255, 255, 255, 0.26);
}

.docs-zoom__stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 1rem 1rem;
}

.docs-zoom__image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 0.5rem;
    background: #ffffff;
    cursor: zoom-in;
}

.docs-zoom__stage.is-full {
    display: block;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.docs-zoom__stage.is-full .docs-zoom__image {
    max-width: none;
    max-height: none;
    margin: 0 auto;
    cursor: zoom-out;
}

.docs-body figure.docs-shot figcaption {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #64748b;
}

.docs-body img {
    max-width: 100%;
    height: auto;
}

/* > [!NOTE], [!TIP], [!WARNING], [!BEFORE] */
.docs-body .docs-callout {
    position: relative;
    padding: 1rem 1.125rem 1rem 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    background: #f8fafc;
    color: #334155;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.docs-body .docs-callout::before {
    content: "";
    position: absolute;
    left: 1.125rem;
    top: 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    background-color: currentColor;
    -webkit-mask: var(--docs-callout-icon) center / contain no-repeat;
    mask: var(--docs-callout-icon) center / contain no-repeat;
    opacity: 0.85;
}

.docs-body .docs-callout strong,
.docs-body .docs-callout .docs-ui {
    color: inherit;
}

.docs-body .docs-callout a {
    color: inherit;
}

.docs-body .docs-callout--note {
    border-color: #c7d2fe;
    background: #eef2ff;
    color: #312e81;
    --docs-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
}

.docs-body .docs-callout--tip {
    border-color: #fde68a;
    background: #fffbeb;
    color: #78350f;
    --docs-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 3 14h9l-1 8 10-12h-9z'/%3E%3C/svg%3E");
}

.docs-body .docs-callout--warning {
    border-color: #fecaca;
    background: #fef2f2;
    color: #7f1d1d;
    --docs-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10.29 3.86-8.47 14.14A2 2 0 0 0 3.53 21h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E");
}

.docs-body .docs-callout--before {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #334155;
    --docs-callout-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E");
}

.docs-body code {
    padding: 0.1em 0.35em;
    border-radius: 0.375rem;
    background: #f1f5f9;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
}

.docs-body pre {
    overflow-x: auto;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.docs-body pre code {
    padding: 0;
    background: none;
    color: inherit;
}

/* A {group::key} code that has no label: only seen while writing, the check stops it before a release. */
.docs-body code.docs-missing {
    background: #fef2f2;
    color: #b91c1c;
}

.docs-body .docs-table {
    overflow-x: auto;
}

.docs-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.docs-body th,
.docs-body td {
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.docs-body th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
}

.docs-body hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
}

/* "On this page" */
.docs-toc-link.is-active {
    border-color: #4f46e5;
    color: #4338ca;
    font-weight: 600;
}

/* Search results */
.docs-search-group {
    padding: 0.625rem 0.75rem 0.375rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-search-option {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    color: #0f172a;
    text-decoration: none;
}

.docs-search-option:hover,
.docs-search-option--active {
    background: #eef2ff;
}

.docs-search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: #f1f5f9;
    color: #475569;
}

.docs-search-option--active .docs-search-icon {
    background: #ffffff;
    color: #4f46e5;
}

.docs-search-icon--plain {
    background: transparent;
}

.docs-search-text {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 0.125rem;
}

.docs-search-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.docs-search-summary {
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.5;
}

.docs-search-topic {
    align-self: center;
    flex-shrink: 0;
    color: #64748b;
    font-size: 0.8125rem;
}

@media (max-width: 639px) {
    .docs-search-topic {
        display: none;
    }
}

.docs-mark {
    padding: 0 0.125rem;
    border-radius: 0.1875rem;
    background: #fde68a;
    color: inherit;
}

#docs-search-input::-webkit-search-cancel-button {
    display: none;
}

details.docs-mobile-menu > summary::-webkit-details-marker,
details > summary.list-none::-webkit-details-marker {
    display: none;
}
