/* ==========================================================================
   Cineon26 Tutorial — Editorial & Interactive Components
   Callouts, Step Lists, Tables, Interactive Labs, Mac Keyboard, Search Modal
   ========================================================================== */

/* Apple-style Callouts */
.callout {
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.68;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  font-size: 14px;
  margin-bottom: 6px;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.callout.tip {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}
.callout.tip .callout-title { color: var(--accent); }

.callout.practice {
  background: var(--film-soft);
  border-color: var(--film-border);
}
.callout.practice .callout-title { color: var(--film); }

.callout.warn {
  background: var(--warn-soft);
  border-color: var(--warn-border);
}
.callout.warn .callout-title { color: var(--warn); }

.callout.danger {
  background: var(--danger-soft);
  border-color: var(--danger-border);
}
.callout.danger .callout-title { color: var(--danger); }

.callout.success {
  background: var(--success-soft);
  border-color: var(--success-border);
}
.callout.success .callout-title { color: var(--success); }

/* Numbered Editorial Step Cards */
.steps-list {
  list-style: none;
  margin: 22px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.step-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.step-badge.amber { background: var(--film); }
.step-item h4 {
  margin: 2px 0 6px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.step-item p { margin: 0 0 8px; font-size: 14.5px; color: var(--ink-secondary); }
.step-item p:last-child { margin-bottom: 0; }

/* Responsive Editorial Tables */
.table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
}
table.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.58;
}
table.doc-table th {
  text-align: left;
  font-weight: 650;
  font-size: 12.5px;
  color: var(--ink-secondary);
  background: var(--surface);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.doc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: top;
}
table.doc-table tr:last-child td { border-bottom: 0; }

/* Two-Column Comparison Cards */
.compare-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0;
}
.compare-box {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.compare-box h4 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-box ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-secondary); }
.compare-box li { margin-bottom: 6px; }
.compare-box.good { border-color: var(--success-border); }
.compare-box.good h4 { color: var(--success); }
.compare-box.bad { border-color: var(--danger-border); }
.compare-box.bad h4 { color: var(--danger); }

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}
details.faq-item {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.16s var(--ease);
}
details.faq-item[open] {
  background: var(--surface-elevated);
  border-color: var(--accent-border);
}
details.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after {
  content: "+";
  font-size: 19px;
  font-weight: 400;
  color: var(--ink-muted);
  transition: transform 0.18s var(--ease);
}
details.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--accent);
}
.faq-answer {
  padding: 0 18px 16px;
  font-size: 14.5px;
  line-height: 1.68;
  color: var(--ink-secondary);
  border-top: 1px solid var(--divider);
  padding-top: 12px;
}
.faq-answer p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Interactive Lab Shell (Studio-grade Dark Frame inside Apple Editorial Page)
   ========================================================================== */

.lab-shell {
  margin: 28px 0;
  border-radius: var(--radius-lg);
  background: var(--studio-bg);
  color: var(--studio-ink);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.lab-shell kbd {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  color: #f3f4f6;
  box-shadow: none;
}

.lab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 20px;
  background: var(--studio-panel);
  border-bottom: 1px solid var(--studio-line);
}
.lab-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mac-dots {
  display: inline-flex;
  gap: 6px;
}
.mac-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.mac-dots .r { background: #ff5f57; }
.mac-dots .y { background: #febc2e; }
.mac-dots .g { background: #28c840; }

.lab-title {
  font-size: 13px;
  font-weight: 600;
  color: #f3f4f6;
}
.lab-badge {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 181, 111, 0.16);
  color: var(--studio-amber);
  font-weight: 600;
}

.lab-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: 10px;
}
.lab-tab {
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 7px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.lab-tab:hover { color: #ffffff; }
.lab-tab[aria-pressed="true"], .lab-tab.is-active {
  background: #2f333d;
  color: #ffffff;
}

.lab-body { padding: 20px; }

/* Studio Controls (iOS/macOS style toggles & sliders inside Labs) */
.studio-switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 99px;
  border: 0;
  padding: 2px;
  background: #3a3d46;
  transition: background-color 0.18s var(--ease);
  flex: 0 0 38px;
}
.studio-switch::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s var(--ease);
}
.studio-switch[aria-checked="true"] { background: #30d158; }
.studio-switch[aria-checked="true"]::after { transform: translateX(16px); }
.studio-switch:disabled { opacity: 0.4; cursor: not-allowed; }

.studio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #252830;
  color: #f3f4f6;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.studio-btn:hover:not(:disabled) {
  background: #323640;
  border-color: rgba(255, 255, 255, 0.28);
}
.studio-btn.primary {
  background: #0a84ff;
  border-color: #0a84ff;
  color: #ffffff;
}
.studio-btn.primary:hover:not(:disabled) { background: #2997ff; }
.studio-btn.amber {
  background: rgba(255, 181, 111, 0.18);
  border-color: rgba(255, 181, 111, 0.45);
  color: var(--studio-amber);
}
.studio-btn.is-active {
  background: #0a84ff;
  border-color: #0a84ff;
  color: #fff;
}
.studio-btn:disabled { opacity: 0.42; cursor: not-allowed; }

.studio-range {
  width: 100%;
  accent-color: #0a84ff;
  cursor: pointer;
}

/* ==========================================================================
   Diagnostic Workbench Specific Styles
   ========================================================================== */

.diag-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.diag-stage {
  background: #090a0c;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.diag-viewport {
  position: relative;
  aspect-ratio: 16 / 10.6;
  max-height: 360px;
  margin: 0 auto;
  background: #08090b;
  overflow: hidden;
  user-select: none;
}
.diag-viewport.picker-mode { cursor: crosshair; }

.diag-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: #14161b;
  border-top: 1px solid var(--studio-line);
  font-size: 12px;
  color: #b8bcc4;
  flex-wrap: wrap;
}

.diag-hist {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  padding: 6px 10px;
  background: #121419;
  border-radius: 8px;
  border: 1px solid var(--studio-line);
}

.diag-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.diag-controls > .diag-step-card:first-child {
  grid-column: 1 / -1;
}

.diag-step-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--studio-panel);
  border: 1px solid var(--studio-line);
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.diag-step-card.is-recommended {
  border-color: rgba(255, 181, 111, 0.55);
  background: rgba(255, 181, 111, 0.06);
}
.diag-step-card.is-solved {
  border-color: rgba(48, 209, 88, 0.42);
}

.diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.diag-step-label {
  font-size: 13px;
  font-weight: 600;
  color: #f3f4f6;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.diag-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: #d1d5db;
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.diag-step-card.is-recommended .diag-step-num {
  background: var(--studio-amber);
  color: #161618;
}
.diag-step-card.is-solved .diag-step-num {
  background: #30d158;
  color: #091c0e;
}

.diag-subnote {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: #9ca3af;
}

.diag-coach {
  margin-top: 14px;
  padding: 13px 16px;
  border-radius: 12px;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.30);
  font-size: 13px;
  line-height: 1.62;
  color: #dbeafe;
}
.diag-coach.solved {
  background: rgba(48, 209, 88, 0.13);
  border-color: rgba(48, 209, 88, 0.34);
  color: #d1fae5;
}

/* ==========================================================================
   Interactive Workspace Explorer
   ========================================================================== */

.ws-mock {
  display: grid;
  grid-template-rows: 42px 1fr;
  border: 1px solid var(--studio-line);
  border-radius: 12px;
  overflow: hidden;
  background: #0d0e11;
}
.ws-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  background: #1b1d22;
  border-bottom: 1px solid var(--studio-line);
  overflow-x: auto;
}
.ws-tb-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ws-tb-btn {
  border: 1px solid transparent;
  background: transparent;
  color: #c7cbd4;
  font-size: 11.5px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.ws-tb-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.ws-tb-btn.is-on {
  background: rgba(10, 132, 255, 0.25);
  border-color: rgba(10, 132, 255, 0.55);
  color: #fff;
}

.ws-columns {
  display: grid;
  grid-template-columns: 186px 1fr 170px;
  min-height: 316px;
  transition: grid-template-columns 0.22s var(--ease);
}
.ws-columns.focus-mode {
  grid-template-columns: 0 1fr 0;
}
.ws-columns.focus-mode .ws-pane {
  opacity: 0;
  pointer-events: none;
  padding: 0;
  border: 0;
  overflow: hidden;
}

.ws-pane {
  background: #15171c;
  padding: 10px;
  font-size: 11.5px;
  color: #c7cbd4;
  border-right: 1px solid var(--studio-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: outline-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.ws-pane.right {
  border-right: 0;
  border-left: 1px solid var(--studio-line);
}
.ws-pane.is-selected {
  box-shadow: inset 0 0 0 1.5px var(--studio-amber);
  background: #1b1e25;
}

.ws-canvas {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  transition: background-color 0.2s var(--ease);
  cursor: pointer;
}
.ws-canvas.bg-black { background: #090a0c; }
.ws-canvas.bg-gray { background: #4c4d52; }
.ws-canvas.bg-white { background: #f2f2f5; }
.ws-canvas.is-selected { box-shadow: inset 0 0 0 1.5px var(--studio-amber); }

.ws-surround-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(18, 20, 25, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  padding: 0;
}
.swatch-dot.is-active { outline: 2px solid var(--studio-amber); outline-offset: 2px; }

.ws-inspector-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--studio-panel);
  border: 1px solid var(--studio-line);
  font-size: 13.5px;
  line-height: 1.65;
}
.ws-inspector-note strong { color: var(--studio-amber); }

/* ==========================================================================
   Pipeline Explorer, Film Catalog, White-Border Calc, Mac Keyboard Diagram
   ========================================================================== */

.pipeline-strip {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.pipe-node {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--studio-line);
  background: var(--studio-panel);
  color: #d1d5db;
  text-align: left;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.pipe-node:hover { border-color: rgba(255, 255, 255, 0.3); }
.pipe-node.is-active {
  border-color: var(--studio-amber);
  background: rgba(255, 181, 111, 0.12);
  color: #ffffff;
}
.pipe-node small {
  display: block;
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 3px;
}
.pipe-node strong {
  display: block;
  font-size: 12.5px;
}

/* Catalog Filter Bar */
.catalog-widget {
  margin: 24px 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.catalog-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.catalog-input {
  flex: 1 1 200px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  font-size: 13.5px;
}
.catalog-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-elevated);
  font-size: 13.5px;
}
.film-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.film-chip {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  font-size: 13px;
}
.film-chip strong { display: block; font-size: 13.5px; margin-bottom: 3px; }
.film-chip-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-muted);
}

/* Interactive Mac Keyboard Diagram (modeled after ShortcutKeyboardDiagram.swift) */
.kb-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
}
.kb-board {
  min-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.kb-row {
  display: grid;
  gap: 5px;
}
.kb-key {
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #17191e;
  color: #6b7280;
  padding: 4px 5px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  transition: background-color 0.14s var(--ease), border-color 0.14s var(--ease), transform 0.12s var(--ease);
}
.kb-row.fn-row .kb-key { min-height: 30px; justify-content: center; }
.kb-key.has-shortcut {
  background: #282c36;
  border-color: rgba(255, 255, 255, 0.24);
  color: #f9fafb;
}
.kb-key.has-shortcut:hover, .kb-key.is-selected {
  background: #0a84ff;
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}
.kb-key-top {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.kb-key-cap {
  font-size: 9.5px;
  line-height: 1.2;
  color: #d1d5db;
  word-break: break-word;
}
.kb-key.is-selected .kb-key-cap, .kb-key.has-shortcut:hover .kb-key-cap { color: #ffffff; }

/* White Background Scale Calculator */
.wb-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: center;
}
.wb-stage {
  display: grid;
  place-items: center;
  padding: 20px;
  background: #0e1014;
  border-radius: 12px;
  border: 1px solid var(--studio-line);
  min-height: 260px;
}
.wb-paper {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  transition: all 0.25s var(--ease);
  position: relative;
}
.wb-photo {
  background: linear-gradient(155deg, #3c5472 0%, #c87b5e 58%, #2a2433 100%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.25s var(--ease);
}

/* ==========================================================================
   Command-K Search Modal
   ========================================================================== */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: start center;
  padding: min(11vh, 96px) 16px 24px;
}
.search-modal[hidden] { display: none; }

.search-dialog {
  width: min(640px, 100%);
  max-height: min(74vh, 600px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--surface-glass-strong);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-tertiary);
}
.search-header input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.search-close {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 11.5px;
  color: var(--ink-tertiary);
}

.search-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.search-result-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--ink);
  transition: background-color 0.12s var(--ease);
}
.search-result-item:hover, .search-result-item.is-selected {
  background: var(--accent-soft);
}
.search-result-item strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.search-result-item small {
  display: block;
  font-size: 12px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}
.search-result-kind {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-tertiary);
  border: 1px solid var(--border);
}

.search-empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--ink-tertiary);
  font-size: 14px;
}

.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--ink-muted);
}

.geo-lab-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  align-items: center;
}
.split-frames-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 820px) {
  .diag-grid, .diag-controls, .compare-cards, .wb-grid, .geo-lab-grid { grid-template-columns: 1fr; }
  .split-frames-grid { grid-template-columns: repeat(2, 1fr); }
  .ws-columns { grid-template-columns: 1fr; }
  .ws-pane { border-right: 0; border-left: 0; border-bottom: 1px solid var(--studio-line); }
  .ws-pane.right { border-left: 0; border-top: 1px solid var(--studio-line); }
}
