/* mySurgery OP-Player — zentrales Stylesheet
 * Datei: /wp-content/themes/kadence-mysurgery/assets/css/mysurgery-op-player.css
 * Alle Regeln bewusst auf .ms-op begrenzt.
 */
.ms-op {
  --ms-op-ink: #27313d;
  --ms-op-muted: #68727d;
  --ms-op-line: #c8cdd2;
  --ms-op-accent: #596879;

  color: var(--ms-op-ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.ms-op, .ms-op * { box-sizing: border-box; }
.ms-op .ms-op-heading { font-size: clamp(20px, 2.2vw, 28px); font-weight: 750; margin: 0 0 14px; }
.ms-op .ms-op-lead { font-size: 14px; color: var(--ms-op-muted); margin: 0 0 16px; }
.ms-op .ms-op-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(245px, 1fr);
  border: 1px solid var(--ms-op-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 25px #24344b0a;
}
.ms-op .ms-op-left { min-width: 0; background: #121619; display: flex; flex-direction: column; justify-content: center; }
.ms-op .ms-op-player { width: 100%; aspect-ratio: 16 / 9; position: relative; background: #101417; }
.ms-op .ms-op-player iframe { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ms-op .ms-op-panel { background: #e7e7e7; min-width: 0; display: flex; flex-direction: column; max-height: min(65vw, 550px); }

/* Leiste über den Operationsschritten */
.ms-op .ms-op-panelhead {
  padding: 14px 16px;
  background: #465b7c;
  border-bottom: 1px solid var(--ms-op-line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
}

/* Kapitelliste in Grautönen */
.ms-op .ms-op-steps { overflow-y: auto; overscroll-behavior: contain; min-height: 0; scrollbar-gutter: stable; background: #ebebeb; }
.ms-op .ms-op-step {
  appearance: none;
  border: 0;
  border-bottom: 1px solid #d0d0d0;
  background: #ededed;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 11px 12px;
  color: #313b45;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
  transition: background-color .16s ease, box-shadow .16s ease;
}
.ms-op .ms-op-step:hover:not([aria-current="step"]) { background: #dedede; }
.ms-op .ms-op-step:focus-visible { outline: 3px solid #718598; outline-offset: -3px; }
/* Aktives Kapitel: dunkler, mit eingedrückter Schaltflächenwirkung */
.ms-op .ms-op-step[aria-current="step"] {
  background: #bfc2c5;
  color: #202832;
  border-bottom-color: #a4a7aa;
  box-shadow: inset 0 3px 7px rgba(0,0,0,.20), inset 4px 0 0 #707781, inset 0 -1px 0 rgba(255,255,255,.40);
  cursor: default;
}
.ms-op .ms-op-step[aria-current="step"] .ms-op-thumb { filter: brightness(.87) saturate(.75); }
.ms-op .ms-op-thumb { width: 82px; aspect-ratio: 16 / 10; border-radius: 5px; object-fit: cover; background: #d0d0d0; }
.ms-op .ms-op-stepnum { font-size: 11px; color: #64707b; display: block; margin-bottom: 4px; font-weight: 700; }
.ms-op .ms-op-step[aria-current="step"] .ms-op-stepnum { color: #414d59; }
.ms-op .ms-op-steptitle { font-size: 13px; font-weight: 700; line-height: 1.32; display: block; }
.ms-op .ms-op-notes { border: 1px solid var(--ms-op-line); border-radius: 12px; background: #fff; margin-top: 14px; padding: 18px 22px; }
.ms-op .ms-op-notes h3 { margin: 0 0 10px; font-size: 19px; font-weight: 750; }
.ms-op .ms-op-notes p { margin: 4px 0 10px; line-height: 1.6; }
.ms-op .ms-op-notes ul { margin: 0; padding-left: 21px; display: grid; gap: 5px; line-height: 1.55; }
.ms-op .ms-op-notes li { text-align: left; hyphens: none; }
.ms-op .ms-op-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.ms-op .ms-op-count { font-size: 13px; color: var(--ms-op-muted); }
.ms-op .ms-op-controls { display: flex; gap: 8px; }
.ms-op .ms-op-nav { background: #fff; border: 1px solid #c5cbd0; border-radius: 7px; padding: 9px 13px; font: 600 13px system-ui, sans-serif; cursor: pointer; color: #344353; }
.ms-op .ms-op-nav:disabled { opacity: .35; cursor: not-allowed; }
.ms-op .ms-op-nav:not(:disabled):hover { background: #e9ecef; }
@media (max-width: 760px) {
  .ms-op .ms-op-grid { grid-template-columns: 1fr; }
  .ms-op .ms-op-panel { max-height: 255px; }
  .ms-op .ms-op-steps { display: grid; grid-template-columns: 1fr 1fr; }
  .ms-op .ms-op-step { grid-template-columns: 56px 1fr; gap: 8px; padding: 8px; }
  .ms-op .ms-op-thumb { width: 56px; }
  .ms-op .ms-op-notes { padding: 15px; }
  .ms-op .ms-op-panelhead { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .ms-op .ms-op-steps { grid-template-columns: 1fr; }
  .ms-op .ms-op-panel { max-height: 215px; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-op .ms-op-step { transition: none; }
}

/* =========================================================
   Desktop: Die 16:9-Videoflaeche bestimmt die Galeriehoehe.
   Die rechte Navigation liegt innerhalb dieser Hoehe und
   scrollt unabhaengig von der Anzahl der OP-Schritte.
   ========================================================= */
@media (min-width: 761px) {
  .ms-op .ms-op-grid {
    position: relative;
    display: block;
    padding-right: 34.48275862%; /* 1 von 2.9 Grid-Anteilen */
  }

  .ms-op .ms-op-left {
    width: 100%;
    min-height: 0;
  }

  .ms-op .ms-op-player {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .ms-op .ms-op-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 34.48275862%;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
  }

  .ms-op .ms-op-steps {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

/* mySurgery – OP-Galerie
   Abstand zwischen Thumbnail und Schritttext */

.ms-op .ms-op-step {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ms-op .ms-op-step img {
    flex-shrink: 0;
}
