/* styles-additions-v30.css — MB10.7: Single-column composer layout + un-hide
 * postgen intake + collapse drafts grid
 *
 * Loaded AFTER v29.css. Cache buster v=225.
 *
 * SUPERSEDES MB10.5 K4 (v28) and MB10.6 N2 (v29) layout attempts. Both targeted
 * the wrong selectors; the actual 2-column culprit was `.ec-layout-2col` from
 * v22.css plus the `.ec-state-postgen` hide rules from v19.css.
 *
 * Sections:
 *   1. Single-column layout for .ec-layout-2col (O1)
 *   2. Un-hide intake/notes/generate post-generation (O2)
 *   3. Drafts row: single column (O3)
 *   4. Cleanup: remove sticky/drawer behavior on right column
 */


/* =============================================================
 * 1. Single-column layout (O1)
 *
 * v22.css declared:
 *   @media (min-width: 1100px) {
 *     .ec-layout-2col { display: grid; grid-template-columns: 1.5fr 1fr; }
 *   }
 *
 * That grid is the root cause of the "empty left column" appearance the user
 * has flagged across MB10.5 + MB10.6 deploys. We override at ALL viewports
 * (including ≥1100px) to a single-column flex with column-reverse so the
 * RIGHT column (drafts + picked body + sliders) appears on TOP, and the LEFT
 * column (intake + notes + generate) appears BELOW. Matches the user's
 * "drafts at top, intake below" spec.
 * ============================================================= */

.ec-layout-2col {
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: var(--space-3, 12px) !important;
  align-items: stretch !important;
}

/* Wins against v22.css's `@media (min-width: 1100px)` rules too — same
 * specificity but loaded later. */
@media (min-width: 1100px) {
  .ec-layout-2col {
    display: flex !important;
    flex-direction: column-reverse !important;
    grid-template-columns: none !important;  /* belt + suspenders for cascade */
    gap: var(--space-3, 12px) !important;
  }
}


/* =============================================================
 * 2. Column reset: no sticky, no drawer, full width (O1 cont.)
 * ============================================================= */

.ec-col-left,
.ec-col-right {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
  /* Wipe v22.css's sticky positioning on the right column at ≥1100px */
  position: static !important;
  top: auto !important;
  align-self: stretch !important;
  /* Wipe v22.css's drawer transform/fixed at <1100px */
  transform: none !important;
  right: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  background: transparent !important;
  box-shadow: none !important;
  /* v22.css line 148: right column had a left border + left padding */
  border-left: none !important;
  padding-left: 0 !important;
}

/* Hide the drawer's manual close button (no drawer = no need to close it) */
.ec-drawer-close {
  display: none !important;
}

/* Hide the assist-toggle button at narrow viewports (was opening the drawer
 * which no longer exists) */
.ec-assist-toggle {
  display: none !important;
}


/* =============================================================
 * 3. Un-hide intake/notes/paste-toggle/generate in postgen (O2)
 *
 * v19.css hid these post-generate so the right column could take over.
 * With single-column + column-reverse, the intake should remain accessible
 * BELOW the drafts so the user can tweak goal/tone/product and re-generate
 * without losing context.
 *
 * Explicit display values (not `revert`) because each element has its own
 * intended display from v19/v20:
 *   .ec-intake-fieldset   → flex (column)
 *   .ec-notes-section     → block
 *   .ec-paste-toggle-row  → flex (centered)
 *   .ec-generate-row      → flex (centered)
 * ============================================================= */

.ec-modal.ec-state-postgen .ec-intake-fieldset {
  display: flex !important;
}
.ec-modal.ec-state-postgen .ec-notes-section {
  display: block !important;
}
.ec-modal.ec-state-postgen .ec-paste-toggle-row {
  display: flex !important;
}
.ec-modal.ec-state-postgen .ec-generate-row {
  display: flex !important;
}

/* When postgen, compact the intake visually so it doesn't dominate — drafts
 * are the focus, intake is secondary. */
.ec-modal.ec-state-postgen .ec-pregen-section {
  background: var(--surface-subtle, #f8f8f7);
  border-radius: 8px;
  padding: var(--space-3, 12px);
  margin-top: var(--space-3, 12px);
}
.ec-modal.ec-state-postgen .ec-pregen-section .ec-legend {
  font-size: 12px;
  color: var(--text-tertiary, #a3a3a3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* =============================================================
 * 4. Drafts row: single column (O3)
 *
 * v19.css line 688-691:
 *   .ec-drafts-row { display: grid; grid-template-columns: 1fr 1fr; }
 *
 * MB10.5 K2 changed rendering so renderDrafts() writes only the SELECTED
 * draft into this container. With a 2-col grid and one item, the second
 * cell goes empty. Single-column block lets the rendered draft fill the
 * available width.
 * ============================================================= */

.ec-drafts-row {
  display: block !important;
  grid-template-columns: 1fr !important;  /* belt + suspenders */
  gap: 0 !important;
}


/* =============================================================
 * 5. Body editor in picked-body-row: full width + some prominence
 * ============================================================= */

.ec-picked-body-row {
  width: 100%;
  max-width: 100%;
}
.ec-picked-body-row .ec-body-row {
  /* Body editor is prime real estate — frame it */
  border: 2px solid var(--color-accent, #FFD500);
  border-radius: 8px;
  padding: var(--space-3, 12px);
  margin: var(--space-3, 12px) 0;
}
.ec-picked-body-row .ec-textarea {
  /* Make the body textarea taller — was 12 rows, give it room */
  min-height: 200px;
}


/* =============================================================
 * 6. Cleanup of older overrides that no longer apply
 * ============================================================= */

/* v28.css/v29.css's data-batch-mode column rules are now redundant with the
 * unconditional single-column above. They don't conflict (column-reverse
 * everywhere), but the !important wars are over — single source of truth
 * for layout is this v30 sheet. */
