/* Bölüm 08: dosya işlemleri şemaları (kalıcılık, open(), imleç, tampon, kipler, yollar, bayt, akış). */
.reveal .slides section.slide.level1:not(#title-slide) > h1 {
  font-size: 1.7em;
}

/* ---- ortak parçalar ---- */
.ip8-chip,
.ip8-file {
  display: inline-block;
  padding: 0.25em 0.6em;
  border: 1px solid #107895;
  border-radius: 0.25em;
  background: #eaf5f8;
  color: #164c61;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}

.ip8-file {
  border-color: #287d5b;
  background: #e1f2e8;
  color: #1b6448;
}

.ip8-arrow { color: #107895; font-weight: 700; }

/* ---- 1. bellek ve dosya ---- */
.ip8-persist {
  width: min(100%, 36em);
  margin: 1em auto;
  font-size: 0.95em;
}

.ip8-persist-lane {
  display: grid;
  grid-template-columns: 5.2em minmax(0, 1fr) 1.4em minmax(0, 1fr);
  align-items: center;
  gap: 0.5em;
  margin: 0.6em 0;
  padding: 0.55em 0.7em;
  border-radius: 0.35em;
  background: #f4f7f9;
}

.ip8-persist-lane > strong { color: #42566a; }

.ip8-persist-lane .ip8-gone,
.ip8-persist-lane .ip8-kept {
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
  font-size: 0.85em;
}

.ip8-gone { background: #fbe9e6; color: #8f2f24; text-decoration: line-through; }
.ip8-kept { background: #e1f2e8; color: #1b6448; }

/* ---- 2. open() çağrısının parçaları ---- */
.ip8-anatomy {
  width: min(100%, 40em);
  margin: 1em auto;
  font-size: 0.9em;
}

.ip8-anatomy-code {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2em;
  margin-bottom: 0.7em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15em;
}

.ip8-anatomy-code span {
  padding: 0.1em 0.45em;
  border-bottom: 3px solid currentColor;
}

.ip8-anatomy-labels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5em;
}

.ip8-anatomy-labels > div {
  padding: 0.45em 0.55em;
  border-top: 3px solid currentColor;
  border-radius: 0.2em;
  background: #f4f7f9;
  font-size: 0.82em;
  line-height: 1.35;
}

.ip8-anatomy-labels b { display: block; color: inherit; }
.ip8-anatomy-labels span { color: #42566a; }

.ip8-yol { color: #107895; }
.ip8-kip { color: #7542b4; }
.ip8-kod { color: #b0701a; }
.ip8-nesne { color: #287d5b; }

/* ---- 3. imleç ---- */
.ip8-cursor {
  width: min(100%, 40em);
  margin: 0.8em auto;
  font-size: 0.85em;
}

.ip8-cursor-row {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr) 7.5em;
  align-items: center;
  gap: 0.6em;
  margin: 0.4em 0;
}

.ip8-call {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #164c61;
  text-align: right;
}

.ip8-cells {
  display: flex;
  align-items: center;
}

.ip8-cells .c {
  display: inline-block;
  width: 1.55em;
  height: 1.75em;
  border: 1px solid #c9d6dd;
  border-right-width: 0;
  background: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.75em;
  text-align: center;
}

.ip8-cells .c:last-child { border-right-width: 1px; }
.ip8-cells .c.nl { color: #9aaeb8; }
.ip8-cells .c.r { background: #cfe9f0; color: #164c61; }
.ip8-cells .c.cur { box-shadow: inset 3px 0 0 #d1492e; }
.ip8-cells .c.end { box-shadow: inset -3px 0 0 #d1492e; }

.ip8-pos {
  color: #42566a;
  font-size: 0.9em;
}

.ip8-pos code { color: #164c61; }

@keyframes ip8-row-in {
  from { opacity: 0; transform: translateY(0.3em); }
  to   { opacity: 1; transform: none; }
}

.reveal .slides section.present .ip8-cursor-row { animation: ip8-row-in 0.45s both; }
.reveal .slides section.present .ip8-cursor-row:nth-child(2) { animation-delay: 0.3s; }
.reveal .slides section.present .ip8-cursor-row:nth-child(3) { animation-delay: 0.6s; }
.reveal .slides section.present .ip8-cursor-row:nth-child(4) { animation-delay: 0.9s; }

/* ---- tablolar ---- */
.ip8-table {
  width: 100%;
  margin: 0.8em auto;
  border-collapse: collapse;
  font-size: 0.85em;
}

.ip8-table th,
.ip8-table td {
  padding: 0.4em 0.6em;
  border-bottom: 1px solid #dbe4e9;
  text-align: left;
  vertical-align: top;
}

.ip8-table th {
  border-bottom: 2px solid #107895;
  color: #164c61;
  font-weight: 650;
}

.ip8-table td:first-child { white-space: nowrap; }

.ip8-table .ok { color: #1b6448; font-weight: 600; }
.ip8-table .no { color: #8c9aa5; }
.ip8-table .bad { color: #8f2f24; font-weight: 600; }
.ip8-table .warn { color: #9a5a00; font-weight: 600; }

/* ---- 4. tampon ---- */
.ip8-buffer {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 4em minmax(0, 1fr) 4em minmax(0, 1fr);
  align-items: center;
  gap: 0.3em;
  width: min(100%, 42em);
  margin: 1em auto;
  font-size: 0.85em;
}

.ip8-buffer-box {
  min-height: 6.2em;
  padding: 0.5em 0.6em;
  border: 2px solid #9aaeb8;
  border-radius: 0.4em;
  background: #f4f7f9;
}

.ip8-buffer-box strong {
  display: block;
  margin-bottom: 0.35em;
  color: #42566a;
  font-size: 0.9em;
}

.ip8-buffer-box code {
  display: block;
  margin: 0.15em 0;
  padding: 0.05em 0.35em;
  background: #fff;
  font-size: 0.85em;
  white-space: nowrap;
}

.ip8-buffer-box.tampon { border-color: #d49a2c; background: #fff6e2; }
.ip8-buffer-box.disk { border-color: #287d5b; background: #e8f5ee; }

.ip8-buffer-link {
  color: #164c61;
  font-size: 0.78em;
  line-height: 1.3;
  text-align: center;
}

.ip8-buffer-link b { display: block; font-size: 1.4em; color: #107895; }

/* ---- 5. with akışı ---- */
.ip8-with {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5em;
  width: min(100%, 40em);
  margin: 1em auto;
  font-size: 0.85em;
}

.ip8-with-step {
  position: relative;
  padding: 0.55em 0.6em;
  border: 1px solid #9aaeb8;
  border-radius: 0.35em;
  background: #f4f7f9;
  line-height: 1.35;
  text-align: center;
}

.ip8-with-step b { display: block; color: #164c61; }
.ip8-with-step.err { border-color: #c9533f; background: #fbe9e6; }
.ip8-with-step.err b { color: #8f2f24; }
.ip8-with-step.done { border-color: #287d5b; background: #e1f2e8; }
.ip8-with-step.done b { color: #1b6448; }

.ip8-with-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -0.72em;
  transform: translateY(-50%);
  color: #107895;
  font-weight: 700;
}

.ip8-with-note {
  grid-column: 1 / -1;
  margin: 0;
  color: #42566a;
  font-size: 0.9em;
  text-align: center;
}

/* ---- 6. kip etkisi ---- */
.ip8-effect {
  width: min(100%, 38em);
  margin: 1em auto;
  font-size: 0.85em;
}

.ip8-effect-lane {
  display: grid;
  grid-template-columns: 4em minmax(0, 1fr) 2.2em minmax(0, 1fr);
  align-items: center;
  gap: 0.5em;
  margin: 0.6em 0;
}

.ip8-effect-lane > strong {
  padding: 0.15em 0.4em;
  border-radius: 0.25em;
  background: #ece3f6;
  color: #5a2f8c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.ip8-strip {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
  min-height: 4.4em;
  padding: 0.4em 0.5em;
  border: 1px solid #c9d6dd;
  border-radius: 0.3em;
  background: #fff;
}

.ip8-strip span {
  padding: 0.05em 0.4em;
  border-radius: 0.15em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.ip8-strip .old { background: #eef1f3; color: #55656f; }
.ip8-strip .new { background: #cfe9f0; color: #164c61; }
.ip8-strip .gone { background: #fbe9e6; color: #8f2f24; text-decoration: line-through; }
.ip8-strip .empty { color: #9aaeb8; font-style: italic; }

/* ---- 7. dizin ağacı ve yollar ---- */
.ip8-paths {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.2em;
  align-items: start;
  width: min(100%, 44em);
  margin: 1em auto;
  font-size: 0.85em;
}

.ip8-tree {
  padding: 0.6em 0.8em;
  border-radius: 0.4em;
  background: #f4f7f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  line-height: 1.75;
}

.ip8-tree .d1 { padding-left: 1.4em; }
.ip8-tree .d2 { padding-left: 2.8em; }
.ip8-tree .dir { color: #7542b4; font-weight: 700; }
.ip8-tree .cwd { padding: 0 0.3em; border-radius: 0.2em; background: #ffe8b8; }
.ip8-tree .src { color: #107895; font-weight: 700; }
.ip8-tree small {
  margin-left: 0.6em;
  color: #6a7a85;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8em;
}

.ip8-pathlist { display: grid; gap: 0.45em; }

.ip8-pathlist > div {
  padding: 0.35em 0.6em;
  border-left: 4px solid #107895;
  border-radius: 0.2em;
  background: #f4f7f9;
  line-height: 1.35;
}

.ip8-pathlist > div.abs { border-left-color: #b0701a; }
.ip8-pathlist small { display: block; color: #55656f; }
.ip8-pathlist code { color: #164c61; }

/* ---- 8. karakter ve bayt ---- */
.ip8-bytes {
  width: min(100%, 36em);
  margin: 1em auto;
  font-size: 0.9em;
}

.ip8-bytes-grid {
  display: grid;
  grid-template-columns: 6.5em repeat(8, minmax(0, 1fr));
  gap: 0.25em;
  margin: 0.3em 0;
  align-items: center;
  text-align: center;
}

.ip8-bytes-grid > strong {
  color: #42566a;
  font-size: 0.82em;
  text-align: right;
  padding-right: 0.4em;
}

.ip8-bytes-grid .ch,
.ip8-bytes-grid .by {
  padding: 0.3em 0;
  border-radius: 0.25em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.ip8-bytes-grid .ch { grid-column: span 1; background: #eaf5f8; color: #164c61; font-size: 1.15em; }
.ip8-bytes-grid .ch.w2 { grid-column: span 2; background: #fff0d1; color: #8a5200; }
.ip8-bytes-grid .by { border: 1px solid #c9d6dd; background: #fff; font-size: 0.85em; }
.ip8-bytes-grid .by.two { background: #fff0d1; border-color: #e0b567; }

.ip8-bytes-count {
  margin: 0.5em 0 0;
  color: #42566a;
  font-size: 0.9em;
  text-align: center;
}

/* ---- 9. uygulama akışı ---- */
.ip8-pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.6em minmax(0, 1.15fr) 1.6em minmax(0, 1fr);
  align-items: stretch;
  gap: 0.35em;
  width: min(100%, 46em);
  margin: 1em auto;
  font-size: 0.82em;
}

.ip8-pipeline-box {
  padding: 0.55em 0.7em;
  border: 2px solid #9aaeb8;
  border-radius: 0.4em;
  background: #f4f7f9;
  line-height: 1.4;
}

.ip8-pipeline-box > strong { display: block; margin-bottom: 0.3em; color: #164c61; }
.ip8-pipeline-box code { display: block; padding: 0.05em 0.3em; background: #fff; font-size: 0.88em; }
.ip8-pipeline-box.girdi { border-color: #107895; background: #eaf5f8; }
.ip8-pipeline-box.cikti { border-color: #287d5b; background: #e8f5ee; }
.ip8-pipeline-box ol { margin: 0; padding-left: 1.2em; }
.ip8-pipeline-box li code { display: inline; padding: 0 0.2em; }
.ip8-pipeline-arrow { align-self: center; color: #107895; font-size: 1.4em; font-weight: 700; text-align: center; }

/* ---- sunum ölçeği ---- */
.reveal .ip8-persist,
.reveal .ip8-anatomy,
.reveal .ip8-with,
.reveal .ip8-effect,
.reveal .ip8-bytes { font-size: 0.95em; }

.reveal .ip8-cursor,
.reveal .ip8-buffer,
.reveal .ip8-paths,
.reveal .ip8-pipeline { font-size: 0.85em; }

.reveal .ip8-table { font-size: 0.85em; }

@media (prefers-reduced-motion: reduce) {
  .reveal .slides section.present .ip8-cursor-row { animation: none; }
}

@media (max-width: 640px) {
  .ip8-persist-lane,
  .ip8-effect-lane { grid-template-columns: 1fr; text-align: center; }
  .ip8-anatomy-labels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ip8-cursor-row { grid-template-columns: 1fr; }
  .ip8-call { text-align: left; }
  .ip8-cells { flex-wrap: wrap; }
  .ip8-buffer,
  .ip8-pipeline { grid-template-columns: 1fr; }
  .ip8-buffer-link b,
  .ip8-pipeline-arrow { transform: rotate(90deg); }
  .ip8-with { grid-template-columns: 1fr 1fr; }
  .ip8-with-step:not(:last-child)::after { content: none; }
  .ip8-paths { grid-template-columns: 1fr; }
  .ip8-table { display: block; overflow-x: auto; }
}
