/* ============================================================
   DOCS-LAYOUT.CSS — Çok sayfalı dokümantasyon kabuğu
   Bağımlılık: base.css
   ============================================================ */

:root {
    --docs-topbar-height: 64px;
    --docs-sidebar-width: 240px;
    --docs-toc-width: 190px;
    --docs-content-width: 740px;
    --docs-shell-gap: clamp(2rem, 4vw, 4.5rem);
}

.docs-page,
.docs-home-page {
    background: var(--bg);
    overflow-x: hidden;
    overflow-x: clip;
}

/* Top bar */
.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 800;
    height: var(--docs-topbar-height);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.docs-topbar-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: min(calc(100% - 2rem), 1440px);
    height: 100%;
    margin: 0 auto;
}

.docs-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--text);
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.docs-brand-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: var(--brand);
    border-radius: 8px;
    font-size: .82rem;
}

.docs-top-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.docs-top-links a {
    color: var(--text-muted);
    font-size: .82rem;
    text-decoration: none;
}

.docs-top-links a:hover { color: var(--text); }
.docs-top-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.docs-menu-toggle {
    display: none;
    width: 34px;
    height: 34px;
    padding: 7px;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
}

.docs-menu-toggle:hover { background: var(--surface); }
.docs-menu-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

/* Three-column shell */
.docs-shell {
    display: grid;
    grid-template-columns: var(--docs-sidebar-width) minmax(0, var(--docs-content-width)) var(--docs-toc-width);
    justify-content: center;
    gap: var(--docs-shell-gap);
    width: min(calc(100% - 3rem), 1440px);
    margin: 0 auto;
}

.docs-sidebar,
.docs-toc {
    min-width: 0;
}

.docs-sidebar-inner,
.docs-toc-inner {
    position: sticky;
    top: calc(var(--docs-topbar-height) + 2rem);
    max-height: calc(100vh - var(--docs-topbar-height) - 4rem);
    overflow-y: auto;
    scrollbar-width: thin;
}

.docs-sidebar-inner { padding: .25rem .5rem 3rem 0; }
.docs-nav-group + .docs-nav-group { margin-top: 1.7rem; }

.docs-nav-label,
.docs-toc-title {
    margin-bottom: .55rem;
    color: var(--text);
    font-size: .76rem;
    font-weight: 700;
}

.docs-nav-link {
    display: block;
    margin: .08rem 0;
    padding: .38rem .55rem;
    color: var(--text-muted);
    border-radius: 6px;
    font-size: .8rem;
    line-height: 1.45;
    text-decoration: none;
}

.docs-nav-link:hover {
    color: var(--text);
    background: var(--surface);
}

.docs-nav-link.active {
    color: var(--text);
    background: var(--surface-2);
    font-weight: 600;
}

.docs-main,
.docs-article,
.docs-article > section {
    min-width: 0;
}

.docs-article {
    width: 100%;
    max-width: 100%;
    padding: clamp(3.5rem, 7vw, 6.5rem) 0 6rem;
}

.docs-article-header {
    margin-bottom: 4.5rem;
}

.docs-eyebrow {
    margin-bottom: .8rem;
    color: var(--brand);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.docs-article-header h1 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}

.docs-lead {
    max-width: 650px;
    margin-top: 1.25rem;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.75;
}

.docs-article > section {
    margin: 0 0 5rem;
    scroll-margin-top: calc(var(--docs-topbar-height) + 2rem);
}

.docs-article > section + section {
    padding-top: 0;
    border-top: 0;
}

.docs-article h2 {
    margin: 0 0 1.4rem;
    padding: 0;
    border: 0;
    font-size: 1.65rem;
    line-height: 1.25;
    letter-spacing: -.02em;
}

.docs-article h2::before { display: none; }
.docs-article h3 { margin-top: 2.8rem; font-size: 1.12rem; }
.docs-article h4 { margin-top: 2rem; }

.docs-article p,
.docs-article li {
    line-height: 1.82;
    overflow-wrap: anywhere;
}

.docs-article p { margin-bottom: 1.2rem; }
.docs-article ul,
.docs-article ol { margin-bottom: 1.5rem; }

.docs-article .table-wrapper,
.docs-article pre,
.docs-article .code-tabs,
.docs-article .diagram-wrapper,
.docs-article .demo-output,
.docs-article > section > .callout {
    margin-top: 1.7rem;
    margin-bottom: 2.2rem;
}

.docs-article > section > .callout {
    box-shadow: none;
}

.docs-article .demo-output {
    background: var(--surface);
    box-shadow: none;
}

/* Rehber önizleme yardımcıları */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .8rem;
    margin: 1.5rem 0 2rem;
}

.feature-summary {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.feature-summary h3 { margin: 0 0 .35rem; font-size: .92rem; }
.feature-summary p { margin: 0; color: var(--text-muted); font-size: .82rem; line-height: 1.55; }

.docs-feature-groups {
    margin: 2rem 0;
    border-top: 1px solid var(--border);
}

.docs-feature-groups > div {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) 1.3fr;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.docs-feature-groups strong { font-size: .86rem; }
.docs-feature-groups span { color: var(--text-muted); font-size: .82rem; line-height: 1.6; }

.demo-output {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.demo-output > :last-child { margin-bottom: 0; }
.demo-output .scenario-card,
.demo-output .endpoint-card {
    margin: 0;
    background: var(--bg);
    box-shadow: none;
}
.docs-article .scenario-card h4 {
    margin: -1.4rem -1.4rem 1rem;
}
.docs-article .scenario-card .scenario-description {
    margin-bottom: .8rem;
}
.demo-output .scenario-card .callout {
    margin: 1rem 0 0;
}

.demo-label {
    display: block;
    margin-bottom: .6rem;
    color: var(--text-dim);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.mini-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.plain-button {
    padding: .45rem .7rem;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
}
.plain-button:hover { color: var(--brand); border-color: var(--brand); }
.dependency-list { margin-left: 0; list-style: none; }
.dependency-list li { position: relative; padding-left: 1rem; }
.dependency-list li::before { content: ""; position: absolute; top: .72rem; left: 0; width: 5px; height: 5px; background: var(--brand); border-radius: 50%; }
.skip-link.is-preview { position: relative; top: auto; left: auto; display: inline-block; transform: none; }
.reading-progress.is-preview { position: relative; z-index: auto; width: 100%; height: 4px; border-radius: 999px; transform: scaleX(.68); }

/* On this page */
.docs-toc-inner {
    padding: .25rem 0 3rem;
}

.docs-toc nav {
    position: relative;
    padding-left: .8rem;
    border-left: 1px solid var(--border);
}

.docs-toc a {
    display: block;
    margin: .5rem 0;
    color: var(--text-dim);
    font-size: .75rem;
    line-height: 1.45;
    text-decoration: none;
}

.docs-toc a[data-level="3"] { padding-left: .7rem; }
.docs-toc a:hover,
.docs-toc a.active { color: var(--text); }

/* Previous / next */
.docs-pagination {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.docs-page-link {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem 0;
    color: var(--text);
    text-decoration: none;
}

.docs-page-link span { color: var(--text-dim); font-size: .72rem; }
.docs-page-link strong { font-size: .9rem; }
.docs-page-next { text-align: right; }
.docs-page-link:hover strong { color: var(--brand); }

/* Landing */
.docs-home {
    width: min(100% - 3rem, 1100px);
    margin: 0 auto;
    padding: clamp(5rem, 11vw, 9rem) 0 7rem;
}

.docs-home-hero {
    max-width: 840px;
    margin-bottom: 8rem;
}

.docs-home-hero h1 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: clamp(3rem, 8vw, 6.4rem);
    line-height: .98;
    letter-spacing: -.06em;
}

.docs-home-hero > p:not(.docs-eyebrow) {
    max-width: 650px;
    margin: 2rem 0 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.75;
}

.docs-home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-top: 2rem;
}

.docs-primary-action,
.docs-secondary-action {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: .65rem 1rem;
    border-radius: 8px;
    font-size: .84rem;
    font-weight: 600;
    text-decoration: none;
}

.docs-primary-action { color: #fff; background: var(--brand); }
.docs-secondary-action { color: var(--text); border: 1px solid var(--border); }
.docs-secondary-action:hover { background: var(--surface); }

.docs-home-section { margin-bottom: 7rem; }
.docs-home-section-heading {
    margin-bottom: 2.5rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}
.docs-home-section-heading h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.8rem, 4vw, 2.7rem); }
.docs-home-section-heading h2::before { display: none; }

.docs-home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-home-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 2rem 2rem 2rem 0;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.docs-home-card:nth-child(odd) {
    padding-right: 2.5rem;
    border-right: 1px solid var(--border);
}

.docs-home-card:nth-child(even) { padding-left: 2.5rem; }
.docs-home-card-label { color: var(--text-dim); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.docs-home-card strong { margin: .65rem 0 .55rem; font-size: 1.25rem; }
.docs-home-card > span:not(.docs-home-card-label, .docs-home-card-action) { color: var(--text-muted); font-size: .88rem; line-height: 1.65; }
.docs-home-card-action { display: none; }
.docs-home-card:hover strong { color: var(--brand); }

.docs-home-principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.docs-home-principles div { display: flex; flex-direction: column; gap: .6rem; }
.docs-home-principles strong { font-size: .9rem; }
.docs-home-principles span { color: var(--text-muted); font-size: .82rem; line-height: 1.6; }

.docs-overlay {
    position: fixed;
    inset: var(--docs-topbar-height) 0 0;
    z-index: 699;
    background: rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

@media (max-width: 1180px) {
    .docs-shell {
        grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
        gap: clamp(1.5rem, 3vw, 3rem);
    }
    .docs-toc { display: none; }
}

@media (max-width: 860px) {
    .docs-topbar-inner { width: min(calc(100% - 1rem), 1440px); gap: .6rem; }
    .docs-menu-toggle { display: block; }
    .docs-top-actions { position: absolute; right: 0; }
    .docs-brand span:last-child { display: none; }
    .docs-top-links { display: none; }
    .docs-shell { display: block; width: min(calc(100% - 2rem), var(--docs-content-width)); }
    .docs-sidebar {
        position: fixed;
        top: var(--docs-topbar-height);
        bottom: 0;
        left: 0;
        z-index: 700;
        width: min(82vw, 290px);
        padding: 1rem;
        background: var(--bg);
        border-right: 1px solid var(--border);
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .docs-sidebar.open { transform: translateX(0); }
    .docs-sidebar-inner { position: static; max-height: 100%; }
    .docs-overlay.show { opacity: 1; pointer-events: auto; }
    .docs-article { padding-top: 3.5rem; }
    .docs-article-header { margin-bottom: 3.5rem; }
    .docs-article > section { margin-bottom: 4rem; }
}

@media (max-width: 640px) {
    .docs-top-actions .search-trigger span,
    .docs-top-actions .search-trigger kbd,
    .docs-top-actions .theme-toggle-label { display: none; }
    .docs-home { width: min(calc(100% - 2rem), 1100px); padding-top: 4rem; }
    .docs-home-hero { margin-bottom: 5rem; }
    .docs-home-grid { display: block; }
    .docs-home-card,
    .docs-home-card:nth-child(odd),
    .docs-home-card:nth-child(even) {
        min-height: 0;
        padding: 1.7rem 0;
        border-right: 0;
    }
    .docs-home-principles { grid-template-columns: 1fr; gap: 2rem; }
    .docs-pagination { grid-template-columns: 1fr; }
    .docs-page-next { text-align: left; }
    .guide-grid { grid-template-columns: 1fr; }
    .docs-feature-groups > div { grid-template-columns: 1fr; gap: .35rem; }
}

@media print {
    .docs-topbar,
    .docs-sidebar,
    .docs-toc,
    .docs-pagination { display: none !important; }
    .docs-shell { display: block; width: 100%; }
    .docs-article { max-width: none; padding: 0; }
}
