/* ============================================================================
 * Public site (landing + docs) — composed from DS tokens, no hardcoded colors.
 * All selectors use the `.site-` prefix to avoid colliding with `.ds-*`.
 * ============================================================================ */

/* ---------- Layout shell --------------------------------------------------- */

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ds-bg-page);
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--ds-bg-surface);
    border-bottom: 1px solid var(--ds-border);
    height: var(--ds-topbar-h);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.site-nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ds-text);
    font-weight: var(--ds-fw-semibold);
}

.site-nav__brand-mark {
    width: 28px;
    height: 28px;
    border-radius: var(--ds-radius-sm);
    background: linear-gradient(135deg, var(--ds-brand-700), var(--ds-brand-500));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--ds-fw-bold);
    font-size: 13px;
}

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.site-nav__link {
    padding: 6px 12px;
    border-radius: var(--ds-radius-md);
    color: var(--ds-text-muted);
    text-decoration: none;
    font-size: var(--ds-fs-sm);
    font-weight: var(--ds-fw-medium);
}

.site-nav__link:hover {
    background: var(--ds-bg-hover);
    color: var(--ds-text);
}

.site-nav__link[aria-current="page"] {
    color: var(--ds-text);
    background: var(--ds-bg-muted);
}

.site-main {
    flex: 1;
}

.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px;
}

.site-container--narrow {
    max-width: 880px;
}

.site-footer {
    border-top: 1px solid var(--ds-border);
    background: var(--ds-bg-surface);
    padding: 24px;
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    text-align: center;
}

.site-footer__sep { margin: 0 6px; opacity: 0.6; }

.site-footer__link {
    color: var(--ds-text-muted);
    text-decoration: none;
}

.site-footer__link:hover { color: var(--ds-text); }

/* ---------- Hero ----------------------------------------------------------- */

.site-hero {
    padding: 72px 24px 56px;
    text-align: center;
}

.site-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-bg-muted);
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-xs);
    font-weight: var(--ds-fw-medium);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.site-hero__eyebrow svg { width: 14px; height: 14px; }

.site-hero__title {
    font-size: var(--ds-fs-3xl);
    line-height: var(--ds-lh-tight);
    font-weight: var(--ds-fw-bold);
    color: var(--ds-text);
    margin: 0 auto 16px;
    max-width: 720px;
}

.site-hero__subtitle {
    font-size: var(--ds-fs-md);
    color: var(--ds-text-muted);
    margin: 0 auto 32px;
    max-width: 600px;
    line-height: var(--ds-lh-base);
}

.site-hero__actions {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---------- Section header (shared by landing sections) ------------------ */

.site-section {
    padding: 48px 0;
}

.site-section__header {
    text-align: center;
    margin-bottom: 32px;
}

.site-section__eyebrow {
    color: var(--ds-brand-500);
    font-size: var(--ds-fs-xs);
    font-weight: var(--ds-fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.site-section__title {
    font-size: var(--ds-fs-2xl);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 0 0 8px;
}

.site-section__subtitle {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-md);
    margin: 0;
}

/* ---------- Flow (3 steps) ------------------------------------------------- */

.site-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.site-flow-step {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform var(--ds-dur-fast) var(--ds-ease),
                box-shadow var(--ds-dur-fast) var(--ds-ease),
                border-color var(--ds-dur-fast) var(--ds-ease);
}

.site-flow-step:hover {
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-md);
    border-color: var(--ds-brand-500);
    color: inherit;
    text-decoration: none;
}

.site-flow-step__index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ds-radius-pill);
    background: var(--ds-brand-700);
    color: white;
    font-weight: var(--ds-fw-bold);
    font-size: var(--ds-fs-sm);
}

.site-flow-step__icon {
    color: var(--ds-brand-500);
    width: 28px;
    height: 28px;
}

.site-flow-step__title {
    font-size: var(--ds-fs-md);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 0;
}

.site-flow-step__body {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    line-height: var(--ds-lh-base);
    margin: 0;
}

.site-flow-step__more {
    color: var(--ds-brand-500);
    font-size: var(--ds-fs-sm);
    font-weight: var(--ds-fw-medium);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

/* ---------- Category section ----------------------------------------------- */

.site-category {
    margin-bottom: 48px;
}

.site-category__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ds-border);
}

.site-category__icon {
    color: var(--ds-brand-500);
    width: 22px;
    height: 22px;
}

.site-category__title {
    font-size: var(--ds-fs-lg);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 0;
}

.site-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.site-feature-card {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    padding: 20px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform var(--ds-dur-fast) var(--ds-ease),
                box-shadow var(--ds-dur-fast) var(--ds-ease),
                border-color var(--ds-dur-fast) var(--ds-ease);
}

.site-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ds-shadow-md);
    border-color: var(--ds-brand-500);
    text-decoration: none;
    color: inherit;
}

.site-feature-card__icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-info-bg);
    color: var(--ds-brand-700);
}

.site-feature-card__icon-wrap svg { width: 22px; height: 22px; }

[data-bs-theme="dark"] .site-feature-card__icon-wrap {
    background: var(--ds-brand-700);
    color: white;
}

.site-feature-card__title {
    font-size: var(--ds-fs-md);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-feature-card__summary {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
    line-height: var(--ds-lh-base);
    margin: 0;
}

.site-feature-card__cta {
    color: var(--ds-brand-500);
    font-size: var(--ds-fs-sm);
    font-weight: var(--ds-fw-medium);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

/* ---------- Docs layout (sidebar + content) ------------------------------- */

.site-docs {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 64px;
    align-items: start;
}

.site-docs-sidebar {
    position: sticky;
    top: calc(var(--ds-topbar-h) + 24px);
    align-self: start;
    max-height: calc(100vh - var(--ds-topbar-h) - 48px);
    overflow-y: auto;
    padding-right: 8px;
}

.site-docs-sidebar__category {
    margin-bottom: 16px;
}

.site-docs-sidebar__category-title {
    font-size: var(--ds-fs-xs);
    font-weight: var(--ds-fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ds-text-muted);
    margin: 0 0 8px;
    padding: 0 10px;
}

.site-docs-sidebar__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--ds-radius-md);
    color: var(--ds-text);
    text-decoration: none;
    font-size: var(--ds-fs-sm);
}

.site-docs-sidebar__link:hover {
    background: var(--ds-bg-hover);
    color: var(--ds-text);
    text-decoration: none;
}

.site-docs-sidebar__link[aria-current="page"] {
    background: var(--ds-bg-muted);
    color: var(--ds-brand-700);
    font-weight: var(--ds-fw-medium);
}

[data-bs-theme="dark"] .site-docs-sidebar__link[aria-current="page"] {
    color: var(--ds-brand-300);
}

.site-docs-sidebar__link svg { width: 14px; height: 14px; color: var(--ds-text-muted); }

.site-docs-content {
    min-width: 0;
}

/* ---------- Doc detail page ------------------------------------------------ */

.site-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--ds-fs-sm);
    color: var(--ds-text-muted);
    margin-bottom: 24px;
}

.site-breadcrumb a {
    color: var(--ds-text-muted);
    text-decoration: none;
}

.site-breadcrumb a:hover { color: var(--ds-text); }

.site-breadcrumb__sep {
    color: var(--ds-text-muted);
    opacity: 0.5;
}

.site-doc-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ds-border);
}

.site-doc-header__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--ds-radius-lg);
    background: var(--ds-info-bg);
    color: var(--ds-brand-700);
    margin-bottom: 16px;
}

.site-doc-header__icon svg { width: 28px; height: 28px; }

[data-bs-theme="dark"] .site-doc-header__icon {
    background: var(--ds-brand-700);
    color: white;
}

.site-doc-header__title {
    font-size: var(--ds-fs-2xl);
    font-weight: var(--ds-fw-bold);
    color: var(--ds-text);
    margin: 0 0 8px;
}

.site-doc-header__summary {
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-md);
    line-height: var(--ds-lh-base);
    margin: 0 0 16px;
}

.site-doc-header__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- Markdown body styling ----------------------------------------- */

.site-doc-body {
    color: var(--ds-text);
    font-size: var(--ds-fs-md);
    line-height: var(--ds-lh-loose);
}

.site-doc-body h2 {
    font-size: var(--ds-fs-xl);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 32px 0 12px;
}

.site-doc-body h3 {
    font-size: var(--ds-fs-lg);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 24px 0 10px;
}

.site-doc-body p,
.site-doc-body ul,
.site-doc-body ol {
    margin: 0 0 16px;
}

.site-doc-body ul,
.site-doc-body ol {
    padding-left: 24px;
}

.site-doc-body li { margin-bottom: 4px; }

.site-doc-body code {
    background: var(--ds-bg-muted);
    padding: 1px 6px;
    border-radius: var(--ds-radius-sm);
    font-family: var(--ds-font-mono);
    font-size: 0.92em;
    color: var(--ds-text);
}

.site-doc-body pre {
    background: var(--ds-bg-muted);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    padding: 12px 14px;
    overflow-x: auto;
    margin: 0 0 20px;
}

.site-doc-body pre code {
    background: transparent;
    padding: 0;
    font-size: var(--ds-fs-sm);
}

.site-doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 20px;
    font-size: var(--ds-fs-sm);
}

.site-doc-body th,
.site-doc-body td {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ds-border);
}

.site-doc-body th {
    background: var(--ds-bg-muted);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text-muted);
    text-transform: uppercase;
    font-size: var(--ds-fs-xs);
    letter-spacing: 0.04em;
}

.site-doc-body a {
    color: var(--ds-brand-500);
}

.site-doc-body a:hover {
    color: var(--ds-brand-700);
}

/* ---------- Legal document specifics --------------------------------------- */

/* Indent nested TOC entries (h3 inside h2 sections of the legal doc). */
.site-docs-sidebar__link.site-legal-toc__sub {
    padding-left: 22px;
    font-size: var(--ds-fs-xs);
    color: var(--ds-text-muted);
}

.site-docs-sidebar__link.site-legal-toc__sub:hover { color: var(--ds-text); }

/* Quotes around the cartel modelo and DPA introductions need a clear treatment. */
.site-legal-body blockquote {
    margin: 16px 0 20px;
    padding: 12px 16px;
    border-left: 3px solid var(--ds-brand-500);
    background: var(--ds-bg-muted);
    border-radius: 0 var(--ds-radius-md) var(--ds-radius-md) 0;
    color: var(--ds-text);
}

.site-legal-body blockquote p:last-child { margin-bottom: 0; }

/* Scroll-anchor offset so deep-linked headings are not hidden under the nav. */
.site-legal-body :is(h2, h3)[id] {
    scroll-margin-top: calc(var(--ds-topbar-h) + 16px);
}

/* ---------- Screenshots ---------------------------------------------------- */

.site-screenshots {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin: 32px 0;
}

.site-screenshot {
    background: var(--ds-bg-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    overflow: hidden;
    box-shadow: var(--ds-shadow-xs);
}

.site-screenshot__img {
    display: block;
    width: 100%;
    height: auto;
}

.site-screenshot__placeholder {
    aspect-ratio: 16/10;
    background: var(--ds-bg-muted);
    color: var(--ds-text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 2px dashed var(--ds-border-strong);
    margin: -1px;
    border-radius: var(--ds-radius-lg);
}

.site-screenshot__placeholder svg { width: 40px; height: 40px; opacity: 0.5; }
.site-screenshot__placeholder-label { font-size: var(--ds-fs-sm); font-weight: var(--ds-fw-medium); }
.site-screenshot__placeholder-file {
    font-family: var(--ds-font-mono);
    font-size: var(--ds-fs-xs);
    opacity: 0.7;
}

.site-screenshot__caption {
    padding: 12px 16px;
    border-top: 1px solid var(--ds-border);
    color: var(--ds-text-muted);
    font-size: var(--ds-fs-sm);
}

/* ---------- Status badges -------------------------------------------------- */

.site-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--ds-radius-pill);
    font-size: var(--ds-fs-xs);
    font-weight: var(--ds-fw-medium);
}

.site-status-badge--beta {
    background: var(--ds-info-bg);
    color: var(--ds-info);
}

.site-status-badge--planned {
    background: var(--ds-warning-bg);
    color: var(--ds-warning);
}

/* ---------- Related pages -------------------------------------------------- */

.site-related {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--ds-border);
}

.site-related__title {
    font-size: var(--ds-fs-md);
    font-weight: var(--ds-fw-semibold);
    color: var(--ds-text);
    margin: 0 0 16px;
}

.site-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

/* ---------- Responsive ----------------------------------------------------- */

@media (max-width: 900px) {
    .site-docs {
        grid-template-columns: 1fr;
    }
    .site-docs-sidebar {
        position: static;
        max-height: none;
    }
    .site-hero { padding: 48px 16px 32px; }
    .site-hero__title { font-size: var(--ds-fs-2xl); }
}

@media (max-width: 600px) {
    .site-nav { padding: 0 16px; }
    .site-container { padding: 24px 16px; }
    .site-section { padding: 32px 0; }
}
