/* =============================================
   CodeToFun — HTML Example Editor (overlay)
   Loaded AFTER html-editor.css to add the
   context bar and adjust the editor workspace.
   ============================================= */

/* --- Context bar above toolbar --- */
.example-context-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.4rem 1rem;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8125rem;
  min-height: 2rem;
}
.example-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
}
.example-back-btn:hover {
  color: #1d4ed8;
}
.example-back-btn svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
}
.example-context-sep {
  color: #cbd5e1;
  font-size: 0.75rem;
}
.example-context-title {
  color: #475569;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Workspace height: account for header (4rem) + context bar (~2.125rem) --- */
.example-editor-page .editor-workspace {
  height: calc(100vh - 4rem - 2.125rem);
}

/* --- Small screens: hide top navbar for more space --- */
@media (max-width: 600px) {
  .example-editor-page .site-header {
    display: none;
  }
  .example-editor-page .editor-workspace {
    height: calc(100vh - 2.125rem);
  }
}

/* --- Reset button --- */
.ed-btn.btn-reset {
  background: #ea580c;
}
.ed-btn.btn-reset:hover {
  background: #c2410c;
}

/* --- Copy button in code panel tab --- */
.ed-btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #fff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.ed-btn-copy:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}
.ed-btn-copy svg {
  flex-shrink: 0;
}

/* --- Hide below-fold content that ships in html-editor.css --- */
.example-editor-page .editor-content {
  display: none;
}

/* --- Mobile: context bar wraps nicely --- */
@media (max-width: 499px) {
  .example-context-bar {
    padding: 0.35rem 0.75rem;
    gap: 0.4rem;
    font-size: 0.75rem;
  }
  .example-editor-page .editor-workspace {
    height: calc(100vh - 1.875rem);
  }
}
