/* ShareFlowX — product, guide and legal pages (loads after home.css) */

/* ---------- Page header ---------- */

.page-hero {
    position: relative;
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.4;
    mask-image: radial-gradient(ellipse 60% 80% at 80% 30%, #000 10%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 60% 80% at 80% 30%, #000 10%, transparent 70%);
    pointer-events: none;
}
.page-hero .container { position: relative; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-hidden] { opacity: 0.5; }

.page-hero h1 {
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    max-width: 860px;
}
.page-hero .lede {
    margin-top: 18px;
    max-width: 680px;
    font-size: 19px;
    color: var(--muted);
}
.page-hero .hero-cta { margin-top: 32px; }

/* App sub-navigation */

.app-nav {
    position: sticky;
    top: 72px;
    z-index: 40;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.app-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
}
.app-nav strong { font-family: var(--font-display); font-size: 15px; white-space: nowrap; }
.app-nav ul {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
}
.app-nav ul a {
    display: block;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
}
.app-nav ul a:hover { background: var(--paper); }
.app-nav ul a[aria-current='page'] { background: var(--ink); color: var(--white); }
.app-nav .btn { padding: 9px 16px; font-size: 13px; white-space: nowrap; }

/* ---------- Long-form content ---------- */

.prose {
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--ink-2);
}
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 28px; color: var(--ink); margin-top: 0; margin-bottom: 18px; }
.prose h3 { font-size: 21px; color: var(--ink); margin: 1.8em 0 0.6em; }
.prose h2 + h3, .prose .step-number + h3 { margin-top: 0; }
.prose h4 { font-size: 17px; color: var(--ink); margin: 1.6em 0 0.5em; }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--accent); }
.prose ol li::marker { font-family: var(--font-mono); font-size: 0.85em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose img { height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 1.2em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.prose code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    padding: 0.15em 0.4em;
    border-radius: 5px;
    background: var(--paper-2);
    color: var(--ink);
    word-break: break-word;
}
.prose pre {
    margin: 1.2em 0;
    padding: 18px 20px;
    overflow-x: auto;
    border-radius: 12px;
    background: var(--ink);
    color: #e6e9f2;
    font-size: 13.5px;
    line-height: 1.65;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; word-break: normal; }

.prose table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    font-size: 15px;
    display: block;
    overflow-x: auto;
}
.prose th, .prose td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--paper); font-weight: 600; color: var(--ink); }
.prose tr:last-child td { border-bottom: 0; }

/* Callouts */

.note, .warning, .success, .callout {
    position: relative;
    margin: 1.4em 0;
    padding: 16px 20px 16px 22px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--white);
    font-size: 15px;
    line-height: 1.65;
}
.note::before, .warning::before, .success::before, .callout::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
}
.note { background: #f5f7ff; border-color: #dbe1fb; }
.warning, .callout { background: #fff8f3; border-color: #f6dccd; }
.warning::before, .callout::before { background: var(--signal); }
.success { background: #f2faf6; border-color: #cfe9dc; }
.success::before { background: var(--ok); }
.note ul, .warning ul, .success ul, .callout ul { margin: 8px 0 0; }
.note > :last-child, .warning > :last-child, .success > :last-child, .callout > :last-child { margin-bottom: 0; }
.callout h2, .callout h3 { font-size: 19px; margin: 0 0 8px; }

/* ---------- Docs layout ---------- */

.docs-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 64px;
    padding: 64px 0 112px;
    align-items: start;
}
.docs-layout.no-toc { grid-template-columns: minmax(0, 820px); justify-content: center; }

.toc {
    position: sticky;
    top: 152px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    font-size: 14px;
}
.toc h2 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc ul ul { border-left: 0; padding-left: 12px; }
.toc a {
    display: block;
    margin-left: -1px;
    padding: 6px 0 6px 16px;
    border-left: 2px solid transparent;
    color: var(--muted);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s, border-color 0.15s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.docs-body { min-width: 0; }
.docs-body > .step,
.docs-body > .section {
    padding: 36px 40px;
    margin-bottom: 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    scroll-margin-top: 150px;
}
.docs-body > .step > :last-child,
.docs-body > .section > :last-child { margin-bottom: 0; }

.step-number {
    display: inline-block;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.feature-grid, .features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin: 1.4em 0;
}
.feature-box {
    padding: 22px;
    border-radius: 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    font-size: 15px;
}
.feature-box h3, .feature-box h4 { font-size: 17px; margin: 0 0 8px; }
.feature-box p:last-child { margin-bottom: 0; }

/* ---------- Product pages ---------- */

.product-body { padding: 24px 0 112px; }

.feature-section { padding: 72px 0 0; }
.feature-section > h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 32px;
    color: var(--ink);
}
.feature-section > p { color: var(--muted); max-width: 680px; margin-bottom: 24px; }
.features-grid { gap: 20px; margin: 0; }
.feature-card {
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.2s var(--ease), transform 0.25s var(--ease);
}
.feature-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.feature-card ul { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.feature-card li::marker { color: var(--accent); }

/* Closing CTA used on product and docs pages */

.page-cta { padding: 0 0 112px; }
.docs-body .cta-band { margin-top: 40px; padding: 48px; grid-template-columns: 1fr; }

/* ---------- Legal pages ---------- */

.legal .prose h2 { font-size: 20px; margin: 2.2em 0 0.6em; }
.legal .prose h2:first-child { margin-top: 0; }
.legal-meta { margin-top: 14px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }

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

@media (max-width: 1040px) {
    .docs-layout { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
    .toc {
        position: static;
        max-height: none;
        padding: 24px;
        background: var(--white);
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }
}

@media (max-width: 640px) {
    .page-hero { padding: 48px 0 40px; }
    .app-nav { top: 72px; }
    .app-nav strong, .app-nav .btn { display: none; }
    .docs-body > .step, .docs-body > .section { padding: 26px 22px; }
    .docs-body .cta-band { padding: 32px 24px; }
}
