/* NFPA 13 engel kuralları: 3B sahneler (js/obstruction-viz.js).
   v7 "Kor · modern dark": figür, iç sayfa tasarımındaki .viz-pencere gibi bir ürün penceresi olarak görünür
   (üst çubuk: 3 nokta + adres + CANLI rozeti, koyu sahne, ince sınır, üst kenar ışığı). İşaretleme
   eklenmez: çubuk figure::before, adres figure::after, rozet .oviz-stage::after ile çizilir.
   Renkler css/sd/00-temel.css token'larından. */
.oviz {
  --o-ok: var(--ok, oklch(0.86 0.13 165));
  --o-bad: var(--bad, oklch(0.72 0.17 25));
  --o-na: oklch(0.78 0.01 270);
  --o-line: var(--border, oklch(1 0 0 / 0.08));
  --o-stage: #07060f;
  position: relative;
  margin: 2em 0 2.2em;
  border-radius: 18px;
  border: 1px solid var(--border-strong, oklch(1 0 0 / 0.14));
  background: linear-gradient(180deg, oklch(0.185 0.006 270), oklch(0.15 0.005 270));
  box-shadow: var(--shadow-2xl, 0 50px 100px -30px oklch(0 0 0 / 0.85));
  overflow: hidden;
}
figure.oviz { margin: 2em 0 2.2em; }   /* .post-content figure (0,1,1) boşluğunu ezer */

/* Pencere üst çubuğu: üç nokta (radyal gradyan) + üst kenar ışığı */
.oviz::before {
  content: "";
  display: block; height: 40px;
  border-bottom: 1px solid var(--border, oklch(1 0 0 / 0.08));
  background:
    radial-gradient(circle at 20px 50%, oklch(1 0 0 / 0.13) 0 5.5px, transparent 6px),
    radial-gradient(circle at 38px 50%, oklch(1 0 0 / 0.13) 0 5.5px, transparent 6px),
    radial-gradient(circle at 56px 50%, oklch(1 0 0 / 0.13) 0 5.5px, transparent 6px),
    linear-gradient(180deg, oklch(1 0 0 / 0.05), transparent),
    oklch(0.16 0.005 270 / 0.92);
}
/* Adres hapı (yalnız görünüm; ekran okuyucuya gitmez) */
.oviz::after {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 2;
  max-width: calc(100% - 200px);
  padding: 3px 12px 3px 28px; border-radius: 8px;
  border: 1px solid var(--border, oklch(1 0 0 / 0.08));
  background:
    radial-gradient(circle at 14px 50%, var(--accent) 0 2.5px, oklch(0.80 0.15 62 / 0.35) 3.5px, transparent 4.5px),
    oklch(1 0 0 / 0.04);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5; letter-spacing: 0;
  color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
  content: "selvi.org · NFPA 13 · 3B";
  content: "selvi.org · NFPA 13 · 3B" / "";
}
.oviz[data-oviz="beam"]::after { content: "selvi.org · NFPA 13 · kiriş kuralı · 3B"; content: "selvi.org · NFPA 13 · kiriş kuralı · 3B" / ""; }
.oviz[data-oviz="three"]::after { content: "selvi.org · NFPA 13 · üç kat kuralı · 3B"; content: "selvi.org · NFPA 13 · üç kat kuralı · 3B" / ""; }
:lang(en) .oviz::after { content: "selvi.org · NFPA 13 · 3D"; content: "selvi.org · NFPA 13 · 3D" / ""; }
:lang(es) .oviz::after { content: "selvi.org · NFPA 13 · 3D"; content: "selvi.org · NFPA 13 · 3D" / ""; }
:lang(en) .oviz[data-oviz="beam"]::after { content: "selvi.org · NFPA 13 · beam rule · 3D"; content: "selvi.org · NFPA 13 · beam rule · 3D" / ""; }
:lang(es) .oviz[data-oviz="beam"]::after { content: "selvi.org · NFPA 13 · regla de vigas · 3D"; content: "selvi.org · NFPA 13 · regla de vigas · 3D" / ""; }
:lang(en) .oviz[data-oviz="three"]::after { content: "selvi.org · NFPA 13 · three times rule · 3D"; content: "selvi.org · NFPA 13 · three times rule · 3D" / ""; }
:lang(es) .oviz[data-oviz="three"]::after { content: "selvi.org · NFPA 13 · regla de tres veces · 3D"; content: "selvi.org · NFPA 13 · regla de tres veces · 3D" / ""; }

.oviz:not(.is-ready):not(:has(.oviz-still)) { display: none; }
/* Durağan kare (images/viz): 3B / betik yokken görünür, Google Görseller'e girer */
.oviz .oviz-still { display: block; width: 100%; height: auto; border: 0; border-radius: 0; background: var(--o-stage); }
.post-content .oviz .oviz-still { border: 0; border-radius: 0; }
/* .is-ready: js/obstruction-viz.js DOM kabuğunu sayfa açılırken kurar (sahne kabı + kontroller; figür son
   yüksekliğinde). Durağan kare sahne kabına taşınır ve 3B sahne gelene kadar (.is-live) sahnenin yerini tutar. */
.oviz .oviz-stage > .oviz-still { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: contain; }
.oviz.is-live .oviz-stage > .oviz-still { display: none; }

.oviz-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--o-stage);
  border-bottom: 1px solid var(--border, oklch(1 0 0 / 0.08));
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.oviz-stage:active { cursor: grabbing; }
.oviz-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.oviz-ann { pointer-events: none; }
/* CANLI rozeti: sahne kurulunca üst çubuğun sağında (sahne çubuğun hemen altındadır) */
.oviz-stage::after {
  position: absolute; right: 12px; top: -31px; z-index: 2;
  padding: 2px 8px 2px 20px; border-radius: 6px;
  border: 1px solid oklch(0.80 0.15 62 / 0.3);
  background:
    radial-gradient(circle at 10px 50%, var(--accent) 0 2.5px, oklch(0.80 0.15 62 / 0.4) 3.5px, transparent 5px),
    var(--accent-soft, oklch(0.80 0.15 62 / 0.12));
  font-family: var(--font-mono); font-size: 11px; line-height: 1.55; letter-spacing: 0.04em;
  color: var(--accent); pointer-events: none;
  content: "CANLI"; content: "CANLI" / "";
}
:lang(en) .oviz-stage::after { content: "LIVE"; content: "LIVE" / ""; }
:lang(es) .oviz-stage::after { content: "EN VIVO"; content: "EN VIVO" / ""; }

.oviz-hud {
  position: absolute; left: 14px; top: 14px; right: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  pointer-events: none;
}
.oviz-pill {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.oviz-pill.ok { color: var(--o-ok); background: oklch(0.86 0.13 165 / 0.14); border: 1px solid oklch(0.86 0.13 165 / 0.5); }
.oviz-pill.bad { color: oklch(0.82 0.11 25); background: oklch(0.72 0.17 25 / 0.18); border: 1px solid oklch(0.72 0.17 25 / 0.6); }
.oviz-pill.na { color: var(--o-na); background: oklch(1 0 0 / 0.08); border: 1px solid oklch(1 0 0 / 0.22); }
.oviz-hud-t {
  font-family: var(--font-sans); font-size: 12.5px; line-height: 1.35; color: var(--foreground);
  padding: 5px 11px; border-radius: 9px;
  background: oklch(0.135 0.004 270 / 0.72);
  border: 1px solid oklch(1 0 0 / 0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}
.oviz-hint {
  position: absolute; right: 12px; bottom: 10px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1.4; color: oklch(1 0 0 / 0.7);
  padding: 2px 8px; border-radius: 7px;                 /* HUD hapı gibi koyu zemin: sahnenin açık zemini üstünde de ≥ 4,5:1 */
  background: oklch(0.135 0.004 270 / 0.78); border: 1px solid oklch(1 0 0 / 0.1);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.oviz-ctrl { display: grid; gap: 16px; padding: 18px 20px 6px; }
.oviz-chips { display: grid; gap: 8px; }
.oviz-lbl {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--subtle-foreground);
}
.oviz-slider label > span {
  font-family: var(--font-sans); font-size: 13px; font-weight: 400; letter-spacing: -0.005em; line-height: 1.4;
  color: var(--muted-foreground);
}
.oviz-chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.oviz-chiprow button {
  font: inherit; font-size: 13px; line-height: 1.5; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  color: var(--muted-foreground); background: oklch(1 0 0 / 0.03);
  border: 1px solid var(--border);
  transition: color var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.oviz-chiprow button:hover { color: var(--foreground); border-color: var(--border-strong); background: oklch(1 0 0 / 0.06); }
.oviz-chiprow button.on { color: var(--foreground); background: var(--accent-soft); border-color: oklch(0.80 0.15 62 / 0.55); box-shadow: 0 0 0 3px oklch(0.80 0.15 62 / 0.08); }

.oviz-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 24px; }
.oviz-slider { display: grid; gap: 8px; }
.oviz-slider[hidden] { display: none; }
.oviz-slider label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.oviz-slider output { font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.oviz-slider input[type=range] {
  --k: 50%;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; margin: 8px 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent) 0 var(--k), oklch(1 0 0 / 0.12) var(--k) 100%);
}
.oviz-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px oklch(0.80 0.15 62 / 0.15), 0 2px 10px oklch(0 0 0 / 0.5);
}
.oviz-slider input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px oklch(0.80 0.15 62 / 0.15), 0 2px 10px oklch(0 0 0 / 0.5);
}

.oviz-read { margin: 0; font-size: 14px; line-height: 1.65; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.oviz-read b, .oviz-read strong { color: var(--foreground); }

.oviz-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding-bottom: 6px; }
.oviz-btn {
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.5; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  color: var(--muted-foreground); background: oklch(1 0 0 / 0.03); border: 1px solid var(--border-strong);
  transition: color var(--transition), border-color var(--transition);
}
.oviz-btn:hover { color: var(--foreground); border-color: oklch(0.80 0.15 62 / 0.55); }
.oviz button:focus-visible, .oviz input:focus-visible { outline: 2px solid var(--ring, var(--accent)); outline-offset: 3px; }
.oviz-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; color: var(--subtle-foreground); }
.oviz-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.oviz-legend i:first-child { margin-left: 0; }
.oviz-legend .lg-wet { background: linear-gradient(135deg, #4FB4FF, #1E6FD0); box-shadow: 0 0 8px rgba(79, 180, 255, 0.6); }
.oviz-legend .lg-dry { background: #2a2b30; border: 1px solid oklch(1 0 0 / 0.2); }
.oviz-legend .lg-ring { border-radius: 50%; border: 2px solid var(--o-ok); }

.oviz figcaption {
  margin: 0; padding: 16px 20px 20px;
  text-align: left; font-style: normal;
  font-size: 14px; line-height: 1.62; color: var(--muted-foreground);
  border-top: 1px solid var(--border); background: oklch(0.15 0.005 270);
}
.oviz figcaption strong { color: var(--foreground); font-weight: 600; }
.oviz:not(.is-ready) .oviz-still + figcaption { border-top: 0; }

/* Sahnede seçili tablo satırı (temel kural css/sd/30-icerik.css'te; burası eski sayfalar için yedek) */
.data-table tr.is-on td { background: oklch(0.80 0.15 62 / 0.12); color: var(--foreground); }
.data-table tr.is-on td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.data-table tr td { transition: background 0.25s; }

@media (max-width: 640px) {
  .oviz, figure.oviz { margin: 26px calc(-1 * var(--yan, 16px)); border-radius: 0; border-left: 0; border-right: 0; }
  .oviz::after { max-width: calc(100% - 172px); font-size: 11px; padding-left: 24px; background-position: -2px 50%, 0 0; }
  .oviz-stage { aspect-ratio: 1 / 1.02; }
  .oviz-hud { left: 10px; top: 10px; right: 10px; }
  .oviz-hud-t { font-size: 12px; }
  .oviz-ctrl { padding: 16px 16px 4px; }
  .oviz figcaption { padding: 14px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .oviz-pill, .data-table tr td { transition: none; }
}
@media (max-width: 640px), (pointer: coarse) { .oviz-chiprow button, .oviz-btn { min-height: 40px; } }
