/* UlakBulut Kılavuz — harici font/kaynak yok, CSP: style-src 'self' */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text: #1c2430;
  --muted: #5b6676;
  --border: #dfe4ea;
  --accent: #0b5cad;
  --accent-strong: #08488a;
  --accent-soft: #e6f0fa;
  --code-bg: #0f1722;
  --code-text: #e6edf3;
  --warn: #8a5300;
  --note-bg: #eef4fb; --note-border: #9cc0e6;
  --tip-bg: #edf7f0; --tip-border: #8fcca3;
  --warn-bg: #fdf5e7; --warn-border: #e4b363;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --sidebar: 270px;
  --content: 760px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #131a23;
    --surface-2: #1a2330;
    --text: #e3e8ef;
    --muted: #9aa6b5;
    --border: #263241;
    --accent: #5ea8f2;
    --accent-strong: #8cc2f7;
    --accent-soft: #15283d;
    --code-bg: #0a0f16;
    --code-text: #e6edf3;
    --warn: #f0b45a;
    --note-bg: #13233a; --note-border: #2f5d8f;
    --tip-bg: #12271b; --tip-border: #2e7048;
    --warn-bg: #2a1f0d; --warn-border: #9a6b1d;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { width: 40px; height: 40px; border-radius: 8px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: .78rem; }
.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 6px 10px; font: inherit; font-size: .9rem; cursor: pointer;
}

.search { position: relative; margin-left: auto; width: min(420px, 100%); }
.search input {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 36px 8px 12px; appearance: none;
}
.search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.search-key {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font: 12px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px;
}
.search input:focus + .search-key { display: none; }
.results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18); max-height: min(70vh, 520px); overflow: auto;
}
.results a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.results a:hover, .results a[aria-selected="true"] { background: var(--accent-soft); }
.results strong { display: block; font-size: .95rem; }
.results small { display: block; color: var(--accent); font-size: .75rem; margin: 1px 0 3px; }
.results span { display: block; color: var(--muted); font-size: .83rem; line-height: 1.45; }
.results .empty { padding: 10px; color: var(--muted); font-size: .9rem; }

/* ---- layout ---- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: 40px;
  padding-top: 28px; padding-bottom: 56px;
}
.sidebar { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 104px); overflow: auto; padding-right: 4px; }
.sidebar h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 6px 10px; }
.sidebar h2:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a {
  display: block; padding: 5px 10px; border-radius: 6px; color: var(--text);
  text-decoration: none; font-size: .92rem; line-height: 1.4;
}
.sidebar a:hover { background: var(--surface-2); }
.sidebar a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.sidebar ul ul { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--border); }

main { min-width: 0; }
.doc { display: grid; grid-template-columns: minmax(0, var(--content)) 220px; gap: 40px; }
.doc:not(.has-toc) { grid-template-columns: minmax(0, var(--content)); }

/* ---- article ---- */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.entry-header h1, .listing h1, .hero h1, .notfound h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px;
}
.entry-meta { color: var(--muted); font-size: .88rem; margin: 0 0 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); text-decoration: none;
}
a.chip:hover { background: var(--accent); color: #fff; }

.prose { font-size: 1.02rem; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose figure, .prose pre, .prose blockquote, .prose table { margin: 0 0 1.1em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { line-height: 1.3; margin: 1.8em 0 .6em; letter-spacing: -.01em; }
.prose h2 { font-size: 1.45rem; padding-bottom: .3em; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 1.2rem; }
.prose h4, .prose h5, .prose h6 { font-size: 1.05rem; }
.prose .anchor { color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; margin-left: 4px; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose li { margin: .25em 0; }
.prose strong { font-weight: 650; }
.prose mark { background: none; color: inherit; font-weight: 600; border-left: 3px solid var(--warn); padding-left: 8px; display: inline; }
.prose img {
  display: block; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow);
}
.prose figure { margin-left: 0; margin-right: 0; }
.prose figure figure { margin: 0 0 1em; }
.prose figcaption { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: .1em .35em; }
.prose pre {
  position: relative; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; font-size: .88rem; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.prose pre .copy {
  position: absolute; top: 8px; right: 8px; font: 600 .72rem var(--font); color: var(--code-text);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px;
  padding: 4px 8px; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.prose pre:hover .copy, .prose pre .copy:focus { opacity: 1; }
@media (hover: none) { .prose pre .copy { opacity: 1; } }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose blockquote { border-left: 3px solid var(--accent); margin-left: 0; padding: 2px 0 2px 16px; color: var(--muted); }
.prose kbd {
  font: 600 .82em var(--font); white-space: nowrap; padding: .15em .5em; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); border-bottom-width: 2px; color: var(--text);
}
.prose ol > li::marker { color: var(--accent); font-weight: 700; }
.prose aside {
  margin: 0 0 1.1em; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--note-border); border-left-width: 4px; background: var(--note-bg);
}
.prose aside > :last-child { margin-bottom: 0; }
.prose aside p, .prose aside ul { margin: 0 0 .5em; }
.prose aside pre { margin: .5em 0 0; }
.prose aside.tip { --note-bg: var(--tip-bg); --note-border: var(--tip-border); }
.prose aside.warning { --note-bg: var(--warn-bg); --note-border: var(--warn-border); }

.toc { position: sticky; top: 88px; align-self: start; font-size: .85rem; }
.toc h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li a { display: block; padding: 3px 0 3px 12px; color: var(--muted); text-decoration: none; }
.toc li.lvl3 a { padding-left: 24px; }
.toc a:hover { color: var(--accent); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; background: var(--surface);
}
.pager a:hover { border-color: var(--accent); }
.pager small { color: var(--muted); font-size: .78rem; }
.pager span { font-weight: 600; }
.pager .next { text-align: right; }

/* ---- home / listing ---- */
.hero { padding: 8px 0 24px; max-width: var(--content); }
.hero .lead, .listing .lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 12px; }
.hero p { color: var(--muted); }
.cat-section { margin-top: 36px; }
.cat-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.cat-head h2 { font-size: 1.25rem; margin: 0; }
.cat-head h2 a { color: var(--text); text-decoration: none; }
.cat-head h2 a:hover { color: var(--accent); }
.cat-head span { color: var(--muted); font-size: .85rem; }
.cat-desc { color: var(--muted); margin: 0 0 12px; }
.cards { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card a {
  display: flex; flex-direction: column; height: 100%; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.card a:hover { border-color: var(--accent); transform: translateY(-1px); }
.card h3 { font-size: 1.02rem; margin: 0 0 6px; line-height: 1.35; }
.card p { color: var(--muted); font-size: .88rem; margin: 0 0 12px; flex: 1; line-height: 1.5; }
.card .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .78rem; }
.notfound { padding: 40px 0; max-width: var(--content); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; background: var(--surface); }
.site-footer p { margin: 18px 0; }

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .doc, .doc.has-toc { grid-template-columns: minmax(0, var(--content)); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 16px; }
  .nav-toggle { display: inline-block; }
  .header-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; gap: 10px; }
  .search { order: 3; width: 100%; margin-left: 0; }
  .search-key { display: none; }
  .sidebar {
    display: none; position: static; max-height: none; margin-bottom: 20px; padding: 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  }
  .sidebar.open { display: block; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .sidebar, .toc, .pager, .site-footer, .copy { display: none !important; }
  .layout { display: block; }
  .prose pre { white-space: pre-wrap; background: #f4f4f4; color: #000; }
}
