/* Shared mobile foundations for Goldy public and documentation pages. */

:root {
    --mobile-touch-target: 44px;
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--whitelabel-primary, #DBA212) 45%, transparent);
    outline-offset: 2px;
}

.responsive-table {
    width: 100%;
    max-width: 100%;
    margin: 1rem 0 1.5rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.responsive-table > table {
    min-width: 100%;
    margin: 0 !important;
}

.docs-container {
    min-width: 0;
    overflow-wrap: anywhere;
}

.docs-container pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre;
    -webkit-overflow-scrolling: touch;
}

.docs-container code:not(pre code) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.docs-container .toc a {
    min-height: var(--mobile-touch-target);
    display: flex !important;
    align-items: center;
}

.responsive-toc > summary {
    min-height: var(--mobile-touch-target);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.responsive-toc > summary::-webkit-details-marker {
    display: none;
}

.responsive-toc > summary::after {
    content: "+";
    font-size: 1.35rem;
    line-height: 1;
}

.responsive-toc[open] > summary::after {
    content: "\2212";
}

@media (max-width: 900px) {
    button,
    .btn,
    [role="button"] {
        min-width: var(--mobile-touch-target);
        min-height: var(--mobile-touch-target);
    }

    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    html,
    body {
        max-width: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .docs-container {
        width: 100%;
        max-width: 100%;
        padding: 28px 16px 56px !important;
    }

    .docs-container h1 {
        font-size: clamp(1.65rem, 8vw, 2rem) !important;
        line-height: 1.18;
    }

    .docs-container h2 {
        margin-top: 2rem !important;
        font-size: 1.3rem !important;
    }

    .docs-container .docs-subtitle {
        margin-bottom: 1.5rem !important;
        font-size: 1rem !important;
    }

    .docs-container .callout,
    .docs-container .flow-box,
    .docs-container .toc {
        max-width: 100%;
        padding: 14px 16px !important;
    }

    .docs-container table {
        min-width: 640px;
    }

    .docs-container th,
    .docs-container td {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .responsive-toc:not([open]) {
        margin-bottom: 1.5rem !important;
    }

    #cookie-consent { padding: 12px 16px !important; }
    #cookie-consent > div { gap: 10px !important; }
    #cookie-consent p { min-width: 0 !important; font-size: 14px; }
    #cookie-consent button { min-height: var(--mobile-touch-target); }
    #cookie-consent > div > div { width: 100%; flex-wrap: wrap; }
    #cookie-consent > div > div button { flex: 1 1 120px; padding-inline: 12px !important; }
}
