/* ═══════════════════════════════════════════════════════════════
   AlkaPay — Subpage styles (docs, legal, pricing, security, dev)
   Loaded together with styles.css on every non-landing page.
   ═══════════════════════════════════════════════════════════════ */

/* ── Page hero ─────────────────────────────────────────────── */
.page-hero {
    position: relative;
    padding: 64px 0 48px;
    background:
        radial-gradient(620px 300px at 90% -20%, rgba(34, 197, 94, 0.10), transparent 65%),
        var(--bg);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.page-hero-bg, .page-hero-orb, .page-hero-grid { display: none; }
.page-hero h1 {
    font-size: clamp(1.9rem, 4.2vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 8px 0 14px;
}
.page-hero p { color: var(--ink-soft); max-width: 40em; font-size: 16.5px; }
.page-hero .updated {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 999px;
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--muted);
    margin-bottom: 16px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green-deep); }

/* ── Prose (legal + docs body copy) ────────────────────────── */
.legal-content { max-width: 780px; margin: 0 auto; padding: 56px 0 80px; }
.prose h2 {
    font-size: 22px;
    letter-spacing: -0.015em;
    margin: 40px 0 14px;
    scroll-margin-top: 90px;
}
.prose h3 { font-size: 17.5px; margin: 26px 0 10px; scroll-margin-top: 90px; }
.prose p { margin-bottom: 14px; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 16px; color: var(--ink-soft); display: grid; gap: 8px; }
.prose strong { color: var(--ink); }
.prose code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1px 6px;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 14.5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.prose th, .prose td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.prose th { background: var(--surface-2); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }

/* Table of contents */
.legal-toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 12px;
}
.legal-toc h4 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 12px;
}
.legal-toc ol { margin: 0; display: grid; gap: 7px; font-size: 14.5px; }

/* Callouts — icon <i> is hidden by the shim; the border + tint carries it */
.callout {
    display: flex;
    gap: 12px;
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    margin: 18px 0;
    font-size: 14.5px;
    border: 1px solid var(--border);
    border-left-width: 4px;
    background: var(--surface);
}
.callout p { margin: 0; color: var(--ink-soft); }
.callout-info { border-left-color: var(--blue); background: var(--blue-tint); }
.callout-tip { border-left-color: var(--green); background: linear-gradient(135deg, var(--green-050) 0%, var(--green-tint) 100%); }
.callout-warn { border-left-color: var(--amber); background: var(--amber-tint); }

/* Numbered step lists */
ol.steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 18px 0;
    display: grid;
    gap: 14px;
}
ol.steps > li {
    counter-increment: step;
    position: relative;
    padding: 16px 18px 16px 58px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
ol.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 16px;
    top: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--green-tint);
    color: var(--green-ink);
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
ol.steps h4 { font-size: 15.5px; margin-bottom: 4px; }
ol.steps p { margin: 0; font-size: 14.5px; }

.legal-disclaimer {
    margin-top: 40px;
    padding: 16px 18px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--muted);
    background: var(--surface);
}

/* ── Docs layout ───────────────────────────────────────────── */
.docs-search-band {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
@media (min-width: 901px) {
    /* Pin the search bar just below the 66px sticky navbar */
    .docs-search-band {
        position: sticky;
        top: 66px;
        z-index: 60;
        background: rgba(255, 255, 255, 0.92);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}
.docs-search {
    position: relative;
    max-width: 620px;
    /* flex kills the phantom line box the full-width input creates */
    display: flex;
    align-items: center;
}
.docs-search input {
    width: 100%;
    min-height: 48px;
    padding: 12px 44px 12px 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 999px;
    background: var(--bg);
    font-size: 15px;
    color: var(--ink);
}
.docs-search input:focus {
    outline: none;
    border-color: var(--green);
}
.search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 15px;
    display: none;
}
.docs-search.has-query .search-clear,
.docs-search.has-value .search-clear { display: block; }
.search-status { font-size: 13.5px; color: var(--muted); margin-top: 8px; min-height: 20px; }
.docs-nav li.search-hidden { display: none; }

.docs-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 48px;
    padding: 48px 0 90px;
    align-items: start;
}
/* Sidebar sticks below navbar (66px) + sticky search band (~110px) */
.docs-sidebar { position: sticky; top: 190px; }
.docs-nav-title {
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 12px;
}
.docs-nav { list-style: none; padding: 0; display: grid; gap: 2px; margin-bottom: 24px; }
.docs-nav a {
    display: block;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink-soft);
    border-left: 2px solid transparent;
}
.docs-nav a:hover { background: var(--surface-2); color: var(--ink); }
.docs-nav a.active {
    background: var(--green-tint);
    color: var(--green-ink);
    font-weight: 650;
}
.docs-help-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.docs-help-card h4 { font-size: 15px; margin-bottom: 6px; }
.docs-help-card p { font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }

.docs-content { min-width: 0; }
/* section.doc-section (not bare .doc-section) so this out-ranks the
   generic section[id] scroll-margin in styles.css */
section.doc-section { margin-bottom: 44px; scroll-margin-top: 90px; }
@media (min-width: 901px) {
    /* Anchor jumps must clear navbar + sticky search band */
    section.doc-section { scroll-margin-top: 196px; }
}
.doc-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.sec-num {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--green-tint);
    color: var(--green-ink);
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.code-block {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--forest);
    color: var(--on-forest);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    overflow-x: auto;
    margin: 14px 0;
    line-height: 1.7;
}
.docs-no-results {
    display: none;
    padding: 40px 0;
    text-align: center;
    color: var(--muted);
}
.docs-no-results.show { display: block; }
.doc-section.search-hidden { display: none; }
mark.search-hit { background: #fdeeb2; border-radius: 3px; padding: 0 1px; }

/* ── Changelog timeline ────────────────────────────────────── */
.changelog-list { max-width: 720px; margin: 0 auto; padding: 56px 0 90px; }
.cl-release {
    position: relative;
    padding: 0 0 40px 34px;
    border-left: 2px solid var(--border);
}
.cl-release:last-child { border-left-color: transparent; }
.cl-release::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--green);
    border: 3px solid var(--bg);
}
.cl-release h2 {
    font-size: 21px;
    letter-spacing: -0.015em;
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 12px;
}
.cl-release .cl-date { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.cl-release ul { display: grid; gap: 8px; color: var(--ink-soft); font-size: 15px; }
.cl-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 2px 9px;
    margin-right: 6px;
}
.cl-badge.added { background: var(--green-tint); color: var(--green-ink); }
.cl-badge.fixed { background: var(--blue-tint); color: var(--blue); }
.cl-badge.improved { background: var(--amber-tint); color: var(--amber); }
.cl-badge.security { background: var(--red-tint); color: var(--red); }

/* ── Info card grids (security / developers / pricing pages) ── */
.page-section { padding: 56px 0; }
.page-section + .page-section { border-top: 1px solid var(--border); }
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 28px;
}
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.info-card h3 { font-size: 17px; letter-spacing: -0.01em; margin-bottom: 8px; }
.info-card p { font-size: 14.5px; color: var(--muted); margin: 0; }
.info-card .tech-note {
    display: inline-block;
    margin-top: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--green-ink);
    background: var(--green-tint);
    border-radius: 7px;
    padding: 5px 10px;
}

/* Money-flow diagram (security page) */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 32px auto 10px;
    max-width: 760px;
}
.flow-node {
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 16px 22px;
    text-align: center;
    min-width: 150px;
}
.flow-node strong { display: block; font-size: 15px; }
.flow-node span { font-size: 12.5px; color: var(--muted); }
.flow-node.accent { border-color: var(--green); background: var(--green-tint); }
.flow-arrow { font-size: 20px; color: var(--green-deep); font-weight: 700; }
.flow-caption { text-align: center; font-size: 13.5px; color: var(--muted); max-width: 560px; margin: 12px auto 0; }

/* Hooks/filters table (developers page) */
.hook-table-wrapper { overflow-x: auto; margin-top: 24px; }
.hook-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.hook-table th, .hook-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; }
.hook-table th { background: var(--surface-2); font-weight: 700; }
.hook-table code { font-family: var(--font-mono); font-size: 12.5px; color: var(--green-ink); }
.hook-table tr:last-child td { border-bottom: 0; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .docs-layout { grid-template-columns: 1fr; gap: 24px; }
    .docs-sidebar { position: static; order: -1; }
    .docs-nav { grid-template-columns: 1fr 1fr; }
    .docs-nav li { min-width: 0; }
    .docs-nav a { overflow-wrap: anywhere; }
    .docs-help-card { display: none; }
    .card-grid { grid-template-columns: 1fr; }
    .flow-diagram { flex-direction: column; }
    .flow-arrow { transform: rotate(90deg); }
}

@media (max-width: 560px) {
    .docs-nav { grid-template-columns: 1fr; }
}
