/* MR Ders Kiti — katman ve simülasyon stilleri */
:root { --l-sezgi:#f4a261; --l-fizik:#e76f51; --l-mat:#2a9d8f; --l-gorsel:#8ab17d; --l-sim:#457b9d; --l-kod:#6d597a; --l-quiz:#e9c46a; --l-esma:#a8740a; --card:#fff; --ink:#222; --muted:#666; --line:#e6e6e6; }
/* Site yalnız açık temalıdır: işletim sistemi koyu modda olsa da sayfa beyaz kalır. Koyu renkler yalnız Quarto koyu teması
   etkinken (body.quarto-dark) devreye girer; prefers-color-scheme'e bakmak beyaz sayfada soluk yazı üretir. */
.quarto-dark { --card:#1e1e22; --ink:#e8e8e8; --muted:#aaa; --line:#3a3a40; --l-esma:#e9c46a; }

.step { border-left: 4px solid var(--line); padding: .2rem 0 .2rem 1rem; margin: 2.2rem 0; }
.step h3 { margin-top: 0; }
.step h3 .stepno { font-family: monospace; color: var(--muted); font-weight: 400; margin-right:.4rem; }
.layer { border: 1px solid var(--line); border-left-width: 5px; border-radius: 6px; padding: .55rem .9rem; margin: .6rem 0; background: var(--card); }
.layer .lt { display:block; font-size: .72rem; letter-spacing:.08em; text-transform: uppercase; color: var(--muted); margin-bottom:.25rem; font-weight:600; }
.layer.sezgi { border-left-color: var(--l-sezgi); }
.layer.fizik { border-left-color: var(--l-fizik); }
.layer.mat   { border-left-color: var(--l-mat); }
.layer.gorsel{ border-left-color: var(--l-gorsel); }
.layer.sim   { border-left-color: var(--l-sim); }
.layer.kod   { border-left-color: var(--l-kod); }
.layer p:last-child { margin-bottom: 0; }
.layer table { font-size: .9rem; margin: .4rem 0; }
.layer table td, .layer table th { padding: .15rem .5rem; }
.anlam { font-size: .92rem; color: var(--muted); margin: .2rem 0 0 .4rem; }
.anlam b { color: var(--ink); }

/* simülasyon */
.mrsim-root { display: grid; grid-template-columns: 250px 1fr; gap: .8rem; border: 1px solid var(--line); border-radius: 8px; padding: .7rem; background: var(--card); }
.mrsim-root .mrsim-ctrl { display:flex; flex-direction:column; gap:.35rem; font-size:.88rem; }
.mrsim-root .mrsim-view { min-width: 0; display:flex; flex-wrap:wrap; gap:.5rem; align-items:flex-start; }
.mrsim-root .mrsim-info { grid-column: 1 / -1; font-size:.88rem; color: var(--muted); }
.mrsim-row { display:flex; flex-direction:column; }
.mrsim-row label { font-weight: 600; }
.mrsim-val { font-weight: 400; color: var(--l-sim); font-family: monospace; }
.mrsim-row input[type=range] { width: 100%; }
.mrsim-btn { border: 1px solid var(--l-sim); background: transparent; color: var(--l-sim); border-radius: 5px; padding: .25rem .7rem; cursor: pointer; font-size:.85rem; margin:.15rem .2rem .15rem 0; }
.mrsim-btn:hover { background: var(--l-sim); color:#fff; }
.mrsim-canvas { background: transparent; border-radius: 6px; touch-action: none; max-width:100%; }
.mrsim-plot { flex: 1 1 320px; min-width: 280px; }
.mrsim-readout { font-family: monospace; font-size: .85rem; background: rgba(69,123,157,.08); padding:.4rem .5rem; border-radius:5px; white-space: pre-line; }
.mrsim-missing { color: #b00; font-family: monospace; }
@media (max-width: 720px) { .mrsim-root { grid-template-columns: 1fr; } }

/* mini soru */
.quiz { border: 1px dashed var(--l-quiz); border-radius: 6px; padding: .6rem .9rem; margin: .6rem 0; background: rgba(233,196,106,.08); }
.quiz .q { font-weight: 600; margin-bottom:.35rem; }
.quiz .opt { display:block; cursor:pointer; padding:.2rem .5rem; border-radius:4px; margin:.1rem 0; }
.quiz .opt:hover { background: rgba(233,196,106,.25); }
.quiz .opt.sel { outline: 2px solid var(--l-quiz); }
.quiz .opt::before { content: attr(data-key) ") "; font-weight:600; color: var(--muted); }
.quiz-row { display:flex; gap:.4rem; align-items:center; }
.quiz-num { width: 9rem; padding:.2rem .4rem; }
.quiz-fb { margin-top:.4rem; font-size:.92rem; }
.quiz-fb.ok { color:#2a9d8f; } .quiz-fb.no { color:#e76f51; }

/* kod deneyi */
.js-run { margin: .4rem 0; }
.js-src { width:100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size:.82rem; background: rgba(109,89,122,.07); border:1px solid var(--line); border-radius:5px; padding:.5rem; color: var(--ink); }
.js-out:empty { display:none; }
.js-out { background: #111; color:#9be7a0; font-size:.8rem; padding:.5rem; border-radius:5px; min-height:1.6rem; white-space:pre-wrap; }

/* harita */
.chain p { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; margin:0; }
.chain { display:flex; flex-wrap:wrap; gap:.35rem; align-items:center; font-size:.85rem; }
.chain span { background: rgba(69,123,157,.12); border-radius: 999px; padding:.15rem .6rem; }
.chain i { color: var(--muted); font-style: normal; }

/* sayfa düzeni: sağdaki "Adımlar" (TOC) kaldırıldı; sol "Öğrenme Haritası" göster/gizle (assets/js/sidebar-toggle.js) */
#quarto-margin-sidebar { display: none; }
@media (min-width: 992px) {
  body.docked #quarto-content.page-columns {
    grid-template-columns:
      [screen-start screen-start-inset page-start page-start-inset body-start-outset] 250px
      [body-start] minmax(2em, 1fr)
      [body-content-start] minmax(0, 1100px)
      [body-content-end] minmax(2em, 1fr)
      [body-end body-end-outset page-end-inset page-end screen-end-inset screen-end];
  }
  html.mr-sidebar-hidden body.docked #quarto-content.page-columns {
    grid-template-columns:
      [screen-start screen-start-inset page-start page-start-inset body-start-outset body-start] minmax(2em, 1fr)
      [body-content-start] minmax(0, 1100px)
      [body-content-end] minmax(2em, 1fr)
      [body-end body-end-outset page-end-inset page-end screen-end-inset screen-end];
  }
  html.mr-sidebar-hidden #quarto-sidebar { display: none !important; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  body.docked #quarto-content.page-columns {
    grid-template-columns:
      [screen-start] 1.5em
      [screen-start-inset page-start page-start-inset body-start-outset body-start body-content-start] minmax(0, 1fr)
      [body-content-end body-end body-end-outset page-end-inset page-end screen-end-inset] 1.5em
      [screen-end];
  }
}
.mr-sidebar-toggle { display: none; }
@media (min-width: 992px) {
  .mr-sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; margin-right: 1rem; padding: .3rem .45rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: 6px; background: transparent; color: inherit; line-height: 1; cursor: pointer; }
  .mr-sidebar-toggle:hover { background: rgba(69,123,157,.10); }
  .mr-sidebar-toggle:focus-visible { outline: 2px solid var(--l-sim); outline-offset: 2px; }
  .mr-sidebar-toggle .bi { font-size: 1.05rem; }
}

/* yan yana görseller (::: {.fig-row}) */
.fig-row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: center; margin: .6rem 0; }
.fig-row > * { flex: 1 1 260px; max-width: 400px; margin: 0; }
.fig-row svg { display: block; width: 100%; height: auto; }
.chain span.on { background: var(--l-sim); color: #fff; font-weight: 700; }

/* uzun denklemler dar ekranda sayfayı yana taşırmasın; kendi kutularında kaysın (geniş ekranda dokunulmaz) */
@media (max-width: 767.98px) {
  mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: .8em 0; }
}

/* Akış sayfası (akis.qmd): aşama kutuları, girdi/çıktı tabloları, veri görüntüleri */
.akis-stage { border-left: 4px solid var(--l-sim); padding: .2rem 0 .2rem 1rem; margin: 2rem 0; }
.akis-stage.loop { border-left-color: var(--l-fizik); }
.akis-stage h3 { margin-top: 0; }
.akis-stage table { font-size: .92rem; }
.akis-stage table td:first-child { white-space: nowrap; }
/* bilgisayarın o andaki belleği (::: {.akis-mem .g0|.gw|.g1|.g2|.g3}); simge k-uzayı tablosu: boş, bu turun satırı bekleniyor, yazıldı, dolu, görüntü */
.akis-mem { position: relative; margin: .9rem 0 .4rem; padding: .5rem .8rem .5rem 3.2rem; min-height: 2.6rem; border: 1px solid var(--line); border-left: 4px solid var(--l-mat); border-radius: 6px; background: rgba(42,157,143,.07); font-size: .92rem; }
.akis-mem p { margin: 0; }
.akis-mem::before { content: ""; position: absolute; left: .75rem; top: 50%; width: 28px; height: 20px; margin-top: -10px; border: 1px solid var(--l-mat); border-radius: 2px;
  background: repeating-linear-gradient(to bottom, var(--card) 0 3px, var(--line) 3px 4px); }
.akis-mem.gw::before { background: linear-gradient(to bottom, rgba(42,157,143,.55) 0 8px, rgba(231,111,81,.22) 8px 12px, transparent 12px), repeating-linear-gradient(to bottom, var(--card) 0 3px, var(--line) 3px 4px); }
.akis-mem.g1::before { background: linear-gradient(to bottom, rgba(42,157,143,.55) 0 8px, var(--l-fizik) 8px 12px, transparent 12px), repeating-linear-gradient(to bottom, var(--card) 0 3px, var(--line) 3px 4px); }
.akis-mem.g2::before { background: repeating-linear-gradient(to bottom, rgba(42,157,143,.55) 0 3px, var(--card) 3px 4px); }
.akis-mem.g3::before { width: 24px; height: 24px; margin-top: -12px; left: .95rem; background: url(../img/akis/a7_goruntu.png) center / cover; }
/* k-uzayının tur tur dolması: o turda yazılan satırı gösteren turuncu çizgi */
.akis-kwrap { position: relative; }
.akis-kwrap .akis-row { position: absolute; left: -7px; right: -7px; height: 2px; margin-top: -1px; background: var(--l-fizik); }
.akis-imgs.akis-recon { align-items: center; }
.akis-to { width: 7rem; text-align: center; font-size: .85rem; line-height: 1.3; color: var(--muted); }
.akis-to b { display: block; font-size: 1.9rem; line-height: 1; font-weight: 400; color: var(--ink); }
.akis-imgs { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; justify-content: center; margin: .8rem 0 1rem; }
.akis-im { width: 168px; text-align: center; font-size: .82rem; line-height: 1.3; }
.akis-im img { width: 168px; height: 168px; display: block; border-radius: 4px; }
.akis-im.akis-big { width: 256px; }
.akis-im.akis-big img { width: 256px; height: 256px; }
.akis-cap { margin-top: .35rem; }
.akis-cbar { height: 7px; margin-top: .35rem; border-radius: 2px; border: 1px solid var(--line); background: linear-gradient(to right, #000, #fff); }
.akis-cbar-lab { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.akis-derste { display: block; font-size: .86rem; color: var(--muted); margin-top: .4rem; }

/* Esmâ sayfası (esma.qmd, tools/gen_esma.py): her sayfa tek SVG; ileri/geri düğmeleri, noktalar, ← → tuşları.
   Betik çalışmazsa (ya da yazdırılırken) bütün sayfalar alt alta görünür. */
.esma-deck { margin: .2rem 0 1.5rem; }
.esma-slide svg { display: block; width: 100%; height: auto; max-width: 1000px; margin: 0 auto; }
.esma-anim { position: relative; max-width: 1000px; margin: 0 auto; }   /* giriş sayfası: SVG çerçeve + üstünde canvas */
.esma-anim > canvas { position: absolute; display: block; border-radius: 1.33% / 2.42%; }
.esma-deck:not(.esma-js) .esma-slide { margin-bottom: 1.2rem; }
.esma-js .esma-slide { display: none; }
.esma-js .esma-slide.on { display: block; }
.esma-deck:not(.esma-js) .esma-bar { display: none; }
.esma-bar { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .75rem 0 .45rem; }
.esma-btn { border: 1px solid var(--l-sim); background: transparent; color: var(--l-sim); border-radius: 6px; padding: .4rem 1rem; font-size: .95rem; cursor: pointer; min-width: 8.5rem; }
.esma-btn:hover:not(:disabled) { background: var(--l-sim); color: #fff; }
.esma-btn:disabled { opacity: .35; cursor: default; }
.esma-btn:focus-visible { outline: 2px solid var(--l-sim); outline-offset: 2px; }
.esma-mid { display: flex; flex-direction: column; align-items: center; min-width: 13rem; line-height: 1.25; }
.esma-count { font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 600px) {           /* dar ekran: düğmeler ve sayaç satıra sığsın */
  .esma-bar { gap: .5rem; }
  .esma-btn { min-width: 0; flex: 1 1 0; padding: .4rem .6rem; white-space: nowrap; }
  .esma-mid { min-width: 0; flex: 0 0 auto; }
}
.esma-link { cursor: pointer; outline: none; }
.esma-go:hover rect, .esma-go:focus-visible rect { fill-opacity: .22; }
.esma-ders:hover text, .esma-ders:focus-visible text { text-decoration: underline; }
/* alttaki İsimler şeridi: kapalıyken tamamen görünmez (yalnız tıklanabilir boş alan, ipucu yok);
   o alana tıklayınca zemini ve içeriğiyle açılır */
.esma-band { cursor: pointer; outline: none; }
.esma-band > rect { transition: fill-opacity .25s, stroke-opacity .25s; }
.esma-band.open:hover > rect { fill-opacity: .14; }
.esma-reveal { transition: opacity .3s; }
.esma-js .esma-band:not(.open) > rect { fill-opacity: 0; stroke-opacity: 0; }
.esma-js .esma-band:not(.open):focus-visible > rect { stroke-opacity: .5; }
.esma-js .esma-band:not(.open) .esma-reveal { opacity: 0; visibility: hidden; }
/* kapalı şeridin yerini gösteren yıldız (giriş sayfalarındaki başlık yanı şeritler): tıklanınca kaybolur */
.esma-hint { opacity: .9; }
.esma-band.open .esma-hint, .esma-deck:not(.esma-js) .esma-hint { opacity: 0; visibility: hidden; }
@media print {
  .esma-js .esma-slide { display: block !important; break-inside: avoid; margin-bottom: 1rem; }
  .esma-bar { display: none !important; }
  .esma-reveal { opacity: 1 !important; visibility: visible !important; }
  .esma-hint { display: none !important; }
}

/* yazdırma ve PDF (tools/export_pdf.py): yalnız ders içeriği; üst çubuk, gezinti ve düğmeler basılmaz */
@media print {
  #quarto-header, .quarto-secondary-nav, #quarto-search, #quarto-back-to-top, .nav-footer, .anchorjs-link, .mrsim-btn { display: none !important; }
  body { padding-top: 0 !important; }
  #quarto-content { margin-top: 0 !important; }
  h2, .step h3 { break-after: avoid; }
  .mrsim-root, .fig-row, table { break-inside: avoid; }
}
