:root {
  --yh-primary: #2563eb;
  --yh-primary-dark: #1d4ed8;
  --yh-primary-soft: #eff4ff;
  --yh-text: #1e293b;
  --yh-text-muted: #64748b;
  --yh-body: #334155;
  --yh-border: #e2e8f0;
  --yh-bg: #fff;
  --yh-surface: #fff;
  --yh-bg-hero: #f4f6fb;
  --yh-bg-hero-to: #eef2fb;
  --yh-footer-bg: #f8fafc;
  --yh-sep: #cbd5e1;
  --yh-code-bg: #f1f5f9;
  --yh-code-text: #b91c1c;
  --yh-note-bg: #eff6ff;
  --yh-note-border: #bfdbfe;
  --yh-note-text: #1e3a8a;
  --yh-warn-bg: #fffbeb;
  --yh-warn-border: #fde68a;
  --yh-warn-text: #78350f;
  --yh-tip-bg: #fafaf9;
  --yh-flash: #fef08a;
  --yh-sidebar-w: 300px;
  --yh-header-h: 64px;
}

/* Koyu tema — ana sitedeki slate paleti ile uyumlu (yk-theme anahtarı ortak) */
html[data-bs-theme="dark"] {
  --yh-primary: #3b82f6;
  --yh-primary-dark: #60a5fa;
  --yh-primary-soft: rgba(59, 130, 246, .16);
  --yh-text: #e2e8f0;
  --yh-text-muted: #94a3b8;
  --yh-body: #cbd5e1;
  --yh-border: #2c3a52;
  --yh-bg: #0f172a;
  --yh-surface: #16213a;
  --yh-bg-hero: #0f172a;
  --yh-bg-hero-to: #131f38;
  --yh-footer-bg: #0b1324;
  --yh-sep: #475569;
  --yh-code-bg: #1e293b;
  --yh-code-text: #fca5a5;
  --yh-note-bg: rgba(59, 130, 246, .12);
  --yh-note-border: rgba(96, 165, 250, .35);
  --yh-note-text: #bfdbfe;
  --yh-warn-bg: rgba(245, 158, 11, .12);
  --yh-warn-border: rgba(245, 158, 11, .35);
  --yh-warn-text: #fde68a;
  --yh-tip-bg: #17223b;
  --yh-flash: rgba(250, 204, 21, .3);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--yh-text);
  background: var(--yh-bg);
  margin: 0;
  transition: background-color .25s ease, color .25s ease;
}

a { color: var(--yh-primary); text-decoration: none; }
a:hover { color: var(--yh-primary-dark); text-decoration: underline; }

/* ---------- Header ---------- */
.yh-header {
  height: var(--yh-header-h);
  border-bottom: 1px solid var(--yh-border);
  background: var(--yh-surface);
  position: sticky;
  top: 0;
  z-index: 40;
}
.yh-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.yh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--yh-text);
  font-size: 1.05rem;
  white-space: nowrap;
  min-width: 0;
}
.yh-brand:hover { color: var(--yh-text); text-decoration: none; }
.yh-brand-logo { height: 30px; width: auto; flex-shrink: 0; }
.yh-brand-text { overflow: hidden; text-overflow: ellipsis; }
.yh-brand-text strong { color: var(--yh-primary); font-weight: 700; }
.yh-header-nav { display: flex; align-items: center; gap: 10px; }
.yh-header-nav .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* Tema seçici (açık / sistem / koyu) — ana sitedeki ThemeToggle ile aynı mantık */
.yh-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--yh-border);
  border-radius: 999px;
  background: var(--yh-surface);
  padding: 3px;
}
.yh-theme-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--yh-text-muted);
  font-size: .85rem;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.yh-theme-toggle button:hover { color: var(--yh-text); }
.yh-theme-toggle button[aria-checked="true"] {
  background: var(--yh-primary);
  color: #fff;
}

/* ---------- Hero ---------- */
.yh-hero {
  background: linear-gradient(180deg, var(--yh-bg-hero) 0%, var(--yh-bg-hero-to) 100%);
  padding: 48px 24px 40px;
  border-bottom: 1px solid var(--yh-border);
}
.yh-hero-inner { max-width: 780px; margin: 0 auto; text-align: center; }
.yh-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--yh-text);
}
.yh-hero-sub {
  color: var(--yh-text-muted);
  font-size: 1.02rem;
  margin: 0 0 24px;
}
.yh-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--yh-surface);
  border: 1px solid var(--yh-border);
  border-radius: 12px;
  padding: 8px 8px 8px 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}
.yh-search i.bi-search { color: var(--yh-text-muted); font-size: 1.1rem; }
.yh-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 0.98rem;
  background: transparent;
  color: var(--yh-text);
  padding: 8px 0;
}
.yh-search button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 600;
}
.yh-search-results {
  margin-top: 10px;
  text-align: left;
  background: var(--yh-surface);
  border: 1px solid var(--yh-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
.yh-search-results.show { display: block; }
.yh-search-results a {
  display: block;
  padding: 10px 16px;
  color: var(--yh-text);
  border-bottom: 1px solid var(--yh-border);
}
.yh-search-results a:last-child { border-bottom: none; }
.yh-search-results a:hover { background: var(--yh-primary-soft); text-decoration: none; }
.yh-search-results .yh-sr-module {
  font-size: .76rem;
  color: var(--yh-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  display: block;
}
.yh-search-results .yh-sr-title { font-weight: 600; }
.yh-search-results .yh-sr-empty { padding: 16px; color: var(--yh-text-muted); text-align: center; }

/* ---------- Dizin bandı ---------- */
.yh-index-label-row { border-bottom: 1px solid var(--yh-border); background: var(--yh-surface); }
.yh-index-label-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.yh-index-label {
  color: var(--yh-primary);
  font-weight: 700;
  font-size: .92rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.yh-sidebar-toggle {
  border: 1px solid var(--yh-border);
  background: var(--yh-surface);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .85rem;
  color: var(--yh-text);
}

/* ---------- Layout ---------- */
.yh-main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.yh-layout { display: flex; align-items: flex-start; gap: 28px; }

/* ---------- Sidebar / Tree ---------- */
.yh-sidebar {
  width: var(--yh-sidebar-w);
  flex: 0 0 var(--yh-sidebar-w);
  position: sticky;
  top: calc(var(--yh-header-h) + 16px);
  max-height: calc(100vh - var(--yh-header-h) - 32px);
  overflow-y: auto;
  padding-right: 4px;
}
.yh-tree-root {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--yh-text);
  padding: 6px 8px 12px;
  font-size: .95rem;
}
.yh-tree-root i { color: var(--yh-primary); }

.yh-tree-module { margin-bottom: 2px; }
.yh-tree-module-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  text-align: left;
  padding: 8px 8px;
  border-radius: 8px;
  color: var(--yh-text);
  font-size: .89rem;
  font-weight: 600;
  cursor: pointer;
}
.yh-tree-module-btn:hover { background: var(--yh-primary-soft); }
.yh-tree-module-btn.active { background: var(--yh-primary-soft); color: var(--yh-primary-dark); }
.yh-tree-module-btn .yh-caret {
  transition: transform .15s ease;
  font-size: .7rem;
  color: var(--yh-text-muted);
  width: 12px;
}
.yh-tree-module.expanded > .yh-tree-module-btn .yh-caret { transform: rotate(90deg); }
.yh-tree-module-btn .bi { color: var(--yh-primary); font-size: .95rem; width: 16px; text-align: center; }
.yh-tree-module-btn .yh-mod-label { flex: 1; }

.yh-tree-sections {
  list-style: none;
  margin: 0;
  padding: 2px 0 6px 34px;
  display: none;
}
.yh-tree-module.expanded > .yh-tree-sections { display: block; }
.yh-tree-sections li a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--yh-text-muted);
  font-size: .84rem;
  border-left: 2px solid transparent;
}
.yh-tree-sections li a:hover { background: var(--yh-primary-soft); text-decoration: none; color: var(--yh-text); }
.yh-tree-sections li a.active {
  color: var(--yh-primary-dark);
  font-weight: 600;
  border-left-color: var(--yh-primary);
  background: var(--yh-primary-soft);
}

.yh-sidebar-backdrop { display: none; }

/* ---------- Content ---------- */
.yh-content-wrap { flex: 1; min-width: 0; }
.yh-breadcrumb {
  font-size: .82rem;
  color: var(--yh-text-muted);
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.yh-breadcrumb a { color: var(--yh-text-muted); }
.yh-breadcrumb a:hover { color: var(--yh-primary); }
.yh-breadcrumb .sep { color: var(--yh-sep); }
.yh-breadcrumb .current { color: var(--yh-text); font-weight: 600; }

.yh-content {
  min-height: 60vh;
  border: 1px solid var(--yh-border);
  border-radius: 14px;
  padding: 32px 40px 56px;
  background: var(--yh-surface);
  transition: background-color .25s ease;
}
.yh-loading { display: flex; align-items: center; justify-content: center; padding: 80px 0; }

/* doc-article tipografisi */
.doc-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--yh-border);
  scroll-margin-top: calc(var(--yh-header-h) + 16px);
}
.doc-section { scroll-margin-top: calc(var(--yh-header-h) + 16px); margin-bottom: 8px; }
.doc-section h2 {
  font-size: 1.32rem;
  font-weight: 700;
  margin: 36px 0 14px;
  padding-top: 8px;
  scroll-margin-top: calc(var(--yh-header-h) + 16px);
  color: var(--yh-text);
}
.doc-section:first-of-type h2 { margin-top: 8px; }
.doc-section h3 {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 26px 0 10px;
  color: var(--yh-text);
  scroll-margin-top: calc(var(--yh-header-h) + 16px);
}
.doc-section h4 {
  font-size: .96rem;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--yh-text-muted);
  scroll-margin-top: calc(var(--yh-header-h) + 16px);
}
.doc-article { overflow-wrap: break-word; }
.doc-article p { line-height: 1.7; margin: 0 0 14px; color: var(--yh-body); }
.doc-article ul, .doc-article ol { line-height: 1.7; color: var(--yh-body); margin: 0 0 14px; padding-left: 24px; }
.doc-article li { margin-bottom: 4px; }
.doc-article li > ul, .doc-article li > ol { margin-top: 4px; margin-bottom: 4px; }
.doc-article strong { color: var(--yh-text); font-weight: 700; }
.doc-article code {
  overflow-wrap: anywhere;
  background: var(--yh-code-bg);
  border: 1px solid var(--yh-border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: .86em;
  color: var(--yh-code-text);
}

.doc-article img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--yh-border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, .08);
  margin: 4px 0 20px;
  cursor: zoom-in;
  transition: box-shadow .15s ease;
}
.doc-article img:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, .14); }

.yh-lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.yh-lightbox.show { display: flex; }
.yh-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.yh-lightbox-close {
  position: absolute;
  top: 20px; right: 28px;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  background: none;
  border: none;
  cursor: pointer;
  opacity: .85;
}
.yh-lightbox-close:hover { opacity: 1; }

.doc-table { font-size: .9rem; }
.doc-table th { background: var(--yh-primary-soft); color: var(--yh-text); font-weight: 700; white-space: nowrap; }
.doc-table td, .doc-table th { padding: 9px 12px; vertical-align: top; }

/* Callout kutuları (Not / Dikkat / Uyarı) */
.callout {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 4px 0 18px;
  border: 1px solid;
  display: flex;
  gap: 12px;
  font-size: .93rem;
  line-height: 1.6;
}
.callout p:last-child { margin-bottom: 0; }
.callout::before {
  font-family: "bootstrap-icons";
  font-size: 1.1rem;
  line-height: 1.6;
  flex-shrink: 0;
}
.callout-note {
  background: var(--yh-note-bg);
  border-color: var(--yh-note-border);
  color: var(--yh-note-text);
}
.callout-note::before { content: "\f431"; color: var(--yh-primary); } /* info-circle */
.callout-warning {
  background: var(--yh-warn-bg);
  border-color: var(--yh-warn-border);
  color: var(--yh-warn-text);
}
.callout-warning::before { content: "\f33a"; color: #d97706; } /* exclamation-triangle */

/* Sık Karşılaşılan Durumlar bölümü — ipucu görünümü */
.tips-section > ul { list-style: none; padding-left: 0; }
.tips-section > ul > li {
  position: relative;
  padding: 10px 16px 10px 40px;
  margin-bottom: 8px;
  background: var(--yh-tip-bg);
  border: 1px solid var(--yh-border);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
}
.tips-section > ul > li::before {
  content: "\f335";
  font-family: "bootstrap-icons";
  position: absolute;
  left: 14px;
  top: 10px;
  color: #f59e0b;
}

/* Overview / hoş geldiniz sayfası */
.yh-overview-lead { font-size: 1.02rem; color: var(--yh-body); line-height: 1.75; margin-bottom: 28px; }
.yh-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.yh-overview-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--yh-border);
  border-radius: 12px;
  color: var(--yh-text);
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
.yh-overview-card:hover {
  border-color: var(--yh-primary);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .12);
  text-decoration: none;
  transform: translateY(-1px);
}
.yh-overview-card .yh-oc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--yh-primary-soft);
  color: var(--yh-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.yh-overview-card .yh-oc-title { font-weight: 700; margin-bottom: 2px; }
.yh-overview-card .yh-oc-sub { font-size: .8rem; color: var(--yh-text-muted); }

/* Anchor highlight (deep-link'ten gelindiğinde kısa süreli vurgu) */
@keyframes yh-flash {
  0% { background-color: var(--yh-flash); }
  100% { background-color: transparent; }
}
.yh-flash { animation: yh-flash 1.8s ease-out; border-radius: 6px; }

/* ---------- Footer ---------- */
.yh-footer { border-top: 1px solid var(--yh-border); background: var(--yh-footer-bg); margin-top: 24px; }
.yh-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--yh-text-muted);
}
.yh-footer-inner a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  /* align-items: flex-start dikey düzende içeriğin min-content genişliğine
     büyümesine izin veriyordu (yatay taşmanın kaynağı) — mobilde stretch'e dön */
  .yh-layout { flex-direction: column; align-items: stretch; }
  .yh-content-wrap { width: 100%; max-width: 100%; }
  .yh-sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    width: 82vw;
    max-width: 340px;
    background: var(--yh-surface);
    padding: 20px;
    box-shadow: 4px 0 24px rgba(0,0,0,.15);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .yh-sidebar.open { transform: translateX(0); }
  .yh-sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .4);
    z-index: 55;
  }
  .yh-sidebar-backdrop.show { display: block; }
  .yh-content { padding: 24px 20px 40px; }
}

@media (max-width: 575.98px) {
  .yh-header-inner { padding: 0 16px; gap: 10px; }
  .yh-hero { padding: 32px 16px 28px; }
  .yh-hero h1 { font-size: 1.6rem; }
  .yh-header-nav .btn span { display: none; }
  .yh-header-nav .btn { padding: 8px 10px; }
  .yh-index-label-inner { padding: 10px 16px; }
  .yh-main { padding: 16px 12px; }
  .yh-content { padding: 20px 14px 32px; border-radius: 12px; }
  .doc-title { font-size: 1.45rem; }
  .doc-section h2 { font-size: 1.18rem; }
  /* iOS, 16px altındaki inputlara odaklanınca sayfayı yakınlaştırır */
  .yh-search input { font-size: 1rem; min-width: 0; }
  .yh-search { padding: 6px 6px 6px 12px; gap: 8px; }
  .yh-lightbox { padding: 12px; }
  .yh-lightbox-close { top: 10px; right: 14px; }
  .yh-overview-grid { grid-template-columns: 1fr; }
}
