/* ─── Docs-specific styles ───────────────────────────────────────────── */
/*  Only doc-specific components — global styles come from styles.css  */

/* ─── Doc Container ──────────────────────────────────────────────── */

.doc-container {
    width: min(calc(100% - 2rem), var(--max-width, 1000px));
    margin: 0 auto;
    padding: 3rem 0 4rem;
}

.doc-header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.doc-header .eyebrow {
    margin: 0 0 1rem;
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.doc-header h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 0.97;
}

.doc-header p {
    margin: 1.2rem auto 0;
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 1.08rem;
    max-width: 58ch;
}

/* ─── Table of Contents ─────────────────────────────────────────── */

.toc-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    padding: 1.8rem 2rem;
    margin-bottom: 2.5rem;
}

.toc-card h2 {
    margin: 0 0 1rem;
    font-size: 1.3rem;
}

.toc-card ol {
    margin: 0;
    padding-left: 1.3rem;
}

.toc-card li {
    margin: 0.5rem 0;
    color: var(--text-soft);
}

.toc-card a {
    color: var(--accent);
    transition: color 160ms ease;
}

.toc-card a:hover {
    color: var(--text);
}

/* ─── Doc Sections ───────────────────────────────────────────────── */

.doc-section {
    margin-bottom: 3rem;
}

.doc-section:target {
    scroll-margin-top: 6rem;
}

.doc-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.doc-section-header .section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.doc-section-header h2 {
    margin: 0;
    font-size: 1.6rem;
}

.doc-section h3 {
    margin: 1.5rem 0 0.6rem;
    font-size: 1.2rem;
    color: var(--accent);
}

.doc-section p {
    margin: 0.6rem 0;
    color: var(--text-soft);
    line-height: 1.7;
}

.doc-section ul,
.doc-section ol {
    margin: 0.6rem 0;
    padding-left: 1.3rem;
    color: var(--text-soft);
    line-height: 1.7;
}

.doc-section li {
    margin: 0.4rem 0;
}

.doc-section strong {
    color: var(--text);
}

.doc-section code {
    background: rgba(176, 136, 249, 0.12);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--text);
}

.doc-section pre {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.doc-section pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-soft);
}

/* ─── Info Cards ─────────────────────────────────────────────────── */

.info-grid {
    display: grid;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.info-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    padding: 1.4rem;
}

.info-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--accent);
}

.info-card p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ─── Alert / Callout ────────────────────────────────────────────── */

.callout {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    margin: 1.5rem 0;
    background: rgba(176, 136, 249, 0.06);
}

.callout.tip {
    border-color: var(--kiwi);
    background: rgba(139, 195, 74, 0.06);
}

.callout.warning {
    border-color: #ff9800;
    background: rgba(255, 152, 0, 0.06);
}

.callout.info {
    border-color: #2196f3;
    background: rgba(33, 150, 243, 0.06);
}

.callout p {
    margin: 0;
    color: var(--text-soft);
    line-height: 1.6;
}

.callout strong {
    color: var(--text);
}

/* ─── Step List ──────────────────────────────────────────────────── */

.step-list {
    counter-reset: step;
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.step-list li {
    counter-increment: step;
    position: relative;
    padding: 0 0 1.2rem 2.8rem;
    color: var(--text-soft);
    line-height: 1.6;
    border-left: 2px solid var(--line);
    margin: 0;
}

.step-list li:last-child {
    border-left-color: transparent;
}

.step-list li::before {
    content: counter(step);
    position: absolute;
    left: -0.9rem;
    top: 0;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-list li strong {
    color: var(--text);
}

/* ─── Tables ─────────────────────────────────────────────────────── */

.doc-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.92rem;
}

.doc-table th,
.doc-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.doc-table th {
    background: rgba(176, 136, 249, 0.1);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.doc-table td {
    color: var(--text-soft);
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table tr:hover td {
    background: rgba(176, 136, 249, 0.03);
}

/* ─── Back to docs home ──────────────────────────────────────────── */

.doc-breadcrumb {
    margin-bottom: 1.5rem;
}

.doc-breadcrumb a {
    color: var(--accent);
    font-size: 0.92rem;
    transition: color 160ms ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.doc-breadcrumb a:hover {
    color: var(--text);
}

/* ─── Key caps ───────────────────────────────────────────────────── */

kbd {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 700;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--line);
    line-height: 1.5;
}

/* ─── Back to top ────────────────────────────────────────────────── */

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: color 160ms ease;
}

.back-to-top:hover {
    color: var(--text);
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 980px) {

    .info-grid.two-col,
    .info-grid.three-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .doc-container {
        width: min(calc(100% - 1.25rem), var(--max-width, 1000px));
    }
}

@media (max-width: 540px) {

    .doc-header h1 {
        font-size: clamp(2rem, 8vw, 2.8rem);
    }

    .toc-card {
        padding: 1.2rem 1.4rem;
    }

    pre {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* ─── Code Cards with Copy Button ─────────────────────────────── */

.code-card {
    position: relative;
    margin: 1.2rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.code-card pre {
    margin: 0;
    padding: 1.2rem 1.4rem;
    padding-right: 3.2rem;
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
    border: none;
    background: transparent;
}

.code-card code {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    color: var(--text);
}

.code-card .copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    width: 2.2rem;
    height: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-soft);
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    font-size: 0.8rem;
}

.code-card:hover .copy-btn {
    opacity: 1;
}

.code-card .copy-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.code-card .copy-btn.copied {
    background: #22c55e;
    color: #fff;
    border-color: #22c55e;
}

/* ─── Doc Subtitle ────────────────────────────────────────────── */

.doc-subtitle {
    color: var(--text-soft);
    line-height: 1.7;
    font-size: 1.08rem;
    max-width: 58ch;
    margin-bottom: 2rem;
}