/**
 * editor-layout.css — Three-pane dark editor for review.html
 * (Issue 136 + 2026-06-07 redirect — softer, rounder, more "futuristic").
 *
 * Layout: CSS Grid with three columns:
 *   .editor-player     | left, fluid           | the 9:16 video + meta + actions
 *   .editor-transcript | middle, fixed 35rem   | always-visible transcript pane
 *   .editor-tools      | right, --editor-strip-width | vertical icon strip
 *
 * Soft direction:
 *   - Panel radius is --editor-radius (12px), not the 4px data-page lock.
 *   - Subtle indigo-tinted surfaces (#0b0c12 / #14161f / #1c1f2c).
 *   - Drawer is a glassmorphism panel (backdrop-filter blur + accent glow).
 *   - 220ms ease-out for the slide-in instead of the snappy 120ms.
 *
 * Visibility is driven by a single data-active-tool attribute on
 * .editor-shell; each drawer panel declares data-tool="x".
 *
 * Mobile: at <=900px the three columns stack vertically and the drawer
 * becomes a bottom sheet. No JS branch — pure media query.
 */

body.editor-page {
  background: var(--editor-bg);
  color: var(--color-text);
  min-height: 100vh;
  /* A faint aurora on the editor surface, matching the hero feel. */
  background-image: var(--gradient-aurora);
  background-repeat: no-repeat;
  background-position: 50% -200px;
  background-size: 1400px 600px;
}

/* Soften the shared nav for the editor surface so it doesn't compete
   with the player for visual weight. */
body.editor-page .nav {
  border-bottom: 1px solid var(--editor-border);
  background: rgba(11, 12, 18, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.editor-shell {
  display: grid;
  grid-template-columns: 1fr 35rem var(--editor-strip-width);
  grid-template-areas: "player transcript tools";
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  position: relative;
  min-height: calc(100vh - 60px); /* leave room for nav */
}

.editor-player {
  grid-area: player;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset,
              0 20px 60px -30px rgba(0, 0, 0, 0.5);
}
.editor-player video {
  width: 100%;
  max-height: 65vh;
  background: #000;
  border-radius: var(--radius-md);
  display: block;
}
.editor-player #clip-meta,
.editor-player #clip-principle,
.editor-player #flash {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.editor-transcript {
  grid-area: transcript;
  background: var(--editor-surface);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset,
              0 20px 60px -30px rgba(0, 0, 0, 0.5);
}
.editor-transcript h2 {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-1);
}

/* The tool rail — a vertical column of labeled tab buttons.
   Each button stacks icon over text label so the panels are discoverable
   without hover. Accent glow on the active tab. */
.editor-tools {
  grid-area: tools;
  background: var(--editor-icon-strip);
  border: 1px solid var(--editor-border);
  border-radius: var(--editor-radius);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: var(--space-2);
  gap: var(--space-2);
}
.editor-tools button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-text-muted);
  width: 100%;
  min-height: 4.25rem;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-align: center;
  transition: background var(--duration) var(--ease),
              color var(--duration) var(--ease),
              border-color var(--duration) var(--ease),
              box-shadow var(--duration) var(--ease);
}
.editor-tools button:hover {
  background: var(--editor-surface-elev);
  color: var(--color-text);
  border-color: var(--editor-border);
}
.editor-tools button[aria-pressed="true"] {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
  color: var(--color-accent);
  box-shadow: var(--glow-accent-soft);
}
.editor-tools button svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.editor-tools .tool-label {
  display: block;
  white-space: nowrap;
}

/* Glassmorphism drawer. Slides in from the right of the icon strip.
   Hidden by default; data-active-tool on .editor-shell controls visibility. */
.editor-drawer {
  position: fixed;
  top: 60px;            /* below nav — kept in sync with nav height */
  right: 0;
  bottom: 0;
  width: var(--editor-drawer-width);
  padding-right: var(--editor-strip-width);  /* leave the icon strip clickable */
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 20;
  pointer-events: none;
}
.editor-shell[data-active-tool]:not([data-active-tool=""]) ~ .editor-drawer {
  transform: translateX(0);
  pointer-events: auto;
}

.editor-drawer-inner {
  height: 100%;
  background: rgba(20, 22, 31, 0.78);
  border-left: 1px solid var(--editor-border-strong);
  border-top-left-radius: var(--radius-xl);
  border-bottom-left-radius: var(--radius-xl);
  padding: var(--space-5);
  overflow-y: auto;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: -20px 0 60px -20px rgba(0, 0, 0, 0.6);
}
.editor-drawer-close {
  position: absolute;
  top: var(--space-3);
  right: calc(var(--editor-strip-width) + var(--space-3));
  background: rgba(28, 31, 44, 0.7);
  border: 1px solid var(--editor-border);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  width: 28px;
  height: 28px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 21;
}
.editor-drawer-close:hover { color: var(--color-text); border-color: var(--editor-border-strong); }

.editor-drawer-panel { display: none; }
.editor-shell[data-active-tool="style"]    ~ .editor-drawer .editor-drawer-panel[data-tool="style"]    { display: block; }
.editor-shell[data-active-tool="clean"]    ~ .editor-drawer .editor-drawer-panel[data-tool="clean"]    { display: block; }
.editor-shell[data-active-tool="why"]      ~ .editor-drawer .editor-drawer-panel[data-tool="why"]      { display: block; }
.editor-shell[data-active-tool="feedback"] ~ .editor-drawer .editor-drawer-panel[data-tool="feedback"] { display: block; }

/* ── Mobile: stack and turn the drawer into a bottom sheet ─────────────── */
@media (max-width: 900px) {
  .editor-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "player"
      "transcript"
      "tools";
    gap: var(--space-2);
    min-height: auto;
  }
  .editor-tools {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    padding: var(--space-2);
    border-radius: var(--radius-xl);
    overflow-x: auto;
  }
  .editor-tools button {
    flex-direction: row;
    width: auto;
    min-height: 2.75rem;
    padding: var(--space-2) var(--space-3);
    gap: 0.5rem;
  }
  .editor-tools button svg { width: 18px; height: 18px; }
  .editor-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    padding-right: 0;
    max-height: 60vh;
    transform: translateY(100%);
  }
  .editor-shell[data-active-tool]:not([data-active-tool=""]) ~ .editor-drawer {
    transform: translateY(0);
  }
  .editor-drawer-inner {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-left: none;
    border-top: 1px solid var(--editor-border-strong);
  }
  .editor-drawer-close {
    right: var(--space-3);
  }
}
