/* Shared styles of the demo pages. Light by default, dark via <html data-scheme="dark"> (set by demo.js). */

:root {
    color-scheme: light;
    --brand: #306f82;
    --brand-dark: #24566a;
    --brand-soft: #e3f1f4;
    --coral: #ff7a59;
    --coral-dark: #e9603f;
    --mint: #43c59e;
    --ink: #1d2b36;
    --muted: #5b6b78;
    --line: #e3e9ee;
    --bg: #fbfaf7;
    --card: #ffffff;
    --code-bg: #1d2b36;
    --topbar-bg: rgba(251, 250, 247, 0.85);
    --th-bg: #f6f9fa;
    --toast-bg: #1d2b36;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(29, 43, 54, 0.08);
    --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

:root[data-scheme="dark"] {
    color-scheme: dark;
    --brand: #6cc3d5;
    --brand-dark: #a5dde8;
    --brand-soft: #1f3a44;
    --ink: #e6edf3;
    --muted: #a3b3bf;
    --line: #2a3843;
    --bg: #111920;
    --card: #18232c;
    --code-bg: #0c1318;
    --topbar-bg: rgba(17, 25, 32, 0.85);
    --th-bg: #1d2a34;
    --toast-bg: #2a3843;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.75;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: var(--brand);
}

code {
    font-family: var(--mono);
    font-size: 0.88em;
    padding: 0.1em 0.4em;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- navigation --- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.topbar .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 24px;
    min-height: 64px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

.logo-mark {
    display: block;
    width: 34px;
    height: 34px;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin-left: auto;
}

.topbar nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.topbar nav a:hover,
.topbar nav a.active {
    color: var(--brand);
}

.topbar nav a.active {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* light / dark switch */
.scheme-switch {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
}

.scheme-switch button {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 6px 12px;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
    background: transparent;
}

.scheme-switch button[aria-pressed="true"] {
    color: #fff;
    background: var(--brand-dark);
}

:root[data-scheme="dark"] .scheme-switch button[aria-pressed="true"] {
    color: var(--bg);
}

/* --- intro --- */

.intro {
    padding: 64px 0 40px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--coral-dark);
    margin-bottom: 10px;
}

.intro h1 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin: 0 0 12px;
}

.intro p {
    max-width: 680px;
    margin: 0 0 20px;
    font-size: 1.1rem;
    color: var(--muted);
}

/* --- buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 10px 20px;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;
    background: var(--coral);
    box-shadow: 0 8px 20px rgba(255, 122, 89, 0.35);
}

.btn-primary:hover {
    background: var(--coral-dark);
}

.btn-secondary {
    color: var(--brand-dark);
    background: var(--card);
    border-color: var(--brand-soft);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* --- page content --- */

.content {
    margin-bottom: 40px;
    padding: 40px;
    border-radius: 22px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.content h2 {
    font-size: 1.5rem;
    margin: 0 0 16px;
}

.content p {
    margin: 0 0 24px;
    color: var(--muted);
}

.content p:last-child {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .content {
        padding: 24px;
    }
}


/* --- documentation inside the content cards --- */

.content h3 {
    font-size: 1.15rem;
    margin: 32px 0 10px;
}

.content ul {
    margin: 0 0 24px;
    padding-left: 22px;
    color: var(--muted);
}

.content li {
    margin-bottom: 6px;
}

.content .code {
    margin-bottom: 24px;
}

.content .code + .code {
    margin-top: 0;
}

.content > :last-child {
    margin-bottom: 0;
}

/* the heading above the inline embed */
.example-title {
    font-size: 1.5rem;
    margin: 0 0 16px;
}

/* the inline embed of the booking app */
.bookings {
    margin-bottom: 40px;
}

/* --- footer --- */

footer {
    padding: 36px 0;
    font-size: 0.9rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

/* --- code blocks --- */

.code {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--code-bg);
    box-shadow: var(--shadow);
}

.code + .code {
    margin-top: 16px;
}

.code-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 8px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9fb3c2;
    background: rgba(255, 255, 255, 0.05);
}

.copy {
    font: inherit;
    font-size: 0.8rem;
    letter-spacing: 0;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transition: background-color 0.15s ease;
}

.copy:hover {
    background: rgba(255, 255, 255, 0.22);
}

.copy.copied {
    background: var(--mint);
}

.code pre {
    margin: 0;
    padding: 18px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.86rem;
    line-height: 1.6;
    color: #e6edf3;
    tab-size: 2;
}

.code pre code {
    font-size: inherit;
    padding: 0;
    border-radius: 0;
    background: none;
    color: inherit;
}

.tok-com {
    color: #7f95a6;
    font-style: italic;
}

.tok-str {
    color: #ffd479;
}

.tok-tag {
    color: #ff9e80;
}

.tok-kw {
    color: #8fd3ff;
}

.tok-num {
    color: #b9a8ff;
}

.tok-hl {
    color: #7ee2b8;
    font-weight: 700;
}


/* --- reference --- */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

th, td {
    text-align: left;
    vertical-align: top;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    background: var(--th-bg);
}

tr:last-child td {
    border-bottom: 0;
}

td:first-child code {
    white-space: nowrap;
    font-weight: 700;
}

td.type {
    white-space: nowrap;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.85rem;
}

.required {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    color: #b8432a;
    background: #ffe8e1;
}


/* --- faq --- */

.faq {
    display: grid;
    gap: 14px;
    max-width: 860px;
}

details {
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    padding: 0 22px;
}

details[open] {
    box-shadow: var(--shadow);
}

summary {
    cursor: pointer;
    font-weight: 700;
    padding: 18px 0;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 1.4rem;
    line-height: 1;
    color: var(--coral);
    transition: transform 0.2s ease;
}

details[open] summary::after {
    transform: rotate(45deg);
}

details > div {
    padding-bottom: 20px;
    color: var(--muted);
}

details > div p {
    margin: 0 0 12px;
}


.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 200;
    max-width: calc(100% - 40px);
    padding: 12px 20px;
    border-radius: 12px;
    color: #fff;
    background: var(--toast-bg);
    box-shadow: var(--shadow);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
